<?php

use_class('products_brand');
$class_pb = new products_brand();
if (isset($_GET['killed'])) {
    $brand_id_killed = tep_db_prepare_input($_GET['killed']);
    $brand_killed = $class_pb->retrieveDetail($brand_id_killed);
    $messagebox->add('Brand <strong>' . $brand_killed['brand_name'] . '</strong> has been successfully Killled!', 'green');
}
$brands = $class_pb->retrieveList();
$content = '';
if (count($brands) == 0) {
    $content .= '<h3>No Brand found in database</h3>';
} else {
    $btable = array();
    $bt = array();
    $bt['id'] = 'ID';
    $bt['logo'] = 'Brand Logo';
    $bt['name'] = 'Name';
    $bt['status'] = 'Active in J&amp;G';
    $bt['w100'] = 'Active Products';
    $btable[] = $bt;
    foreach ($brands as $b) {
        $link = '<a href="?open=products-brand&amp;id=' . $b['products_brand_id'] . '">%s</a>';
        $logo = $b['brand_image'] == '' ? '<span class="notice">No Logo</span>' : sprintf($link, webImage($b['brand_image'], '', '50'));
        $bt = array();
        $bt['id'] = sprintf($link, $b['products_brand_id']);
        $bt['logo'] = '<div style="width:100%;height:100%;padding:10px 0;background:#fff;">' . $logo . '</div>';
        $bt['name'] = sprintf($link, $b['brand_name']);
        $status_img = 'icon-tick';
        if ($b['active_status'] != '1') {
while ($row = tep_db_fetch_array($catq)) {
    $product_categories_name[$row['categories_id']] = $row['categories_name'];
}
$categories = load_config('products-categories-sorting');
$catlink = array();
foreach ($categories as $cat_id) {
    $catlink[] = '<a href="?brand_id=' . $brand_id . '&amp;category_id=' . $cat_id . $hide_images_link . '">' . $product_categories_name[$cat_id] . '</a>';
}
$thispage_link_no_hideimages = '?brand_id=' . $brand_id . $category_id_link;
//RETRIEVE BRANDS
$brands = $class_pb->retrieveList();
$brandlink = array();
foreach ($brands as $b) {
    $brandlink[] = '<a href="?brand_id=' . $b['products_brand_id'] . '&amp;' . $category_id_link . $hide_images_link . '">' . $b['brand_name'] . '</a>';
}
$brand = $class_pb->retrieveDetail($brand_id);
echo '<div style="margin-bottom:5px;">Filter brand: ' . implode(' | ', $brandlink) . '</div>';
echo '<div style="margin-bottom:5px;">Filter category: ' . implode(' | ', $catlink) . '</div>';
echo '<div style="margin-bottom:20px;">Hide Images: <a href="' . $thispage_link_no_hideimages . '&amp;hide_images=yes">yes</a> | <a href="' . $thispage_link_no_hideimages . '">no</a></div>';
echo '<h1>Amazon German Products - ' . $brand['brand_name'] . ($category_id > 0 ? ' ' . $product_categories_name[$category_id] : '') . '</h1>';
echo '<ul>';
echo '<li>Inactive Products is excluded from the list</li>';
echo '<li>Data is grabbed based on latest PO we received from each EAN</li>';
echo '<li>What we receive directly in PO is UVP Net and Cost, but what we save is UVP Net and (UVP Net - Cost). UVP value and Cost in this table is recalculated based on this saved data</li>';
echo '</ul>';
$cat_filter = $category_id > 0 ? "INNER JOIN products_to_categories ptc ON ptc.products_id=joi.products_id AND ptc.categories_id={$category_id}" : '';
$q = "\nSELECT\n    joi.products_ean, joi.products_id, joi.article_number, joi.products_articles_id, joi.price, joi.price_received\n    , temp_table.products_image, temp_table.products_price, temp_table.products_price_old\nFROM (\n    SELECT joi2.products_ean, MAX(joi2.jng_sp_orders_items_id) AS id, p.products_image, p.products_price, p.products_price_old\n    FROM jng_sp_orders jo\n    INNER JOIN jng_sp_orders_items joi2 ON joi2.jng_sp_orders_id=jo.jng_sp_orders_id\n    INNER JOIN jng_sp_catalog jc ON jc.jng_sp_id=jo.jng_sp_id AND jc.products_id=joi2.products_id AND jc.active_status='1'\n    INNER JOIN products p ON p.products_id=joi2.products_id AND p.products_brand_id={$brand_id}\n    WHERE jo.jng_sp_id=5\n    GROUP BY products_ean\n) AS temp_table\nINNER JOIN jng_sp_orders_items joi ON joi.jng_sp_orders_items_id=temp_table.id\n{$cat_filter}\nORDER BY products_id, products_articles_id";
$r = tep_db_query($q);
$cols = array();
$cols['no'] = 'No';
if (!$hide_images) {
Esempio n. 3
0
         $qlength = "SELECT products_length AS length FROM products_non_configurator WHERE products_id = {$item['products_id']}";
     } elseif ($item['products_articles_id'] > 0) {
         $qlength = "SELECT length FROM products_articles WHERE products_id = {$item['products_id']} AND products_articles_id = {$item['products_articles_id']}";
     }
     $dlength = tep_db_query($qlength);
     $rlength = tep_db_fetch_array($dlength);
     $return_code_ypos++;
     $n++;
     $pdf->setX($cellstart);
     $pdf->setFont('Arial', '', $fontsize_sml);
     $pdf->Cell($cell1size, $cell_height, $n, 1, 0, 'C');
     $pdf->Cell($cell2size, $cell_height, $item['products_model'], 1);
     $category = $class_o->getCategories($item['orders_products_id']);
     use_class('products_brand');
     $class_pb = new products_brand();
     $product_brand = $class_pb->retrieveDetail($item['products_brand_id']);
     $product_name = $class_pm->displayProductName($item['products_id'], 60);
     $pdf->Cell($cell3size, $cell_height, html_entity_decode($product_name), 1);
     $grosse = $rlength['length'] > 0 ? textLength($rlength['length']) : '';
     $pdf->Cell($cell4size, $cell_height, $grosse, 1, 0, 'C');
     $pdf->Cell($cell5size, $cell_height, '', 1);
     $pdf->Cell($cell6size, $cell_height, '', 1, 1);
     $ypos += $cell_height;
 }
 $ypos += 8;
 /*
                 $pdf->setXY($cellstart, $ypos);
                 $pdf->Cell(10, 10, 'Pos.', 1, 0, 'C');
                 $pdf->MultiCell(30, 5, 'Rücksendegrund'."\n".'(2-stellig)', 1, 'C');
 
                 $n = 0;
Esempio n. 4
0
 $elements_status_raw = true;
 $elements_usage = $class_pm->retrieveElementsUsage($products_id);
 if (count($elements_usage) > 0) {
     $elements_stock = $class_es->retrieveList(WAREHOUSE_ID_ELEMENTS, 'elements_id IN (' . implode(',', array_keys($elements_usage)) . ')');
     foreach ($elements_usage as $eid => $eu) {
         if ($eu['quantity'] > $elements_stock[$eid]) {
             $elements_status_raw = false;
             break;
         }
     }
 } else {
     $elements_status_raw = '<span class="green" title="No Element used Found for this product">NEF</span>';
 }
 $elements_status = is_bool($elements_status_raw) ? '<span class="' . ($elements_status_raw ? 'green">OK</span>' : 'red">NS') . '</span>' : $elements_status_raw;
 $products_agegroup_options = $class_pm->productAgeGroupName();
 $products_brand = $products['products_brand_id'] > 0 ? $class_pb->retrieveDetail($products['products_brand_id']) : '';
 $date_added = date('Y-m-d', strtotime($products['products_date_added']));
 $date_added_time = date('H:i:s', strtotime($products['products_date_added']));
 $last_modified = date('Y-m-d', strtotime($products['products_last_modified']));
 $last_modified_time = date('H:i:s', strtotime($products['products_last_modified']));
 $code_changable = ' readonly="readonly" ';
 if ($pc !== false) {
     $price_changable = ' readonly="readonly" ';
     if ($pc['allow_modification'] == '1') {
         $allow_share = true;
         if ($pc['visible_status'] == 'A') {
             $visible_status_A = 'checked="checked"';
             $visible_status_N = '';
         } else {
             $visible_status_A = '';
             $visible_status_N = 'checked="checked"';
    $l = '<div id="pid-' . $row['products_id'] . '" class="pro-thumb">';
    $l .= '<input type="hidden" name="products_id" value="' . $row['products_id'] . '" />';
    $l .= '<div><a href="' . $link . '" target="_blank" title="Manage product detail ID: ' . $row['products_id'] . '">' . webImage($row['products_image'], '120', '120') . '</a></div>';
    $l .= '<div>' . displayCurrency('EUR', $row['products_price']) . '</div>';
    $l .= '<div class="blue" title="Click to add this product">(+) Add</div>';
    $l .= '</div>';
    return $l;
}
$product = array();
$product_data = $class_pm->retrieveDetail($products_id);
if (!is_null($jng_sp_id)) {
    $product_cat = $class_jc->retrieveDetail(null, $jng_sp_id, $products_id);
}
$product['products_id'] = $product_data['p']['products_id'];
$product['price'] = is_null($jng_sp_id) ? $product_data['p']['products_price'] : $product_cat['price'];
$product['brand'] = $product_data['p']['products_brand_id'] > 0 ? $class_pb->retrieveDetail($product_data['p']['products_brand_id']) : null;
$filter_query = '';
$join_query = array();
if ($type == 'U') {
    //UPSELLING
    if ($filter_query != '') {
        $filter_query .= " AND";
    }
    $filter_query .= " jc.price > {$product['price']}";
} elseif ($type == 'A' || $type == 'D') {
    /*
     WE CANT USE THIS ANYMORE BECAUSE THERE IS NO MORE DEVICE/ACCESSORIES STYLES
    	//ACCESSORY & DEVICE
    	$getstyle = null;
    	$style_car_acc = array('33'=>'32','20'=>'31'); //D => A
     //Function below is already removed, when needed again please use the function from class styles
 function generateLabelName($products_id, $language_id, $category_id = '', $label_brand = '', $label_target = '', $label_category = '', $label_shortname = '', $label_length = '', $label_code = '', $label_promoname = '')
 {
     if ($category_id == '') {
         $product = $this->retrieveDetail($products_id, 'cat');
         $category_id = $product['categories_id'];
     }
     if ($label_brand == '') {
         $label_brand = 'JULIE & GRACE';
         $product = $this->retrieveDetail($products_id, 'p');
         if ($product['p']['products_brand_id'] > 0) {
             use_class('products_brand');
             $class_pb = new products_brand();
             $brand_detail = $class_pb->retrieveDetail($product['p']['products_brand_id']);
             if ($brand_detail['brand_name'] != '') {
                 $label_brand = $brand_detail['brand_name'];
             }
         }
     }
     if ($label_shortname == '') {
         $product = $this->retrieveDetail($products_id, 'pd');
         $label_shortname = $product['pd'][$language_id]['products_short_name'];
     }
     if ($label_length == '') {
         $product = $this->retrieveDetail($products_id, 'pnc');
         if ($product['pnc']['products_length'] > 0) {
             $label_length = $product['pnc']['products_length'];
         }
     }
     $label_length = floatval($label_length);
     $label_length = $label_length > 0 ? str_replace(' ', '', textLength($label_length)) : '';
     $length_prefix_rings = array('1' => 'Size', '2' => 'Größe');
     $length_prefix_other = array('1' => 'Length', '2' => 'Länge');
     if ($label_code == '') {
         $product = $this->retrieveDetail($products_id, 'p');
         $label_code = $product['p']['products_model'];
     }
     $label_name = array();
     $label_name[] = $label_brand;
     $label_name[] = $label_promoname;
     $label_name[] = $label_target == '' ? LABEL_TARGET_AUDIENCE : $label_target;
     $label_name[] = $label_category == '' ? $this->retrieveCategoryName($category_id, $language_id) : $label_category;
     $label_name[] = $label_shortname;
     if ($label_length != '') {
         $label_name[] = ($category_id == '29' ? $length_prefix_rings[$language_id] : $length_prefix_other[$language_id]) . " {$label_length}";
     }
     $label_name[] = $label_code;
     $result = array();
     $result['label_name_split'] = implode(';', $label_name);
     $result['label_name'] = str_replace('  ', ' ', implode(' ', $label_name));
     return $result;
 }
Esempio n. 7
0
 function getEANReturnResult($partner_type, $products_data, $sp_id = '0')
 {
     use_class('jng_sp');
     use_class('orders');
     use_class('jng_sp_orders');
     use_class('Product');
     use_class('products_ean');
     use_class('products_minierp');
     use_class('products_articles');
     use_class('products_brand');
     $class_sp = new jng_sp();
     $class_orders = new orders();
     $class_jo = new jng_sp_orders();
     $class_pean = new products_ean();
     $class_pm = new products_minierp();
     $class_pa = new products_articles();
     $class_pb = new products_brand();
     $result = "no data";
     $product_id = $products_data["products_id"];
     $product_article_id = $products_data["products_articles_id"];
     if ($product_article_id > 0) {
         $articles_data = $class_pa->retrieveDetail($product_article_id);
     }
     $p_ean = $class_pean->getEAN($product_id, $product_article_id);
     $p = $class_pm->retrieveDetail($product_id, 'p,pd,cat,pnc');
     //GETTING BRAND NAME
     $p_brand_id = $p['p']['products_brand_id'];
     $brand_data = $class_pb->retrieveDetail($p_brand_id);
     $brand_name = strtoupper(trim($brand_data['brand_name']));
     $p_brand = $brand_name == '' ? 'JULIE & GRACE' : $brand_name;
     $p_code = $p['p']['products_model'];
     $p_category = mb_strtoupper($class_pm->retrieveCategoryName($p['categories_id'], 2));
     //$p_shortname = "925 SILBER";  //it was $label_material
     //$p_shortname = ($sp_id=='5') ? strtoupper($p['pd']['2']['products_short_name']) : "925 SILBER";
     $sp_used_am_logistic = array_keys(getSalesPartnerUseAmazonLogistic());
     if (in_array($sp_id, $sp_used_am_logistic)) {
         $p_shortname = strtoupper($p['pd']['2']['products_short_name']);
     } else {
         $obj_product = new product($product_id);
         $metal_stamp_code = $obj_product->metal_stamp_code;
         $metal_stamp_info = $metal_stamp_code == 925 ? 'SILBER' : $obj_product->metal_stamp_info;
         $metal_stamp_info = $this->convertToGermanHex($metal_stamp_info);
         $p_shortname = strtoupper("{$metal_stamp_code} {$metal_stamp_info}");
     }
     $p_length = $product_article_id > 0 ? $articles_data['length'] : $p['pnc']['products_length'];
     $p_length = $p_length > 0 ? strtoupper(str_replace(' ', '', textLength($p_length))) : '';
     $p_targetaudience = strtoupper(LABEL_TARGET_AUDIENCE);
     //FOR TEMPORARY WE USING ONLY DAMEN
     if ($partner_type == 'sp') {
         $order_qty = intval($products_data["order_quantity"]);
         $p_price = $products_data['price'];
     } elseif ($partner_type == 'jg') {
         $order_qty = $products_data["products_quantity"];
         $p_price = $products_data['final_price'];
     } elseif ($partner_type == 'dp') {
         $order_qty = $products_data["quantity"];
         $p_price = '0';
     } else {
         $order_qty = '';
         $p_price = '';
     }
     if ($p_ean != '') {
         $return_label = $p_ean . ";" . $p_category . ";" . $p_shortname . ";" . $p_price . " EUR;{$order_qty};{$sp_id};{$p_code};{$p_brand};{$p_length};{$p_targetaudience};{$p_brand_id}";
         $result = $return_label;
     }
     return $result;
 }
        $product = $class_pm->retrieveDetail($products_id, 'pd');
        $product_selling_points = explode(';', $product['pd']['2']['products_selling_points']);
        $product_selling_points_amde = explode(';', $product['pd']['2']['products_selling_points_amde']);
        $result = drawSellingPointsData($product_selling_points, $product_selling_points_amde);
        echo utf8_encode($result);
        exit;
    }
}
$class_pm->drawAttributesPostAction();
$products_id = isset($_GET['id']) && $_GET['id'] != '' ? tep_db_prepare_input($_GET['id']) : null;
if (is_null($products_id)) {
    exit;
}
$draft = new design_draft(null, $products_id);
$product = $class_pm->retrieveDetail($products_id, 'p,pd,pd2,pnc,cat,pci,pei');
$brand = $class_pb->retrieveDetail($product['p']['products_brand_id']);
$length = '';
//SET SELLING POINT IF NOT YET SET
if (!isset($product['pd']['2']['products_selling_points']) || $product['pd']['2']['products_selling_points'] == '' || $product['pd']['2']['products_selling_points'] == null || (!isset($product['pd']['2']['products_selling_points_amde']) || $product['pd']['2']['products_selling_points_amde'] == '' || $product['pd']['2']['products_selling_points_amde'] == null)) {
    $spoint_result = $class_pm->setSellingPointToProducts($products_id);
    $product['pd']['2']['products_selling_points'] = $spoint_result[$products_id]['products_selling_points'];
    $product['pd']['2']['products_selling_points_amde'] = $spoint_result[$products_id]['products_selling_points_amde'];
}
$product_selling_points = explode(';', $product['pd']['2']['products_selling_points']);
$product_selling_points_amde = explode(';', $product['pd']['2']['products_selling_points_amde']);
$product_materials_info = $class_pm->description2_label($product['pd2']);
if ($product['pnc']['products_length'] > 0) {
    $length .= '<strong>' . textLength($product['pnc']['products_length']) . '</strong>';
    $articles = $class_pa->retrieveList($products_id);
    if (count($articles) > 0) {
        foreach ($articles as $a) {