コード例 #1
0
<?php

use_class('Product');
use_class('design_draft');
use_class('products_minierp');
use_class('products_articles');
use_class('products_brand');
use_class('element');
use_class('jng_sp');
use_class('jng_sp_catalog');
use_class('styles');
$class_pm = new products_minierp();
$class_pa = new products_articles();
$class_pb = new products_brand();
$class_sp = new jng_sp();
$class_jc = new jng_sp_catalog();
$class_s = new styles();
$imgsize = '80';
$net_pricer = 1 + VAT;
/**
 * Remove products from style_has_products Table exclude grup Sub Categories (S)
 * @param Int $product_id Product ID
 * @param String $filter_1 Styles ID separated by comma
 * @param String $filter_2 Styles ID separated by comma
 * @return Delete
 */
function removeProducts($product_id, $filter_1 = '', $filter_2 = '')
{
    $q = "DELETE shp.* FROM styles s";
    $q .= " INNER JOIN styles_has_products shp ON shp.styles_id=s.styles_id";
    $q .= " WHERE s.groups!='S' AND shp.products_id='{$product_id}'";
コード例 #2
0
<?php

use_class('CategoryTop');
use_class('Product');
use_class('ProductAttribute');
use_class('jng_sp');
use_class('jng_sp_catalog_params');
use_class('products_brand');
$class_sp = new jng_sp();
$class_jpc = new jng_sp_catalog_params();
$class_pb = new products_brand();
//SP SETTING
salesPartnerCombo();
//AJAX ACTOIN
if (isset($_GET['tab'])) {
    $param_code = tep_db_prepare_input($_GET['tab']);
    $result = '';
    if ($param_code == 'BL') {
        $brands = $class_pb->retrieveList();
        $result .= '<div><table class="form" border="0" cellpadding="0" cellspacing="0">';
        foreach ($brands as $b) {
            $param_id = $b['products_brand_id'];
            $param_name = $b['brand_name'];
            $sp_brands = $class_pb->getSPbrands($param_id);
            $param_value = $sp_brands[$jng_sp_id];
            $checked = $param_value != '' ? 'checked="checked"' : '';
            $result .= '<tr>';
            $result .= '<td width="20"><input type="checkbox" id="param_id_' . $param_code . $param_id . '" class="param_id" value="' . $param_id . '" ' . $checked . ' /></td>';
            $result .= '<td width="150"><label for="param_id_' . $param_code . $param_id . '">' . $param_name . '</label></td>';
            $result .= '<td><input type="text" id="param_value_' . $param_id . '" class="input param_value" value="' . $param_value . '" /></td>';
            $result .= '<td id="param_status_' . $param_code . $param_id . '"></td>';
コード例 #3
0
<?php

use_class('jng_sp');
$class_sp = new jng_sp();
use_class('jng_sp_catalog');
$class_jc = new jng_sp_catalog();
use_class('products_minierp');
$class_pm = new products_minierp();
use_class('products_brand');
$class_pb = new products_brand();
use_class('products_articles');
$class_pa = new products_articles();
//SP SETTING
salesPartnerCombo();
$url_link_path = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
if (isset($_GET['id'])) {
    $product_id = tep_db_prepare_input($_GET['id']);
} elseif (isset($_POST['product_id'])) {
    $product_id = tep_db_prepare_input($_POST['product_id']);
}
//SUBMIT ACTION
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'ADDTOCATALOGUE') {
        $suppliers_products_id = tep_db_prepare_input($_POST['suppliers_products_id']);
        //sp_addProductToCatalog($jng_sp_id, $product_id, $suppliers_products_id);
        $class_jc->addProduct($jng_sp_id, $product_id, $suppliers_products_id);
        header("Location: ?open=sp-product&id={$product_id}");
        exit;
    } elseif ($_POST['me_action'] == 'UPDATECATALOG') {
        $field_id = null;
        $catalog_id = tep_db_prepare_input($_POST['jng_sp_catalog_id']);
コード例 #4
0
 /**
  * get products based on filter (family, main element, symbol, color, and brand)
  * @param Int $product_id Products ID
  * @return Array Array of products ID
  */
 function getProductsCrossSelling($product_id)
 {
     use_class('products_brand');
     use_class('styles_php4');
     use_class('products_minierp');
     use_class('products_family_php4');
     $class_s = new styles();
     $class_pb = new products_brand();
     $class_pm = new products_minierp();
     $max_products = 50;
     $max_products_by_family = 20;
     $max_products_by_main_element = 10;
     $max_products_by_symbol = 30;
     //            $max_products_by_color = 5;
     //            $max_products_by_brand = 5;
     $max_products_by_category = 40;
     $pids = array();
     $p_data = $class_pm->retrieveDetail($product_id, 'p,cat');
     //FAMILY
     $family_id = $p_data['p']['family_id'];
     $obj_family = new products_family(null, $product_id);
     $pid_family = $obj_family->retrieveMembers();
     $pid_family_exclude_kill_prod = $class_pm->filterExcludeKilledProducts($pid_family);
     $pid_similar = $obj_family->getSimilarProducts($product_id, false, false);
     $pids = array_merge($pid_family_exclude_kill_prod, $pid_similar);
     $key = array_search($product_id, $pids);
     unset($pids[$key]);
     $pids = array_slice($pids, 0, 20);
     //MAIN ELEMENT
     $pid_family_filter = implode(",", $pids);
     if ($pid_family_filter == '') {
         if ($p_data['p']['products_brand_id'] == 14) {
             $pid_family_filters = "AND pue.products_id NOT IN ({$product_id}) AND p.products_brand_id = 14 ";
         } else {
             $pid_family_filters = "AND pue.products_id NOT IN ({$product_id})";
         }
     } else {
         if ($p_data['p']['products_brand_id'] == 14) {
             $pid_family_filters = "AND pue.products_id NOT IN ({$pid_family_filter}, {$product_id}) AND p.products_brand_id = 14 ";
         } else {
             $pid_family_filters = "AND pue.products_id NOT IN ({$pid_family_filter}, {$product_id})";
         }
     }
     $main_element_id = $class_pm->getMainElement($product_id);
     if ($main_element_id != NULL) {
         $pid_main_element = $class_pm->getProductsByMainElement($main_element_id, false, $pid_family_filters, "ORDER BY pl.sold_monthly_3 DESC LIMIT {$max_products_by_main_element}");
         $pids = array_merge($pids, $pid_main_element);
     }
     //SYMBOL
     $symbol_id = $class_s->getProductStyle($product_id);
     $pid_main_element_filter = implode(",", $pids);
     if ($pid_main_element_filter == '') {
         if ($p_data['p']['products_brand_id'] == 14) {
             $pid_main_element_filters = "AND shp.products_id NOT IN ({$product_id}) AND p.products_brand_id = 14 ";
         } else {
             $pid_main_element_filters = "AND shp.products_id NOT IN ({$product_id})";
         }
     } else {
         if ($p_data['p']['products_brand_id'] == 14) {
             $pid_main_element_filters = "AND shp.products_id NOT IN ({$pid_main_element_filter}, {$product_id}) AND p.products_brand_id = 14 ";
         } else {
             $pid_main_element_filters = "AND shp.products_id NOT IN ({$pid_main_element_filter}, {$product_id})";
         }
     }
     if ($symbol_id['Symbol'] != '') {
         $pid_symbol = array_keys($class_s->retrieveProducts($symbol_id['Symbol'], false, $pid_main_element_filters, "ORDER BY pl.sold_monthly_3 DESC LIMIT {$max_products_by_symbol}"));
         $pids = array_merge($pids, $pid_symbol);
     }
     //COLOR
     //            $color_id = $class_pm->loadColorPattern($product_id);
     //            if ($color_id) {
     //                $pids_symbol_filter = implode(",", $pids);
     //                if ($pids_symbol_filter == '') {
     //                    $pid_symbol_filters = "AND ptcp.products_id NOT IN ($product_id)";
     //                } else {
     //                    $pid_symbol_filters = "AND ptcp.products_id NOT IN ($pids_symbol_filter, $product_id)";
     //                }
     //                $pid_color = $class_pm->getProductsByColor(
     //                        $color_id[0],
     //                        false,
     //                        $pid_symbol_filters,
     //                        "ORDER BY pl.sold_monthly_3 DESC LIMIT $max_products_by_color");
     //                $pids = array_merge($pids, $pid_color);
     //            }
     //BRAND
     //            $brand_id = $p_data['p']['products_brand_id'];
     //            if ($brand_id) {
     //                $pids_color_filter = implode(",", $pids);
     //                if ($pids_color_filter == '') {
     //                    $pid_color_filters = "AND p.products_id NOT IN ($product_id)";
     //                } else {
     //                    $pid_color_filters = "AND p.products_id NOT IN ($pids_color_filter, $product_id)";
     //                }
     //                $pid_brand = $class_pb->getProducts(
     //                        $brand_id,
     //                        false,
     //                        $pid_color_filters,
     //                        "ORDER BY pl.sold_monthly_3 DESC LIMIT $max_products_by_brand");
     //                $pids = array_merge($pids, $pid_brand);
     //            }
     //CATEGORY
     $cat_id = $p_data['categories_id'];
     $pids_color_filter = implode(",", $pids);
     if ($pids_color_filter == '') {
         if ($p_data['p']['products_brand_id'] == 14) {
             $pid_color_filters = "AND p.products_id NOT IN ({$product_id}) AND p.products_brand_id = 14 ";
         } else {
             $pid_color_filters = "AND p.products_id NOT IN ({$product_id})";
         }
     } else {
         if ($p_data['p']['products_brand_id'] == 14) {
             $pid_color_filters = "AND p.products_id NOT IN ({$pids_color_filter}, {$product_id}) AND p.products_brand_id = 14 ";
         } else {
             $pid_color_filters = "AND p.products_id NOT IN ({$pids_color_filter}, {$product_id})";
         }
     }
     $pid_cat = $class_pm->getProductsByCategory($cat_id, false, $pid_color_filters, "ORDER BY pl.sold_monthly_3 DESC LIMIT {$max_products_by_category}");
     $pids = array_merge($pids, $pid_cat);
     //LIMIT ALL PRODUCTS BY 50
     $pids = array_slice($pids, 0, $max_products);
     $pids_implode = implode(",", $pids);
     if ($p_data['p']['products_brand_id'] == 14) {
         $pids = $class_pb->getProducts($p_data['p']['products_brand_id'], false, "AND p.products_id IN ({$pids_implode})", "ORDER BY pl.sold_monthly_3 DESC LIMIT {$max_products}");
     }
     return $pids;
 }
コード例 #5
0
     if ($item['products_articles_id'] == 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');
 
コード例 #6
0
<?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') {
コード例 #7
0
<?php

ini_set('memory_limit', '256M');
use_class('Product');
use_class('jng_sp');
use_class('jng_sp_catalog');
use_class('jng_sp_upload');
use_class('products_brand');
$class_sp = new jng_sp();
$class_jc = new jng_sp_catalog();
$class_ju = new jng_sp_upload();
$class_pb = new products_brand();
//SP SETTING
salesPartnerCombo();
//SP Lazada & Zalora
$sp_local_id = array('1001', '1002', '1003', '1005');
if (isset($_GET['top_cat_id']) && $_GET['top_cat_id'] != '') {
    $category_top_id = tep_db_prepare_input($_GET['top_cat_id']);
}
$status = $class_ju->retrieveNotSetStatus($jng_sp_id, 'CAT,PRI');
if ($status !== false) {
    $hidemenu = $hidemenuscript == '' ? '' : '&hidemenu=true';
    header("Location: ?open=sp-catalog{$hidemenu}");
    exit;
}
if ($jng_sp_id == '1') {
    //NECKERMANN.DE UPLOAD PROCESS
    //check cron/sp-1-catalog-updater.php
    $content .= '<h3 class="red">' . $jng_sp_name . ': Stock Update is managed by cron</h3>';
} elseif ($jng_sp_id == '2') {
    //OTTO.DE UPLOAD PROCESS
コード例 #8
0
$uploaddir = DIR_WS_IMAGES;
$product_folder = 'products_photos/';
use_class('Product');
use_class('products_minierp');
use_class('products_articles');
use_class('products_brand');
use_class('styles');
use_class('minierp_users');
use_class('production_instruction_manual');
use_class('jng_sp_catalog');
use_class('jng_sp_catalog_params');
use_class('depot_orders');
use_class('elements_stock');
$class_pm = new products_minierp();
$class_pa = new products_articles();
$class_pb = new products_brand();
$class_s = new styles();
$class_mu = new minierp_users();
$class_jc = new jng_sp_catalog();
$class_jcp = new jng_sp_catalog_params();
$class_do = new depot_orders();
$class_es = new elements_stock();
$ebay_name_max_chars = 80;
$ebay_language_id = '2';
function delete_extra_image($pei_id, $pei_name = '')
{
    global $uploaddir;
    $deletion = false;
    $del_image_query = tep_db_query("SELECT * FROM products_extra_images WHERE products_extra_images_id = {$pei_id}");
    $del_image = tep_db_fetch_array($del_image_query);
    $check_double_query = tep_db_query("SELECT * FROM products_extra_images WHERE products_extra_image = '{$del_image['products_extra_image']}'");
コード例 #9
0
<?php

use_class('jng_sp');
$class_sp = new jng_sp();
use_class('products_brand');
$class_pb = new products_brand();
$brands = $class_pb->retrieveList();
$jng_sp_active = $class_sp->retrieveList("", "jng_sp_id");
//GET PAGE
$rowperpage = ROWPERPAGE;
$session_page = 'sp-products-activation';
$page = 1;
if (isset($_GET['page'])) {
    $page = $_GET['page'];
}
//SUBMIT ACTION
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'SETACTIVATION') {
        $jng_sp_id = tep_db_prepare_input($_POST['jng_sp_id']);
        $products_id = tep_db_prepare_input($_POST['products_id']);
        $status = tep_db_prepare_input($_POST['status']);
        if ($jng_sp_id == '0') {
            //JNG ACTIVATION
            $sda = array('products_status' => $status);
            if ($status == '1') {
                $active_date = date('Y-m-d H:i:s');
                $sda['products_last_modified'] = $active_date;
            }
            tep_db_perform('products', $sda, 'update', "products_id={$products_id}");
        } else {
            //SP ACTIVATION
コード例 #10
0
 function copyFromProducts($products_id_to_copied, $products_id_to_applied, $options = '*', $elements_id_to_exclude = '', $skip_same_add_length_composition = false)
 {
     use_class('products_articles');
     $class_pa = new products_articles();
     $have_element_to_exclude = false;
     if ($elements_id_to_exclude != '' && !is_array($elements_id_to_exclude)) {
         $elements_id_to_exclude = explode(',', $elements_id_to_exclude);
         $have_element_to_exclude = true;
     }
     $product = $this->retrieveDetail($products_id_to_copied, 'p,pd,pnc,cat');
     $product_to_applied = $this->retrieveDetail($products_id_to_copied, 'cat');
     $categories_is_same = $product['categories_id'] == $product_to_applied['categories_id'];
     $articles = $class_pa->retrieveList($products_id_to_copied);
     $articles_to_applied = $class_pa->retrieveList($products_id_to_applied);
     $add_length = array();
     $add_length_to_applied = array();
     if (isset($articles) && is_array($articles) && count($articles) > 0) {
         foreach ($articles as $a) {
             $add_length[] = $a['length'];
         }
     }
     if (isset($articles_to_applied) && is_array($articles_to_applied) && count($articles_to_applied) > 0) {
         foreach ($articles_to_applied as $ata) {
             $add_length_to_applied[] = $ata['length'];
         }
     }
     if (!is_array($products_id_to_applied)) {
         $products_id_to_applied = explode(',', $products_id_to_applied);
     }
     if ($options != '*') {
         $options = explode(',', $options);
     }
     //START UPDATE PRODUCT DETAIL TO ALL PRODUCTS WHICH PRODUCT DETAIL IS NOT FILLED
     foreach ($products_id_to_applied as $pid) {
         if ($options == '*' || in_array('cp', $options)) {
             //APPLY COLOR PATTERN
             $cps = $this->loadColorPattern($products_id_to_copied);
             if (count($cps) > 0) {
                 saveColors($pid, implode(',', $cps));
             }
         }
         if ($options == '*' || in_array('b', $options)) {
             //APPLY BRAND
             use_class('products_brand');
             $class_pb = new products_brand();
             $class_pb->updateProductBrand($pid, $product['p']['products_brand_id']);
         }
         if (($options == '*' || in_array('l', $options)) && $categories_is_same) {
             //APPLY LENGTH
             $def_length = $product['pnc']['products_length'];
             $this->saveLength($pid, $def_length, $add_length);
         }
         if ($options == '*' || in_array('eu', $options)) {
             //TODO: CHECK HOW TO ALSO COPY ELEMENTS IF OTHER PRODUCTS STILL DOESN'T HAVE ANY
             //APPLY ELEMENT USED & QTY
             $el_used = $this->retrieveElementsUsage($products_id_to_copied);
             if (count($el_used) > 0) {
                 $elids = array();
                 $elqtys = array();
                 foreach ($el_used as $elid => $el_data) {
                     if ($have_element_to_exclude) {
                         $check_key = array_search($elid, $elements_id_to_exclude);
                         if ($check_key !== false) {
                             continue;
                         }
                     }
                     $elids[] = $elid;
                     $elqtys[] = $el_data['quantity'];
                 }
                 $this->addElementToProducts($pid, $elids, $elqtys);
             }
             //APPLY OVERRIDE ELEMENTS (IF EXISTS) AND HAVE SAME ADDITIONAL LENGTH COMPOSITION
             if (count($add_length) > 0 && $categories_is_same) {
                 $have_same_add_length_composition = true;
                 if (count($add_length) == count($add_length_to_applied)) {
                     foreach ($add_length as $al) {
                         if (!in_array($al, $add_length_to_applied)) {
                             $have_same_add_length_composition = false;
                             break;
                         }
                     }
                 } else {
                     $have_same_add_length_composition = false;
                 }
                 if ($have_same_add_length_composition || $skip_same_add_length_composition) {
                     foreach ($add_length as $length) {
                         $dbq_o = tep_db_query("SELECT * FROM products_articles WHERE products_id = {$products_id_to_copied} AND length = {$length}");
                         $dbq_c = tep_db_query("SELECT * FROM products_articles WHERE products_id = {$pid} AND length = {$length}");
                         if (tep_db_num_rows($dbq_o) > 0 && tep_db_num_rows($dbq_c) > 0) {
                             $r_o = tep_db_fetch_array($dbq_o);
                             $r_c = tep_db_fetch_array($dbq_c);
                             $products_articles_id = $r_c['products_articles_id'];
                             $dbq_ovr = tep_db_query("SELECT * FROM products_articles_use_elements WHERE products_articles_id = {$r_o['products_articles_id']}");
                             while ($r_ovr = tep_db_fetch_array($dbq_ovr)) {
                                 $ovr_elid = $r_ovr['elements_id'];
                                 $dbq_pue_o = tep_db_query("SELECT * FROM products_use_elements WHERE products_use_elements_id = {$r_ovr['products_use_elements_id']}");
                                 $r_pue_o = tep_db_fetch_array($dbq_pue_o);
                                 $dbq_pue_c = tep_db_query("SELECT * FROM products_use_elements WHERE products_id = {$pid} AND elements_id = {$r_pue_o['elements_id']}");
                                 $r_pue_c = tep_db_fetch_array($dbq_pue_c);
                                 $products_use_elements_id = $r_pue_c['products_use_elements_id'];
                                 $ovr_data = array();
                                 if ($have_element_to_exclude) {
                                     $check_key = array_search($r_ovr['elements_id'], $elements_id_to_exclude);
                                     if ($check_key !== false) {
                                         continue;
                                     }
                                 }
                                 $ovr_data['elements_id'] = $r_ovr['elements_id'];
                                 $ovr_data['quantity'] = $r_ovr['quantity'];
                                 $ovr_data['products_articles_id'] = $products_articles_id;
                                 $ovr_data['products_use_elements_id'] = $products_use_elements_id;
                                 $class_pa->overrideElement($products_articles_id, $products_use_elements_id, $ovr_data);
                             }
                         }
                     }
                 }
             }
         }
         if ($options == '*' || in_array('mp', $options)) {
             //APPLY MANUAL PI
             $dbqmp = tep_db_query("SELECT * FROM products_non_configurator pnc WHERE pnc.products_id={$products_id_to_copied}");
             $mpi = tep_db_fetch_array($dbqmp);
             saveManualPI($pid, $mpi['products_instruction']);
         }
         if ($options == '*' || in_array('pl', $options)) {
             //APPLY PRODUCTS LINKING
             use_class('products_linking');
             $class_pl = new products_linking();
             $dbqpl = tep_db_query("SELECT * FROM products_linking WHERE products_id={$products_id_to_copied}");
             while ($r = tep_db_fetch_array($dbqpl)) {
                 $links_id = $r['links_id'];
                 $type = $r['type'];
                 $class_pl->add($pid, $type, $links_id, true);
             }
         }
         if ($options == '*' || in_array('ni', $options)) {
             //APPLY NAVID's
             use_class('jng_sp_catalog');
             $class_jc = new jng_sp_catalog();
             $dbq = tep_db_query("SELECT jng_sp_id, navigation, navigation2, navigation3 FROM jng_sp_catalog WHERE products_id={$products_id_to_copied} ORDER BY jng_sp_id");
             while ($r = tep_db_fetch_array($dbq)) {
                 $nav = $r['navigation'];
                 $nav2 = $r['navigation2'];
                 $nav3 = $r['navigation3'];
                 $class_jc->addProduct($r['jng_sp_id'], $pid);
                 $p_cat = $class_jc->retrieveCatalog($r['jng_sp_id'], "jc.products_id = '{$pid}'");
                 saveCatalog($p_cat[0]['jng_sp_catalog_id'], 'navigation', $nav);
                 saveCatalog($p_cat[0]['jng_sp_catalog_id'], 'navigation2', $nav2);
                 saveCatalog($p_cat[0]['jng_sp_catalog_id'], 'navigation3', $nav3);
             }
         }
     }
 }
コード例 #11
0
<?php

/**
 * Description of scorecardproductsmanagement
 *
 * @author IT TEAM BONOFACTUM
 * @created Jul 8, 2013 3:28:10 PM
 */
use_class('products_brand');
use_class('scorecard');
$class_pb = new products_brand();
$brandlist = $class_pb->retrieveList();
$year_period = date('Y');
$year_previous = strval(intval($year_period) - 1);
$current_month = date('m');
$categories_active = load_config('products-categories-sorting');
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'LOADTABLES') {
        $def_col_width = ' w080';
        $classname_label = 'label w150';
        $periods = array();
        $periods_plan = array();
        for ($m = 1; $m <= 12; $m++) {
            $year = $year_previous;
            $month = str_pad($m, 2, '0', STR_PAD_LEFT);
            $p = $year . $month;
            $periods[] = $p;
            $periods_name[$p] = date('My', strtotime($year . '-' . $month . '-01'));
        }
        for ($m = 1; $m <= 12; $m++) {
            $year = $year_period;
コード例 #12
0
<?php

use_class('jng_sp');
$class_sp = new jng_sp();
use_class('jng_sp_catalog');
$class_jc = new jng_sp_catalog();
use_class('products_brand');
$class_pb = new products_brand();
use_class('products_minierp');
$class_pm = new products_minierp();
//SP SETTING
salesPartnerCombo(true);
//GET PAGE
$session_page = 'sp-products-manage';
$page = 1;
if (isset($_GET['page'])) {
    $page = $_GET['page'];
}
$is_all_sp = $jng_sp_id == '0' ? true : false;
//FILTER OPTIONS
$keywords = '';
$filter_query = " WHERE " . ($is_all_sp ? "" : "jc.jng_sp_id={$jng_sp_id} AND") . " jc.active_status='1'";
if (isset($_POST['nav-filter'])) {
    $navfiltered = tep_db_prepare_input($_POST['nav-filter']);
    if ($navfiltered != '') {
        $_SESSION[$session_page]['nav-filter'] = $navfiltered;
    } else {
        unset($_SESSION[$session_page]['nav-filter']);
    }
} elseif (isset($_SESSION[$session_page]['nav-filter'])) {
    $navfiltered = $_SESSION[$session_page]['nav-filter'];
コード例 #13
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;
 }
コード例 #14
0
 private function renderFilter()
 {
     use_class('jng_sp');
     use_class('products_brand');
     use_class('CategoryTop');
     $class_sp = new jng_sp();
     $class_pb = new products_brand();
     $sp_datas = $class_sp->retrieveList();
     $brands = $class_pb->retrieveList("active_status='1'");
     //FILTER Order Type
     $order_type_selected = self::getSession(self::FILTER_ORDER_TYPE);
     $order_types = array(self::ORDER_TYPE_ALL => 'All Orders', self::ORDER_TYPE_JG => 'JG Orders');
     $order_type_groups['SP Orders'][self::ORDER_TYPE_SP] = 'All SP Orders';
     foreach ($sp_datas as $sp_id => $sp_data) {
         $order_type_groups['SP Orders'][$sp_id] = $sp_data['name'];
     }
     $order_type_groups['Depot Orders'] = $this->DP_ORDER_TYPES;
     $filter_order_type = '<select name="' . self::FILTER_ORDER_TYPE . '" class="cbo_filters">' . loadComboListFromArray($order_types, null, $order_type_selected, true, $order_type_groups) . '</select>';
     /* Filter SP now merged into Filter Order Type
        array_unshift($sp_datas, array(self::FILTER_SP_ID => '0', 'name' => 'All Sales Partners'));
        $filter_sp = $class_sp->drawCombo($sp_datas, $this->filters_sp_id, '', self::FILTER_SP_ID, 'cbo_filters');
         */
     //FILTER Brand
     $brand_options = array();
     $brand_options[0] = 'Show All Brands';
     foreach ($brands as $b) {
         $brand_options[$b['products_brand_id']] = $b['brand_name'];
     }
     $filter_brand = '<select name="' . self::FILTER_BRAND_ID . '" class="cbo_filters">' . loadComboListFromArray($brand_options, null, $this->filters_brand_id, false) . '</select>';
     //FILTER Category
     $category_selected = self::getSession(self::FILTER_CAT_ID);
     $categories = array('' => 'Show All Categories');
     $category_groups = array();
     while ($ct = CategoryTop::getOneByOneAsObject()) {
         if ($ct->getCategoriesTotalCount() > 0) {
             while ($cat = $ct->getCategoriesOneByOneAsObject()) {
                 if ($cat->getProductCodePrefix() != "") {
                     $category_groups[$ct->name][$cat->id] = $cat->getName(1);
                 }
             }
         }
     }
     $filter_category = '<select name="' . self::FILTER_CAT_ID . '" class="cbo_filters">' . loadComboListFromArray($categories, null, $category_selected, true, $category_groups) . '</select>';
     /*
             $filter_category = 
            comboProductsCategory(
                    self::FILTER_CAT_ID
                    , self::FILTER_CAT_ID
                    , $this->filters_cat_id
                    , 'cbo_filters'
                    , ''
                    , 'Show All Category');
     */
     //FILTER Product ID/EAN
     $filter_prod_search = '<input type="text" name="' . self::FILTER_LIST_EAN . '" class="txt_filters input" value="' . $this->filters_list_ean . '" />';
     //FILTER Order No.
     $filter_orders_no = '<input type="text" name="' . self::FILTER_LIST_ORDERS_NO . '" class="txt_filters" value="' . $this->filters_list_orders_no . '" />';
     //FILTER Lead Time Start Date
     $filter_leadtime = '<input name="' . self::FILTER_LEADTIME_START_DATE . '" class="date_picker" value="' . $this->filters_leadtime_date_start . '"/>' . ' to <input name="' . self::FILTER_LEADTIME_END_DATE . '" class="date_picker" value="' . $this->filters_leadtime_date_end . '"/>' . ' <input type="button" value="Go" class="btn_filters_leadtime_go" ' . 'title="Apply lead time start date filter" />' . ' <input type="button" value="Clear" class="date_range_clear" ' . 'title="Clear lead time start date filter" />';
     $enter_info = '<span class="notice smallText" style="font-weight:normal;">' . '(press <em>Enter</em> to filter)</span>';
     $result .= '<div style="margin-bottom:10px;">';
     $result .= '<table border="0" cellpadding="0" cellspacing="0">';
     $result .= '<tr>';
     $result .= '<td class="bold">Order Type</td>';
     //$result .= '<td class="bold">Sales Partner</td>';
     $result .= '<td class="bold">Brand</td>';
     $result .= '<td class="bold">Category</td>';
     $result .= '<td class="bold">Product ID/EAN ' . $enter_info . '</td>';
     $result .= '<td class="bold">Order No. ' . $enter_info . '</td>';
     $result .= '<td class="bold">Lead Time Start Date</td>';
     $result .= '</tr>';
     $result .= '<tr>' . '<td>' . $filter_order_type . '</td>' . '<td>' . $filter_brand . '</td>' . '<td>' . $filter_category . '</td>' . '<td>' . $filter_prod_search . '</td>' . '<td>' . $filter_orders_no . '</td>' . '<td>' . $filter_leadtime . '</td>' . '</tr>';
     $result .= '</table></div>';
     return $result;
 }
コード例 #15
0
<?php

use_class('products_minierp');
$class_pm = new products_minierp();
use_class('jng_sp_catalog');
$class_jc = new jng_sp_catalog();
use_class('products_brand');
$class_pb = new products_brand();
//AJAX ACTION
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'PRODUCTSLINKADD') {
        $products_id = tep_db_prepare_input($_POST['products_id']);
        $type = tep_db_prepare_input($_POST['link_type']);
        $links_id = tep_db_prepare_input($_POST['links_id']);
        use_class('products_linking');
        $class_pl = new products_linking();
        $added = $class_pl->add($products_id, $type, $links_id, true);
        if (count($added) == 0) {
            $links_id = '!' . $links_id;
        }
        echo utf8_encode($links_id);
        exit;
    }
}
//GET PAGE
$session_page = 'sp-products-links-popup';
$page = 1;
if (isset($_GET['page'])) {
    $page = $_GET['page'];
}
//START TEMPLATE
コード例 #16
0
 /**
  * Add products to a family
  * @param Int $products_id
  * @return Boolean
  */
 function addToFamily($products_id)
 {
     if (!is_array($products_id)) {
         $products_id = explode(',', $products_id);
     }
     if ($this->id != '') {
         use_class('products_minierp');
         use_class('products_brand');
         $class_pm = new products_minierp();
         $class_pb = new products_brand();
         $p_added = array();
         //Avoid :
         //1) added product which color is same with product member of a family
         //2) added product which brand is different with family brand
         foreach ($products_id as $pid) {
             $cpids = $class_pm->loadColorPattern($pid);
             $new_product_brand_id = $class_pb->retrieveProductBrand($pid);
             $brand_ok = $new_product_brand_id == $this->brand_id;
             foreach ($cpids as $cpid) {
                 if ($brand_ok && !in_array($cpid, $this->colors)) {
                     $p_added[] = $pid;
                 }
             }
         }
         if (count($p_added) > 0) {
             tep_db_query("UPDATE products SET family_id = '" . $this->id . "' WHERE products_id IN (" . implode(',', $p_added) . ")");
             $this->recalcTotalMembers();
             return true;
         }
     }
     return false;
 }
コード例 #17
0
<?php

use_class('products_brand');
$class_pb = new products_brand();
use_class('jng_sp');
$class_sp = new jng_sp();
$id = isset($_GET['id']) ? $_GET['id'] : '';
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'SAVEPRODUCTSBRAND') {
        $image_uploaded = false;
        $brand_id = tep_db_prepare_input($_POST['brand_id']);
        $active_status = isset($_POST['active_status']) && $_POST['active_status'] == '1' ? '1' : '0';
        $brand_name = tep_db_prepare_input($_POST['brand_name']);
        $brand_description = tep_db_prepare_input($_POST['brand_description'], true);
        $seo_text = tep_db_prepare_input($_POST['seo_text'], true);
        $need_repackaging = isset($_POST['need_repackaging']) && $_POST['need_repackaging'] == '1' ? 1 : 0;
        if (isset($_FILES['brand_image']) && is_uploaded_file($_FILES['brand_image']['tmp_name'])) {
            $brand_folder = 'products_brand';
            $brand_image_file = $brand_folder . '/' . $_FILES['brand_image']['name'];
            $brand_image_path = DIR_WS_IMAGES . $brand_image_file;
            if ($brand_id != '' && $brand['brand_image'] != '') {
                $brand = $class_pb->retrieveDetail($brand_id);
                if ($brand_image_file != $brand['brand_image'] && file_exists(DIR_WS_IMAGES . $brand['brand_image'])) {
                    unlink(DIR_WS_IMAGES . $brand['brand_image']);
                }
            }
            if (!file_exists(DIR_WS_IMAGES . $brand_folder)) {
                mkdir(DIR_WS_IMAGES . $brand_folder, 0755);
            }
            $image_uploaded = move_uploaded_file($_FILES['brand_image']['tmp_name'], $brand_image_path);
            if ($image_uploaded) {
コード例 #18
0
<?php

/**
 * Description of tempamvdproductspricesfrompo
 *
 * @author IT TEAM BONOFACTUM
 * @created Nov 20, 2013 4:54:03 PM
 */
global $db;
require_once '../confy.php';
require_once '../functions.php';
require_once '../functions-2.php';
require_once DIR_WS_FUNCTIONS . 'html_output.php';
tep_db_connect();
use_class('products_brand');
$class_pb = new products_brand();
$brand_id = tep_db_prepare_input($_GET['brand_id']);
if ($brand_id == '') {
    $brand_id = '24';
}
$category_id = tep_db_prepare_input($_GET['category_id']);
$category_id_link = $category_id == 0 ? '' : '&amp;category_id=' . $category_id;
$hide_images = $_GET['hide_images'] == 'yes';
$hide_images_link = !$hide_images ? '' : '&amp;hide_images=yes';
//RETRIEVE PRODUCT CATEGORIES
$product_categories_name = array();
$catq = tep_db_query("SELECT c.categories_id, cd.categories_name FROM categories c INNER JOIN categories_description cd ON cd.categories_id=c.categories_id AND cd.language_id=1 WHERE c.parent_id=0");
while ($row = tep_db_fetch_array($catq)) {
    $product_categories_name[$row['categories_id']] = $row['categories_name'];
}
$categories = load_config('products-categories-sorting');
コード例 #19
0
 function manageOrderList_drawFilter($dpo_option = 'ALL', $dpo_group = '', $ean_list = null, $date_start = null, $date_end = null, $brand_id = null, $cat_id = null)
 {
     $dpo_options = array();
     $dpo_options['ALL'] = 'All Depot Orders';
     $dpo_options['MMO'] = 'Missing Mixed Orders';
     $dpo_options['MAN'] = 'Manual Refill Orders';
     $dpo_options['OUT'] = 'Outsourcing Refill Orders';
     $dpo_options['REF'] = 'Auto Refill Orders (ALL)';
     $dpo_options['RFD'] = 'Auto Refill Orders (Daily)';
     $dpo_options['RFZ'] = 'Auto Refill Orders (Zalando)';
     $dpo_options['NRA'] = 'Non-Refill Orders (ALL)';
     $dpo_options['NRI'] = 'Non-Refill Orders (Internal)';
     $dpo_options['NRO'] = 'Non-Refill Orders (Outsourcing)';
     $dpo_options['GRP'] = 'Specific Name';
     $dpo_grp_options = array();
     $dpo_grp_options = $this->retrieveGroupNameList();
     if (count($dpo_grp_options) == 0) {
         $dpo_grp_options[] = 'No Specific Name found, please use other filter';
     } else {
         array_unshift($dpo_grp_options, 'Select a name from the list');
     }
     $show_group = array('NRA', 'NRI', 'NRO', 'GRP');
     $show_group_combo = in_array($dpo_option, $show_group) ? '' : ' style="display:none;"';
     use_class('products_brand');
     $class_pb = new products_brand();
     $brands = $class_pb->retrieveList("active_status='1'");
     $brand_options = array();
     $brand_options[0] = 'Show All Brands';
     foreach ($brands as $b) {
         $brand_options[$b['products_brand_id']] = $b['brand_name'];
     }
     $filter_dpo = '<select class="orders-dpoo">' . loadComboListFromArray($dpo_options, null, $dpo_option, false) . '</select>';
     $filter_dpo .= '<select class="orders-dpoo-group"' . $show_group_combo . '>' . loadComboListFromArray($dpo_grp_options, $dpo_group, null, false) . '</select>';
     $filter_brand = '<select name="brand_id">' . loadComboListFromArray($brand_options, null, $brand_id, false) . '</select>';
     $filter_category = comboProductsCategory('cat_id', 'cat_id', $cat_id, '', '', 'Show All Category');
     $filter_prod_search = '<input type="text" name="ean_list" class="product-id input2" value="' . $ean_list . '" />';
     $filter_range_date = '<input name="date_range_start" class="date_picker" value="' . $date_start . '"/>';
     $filter_range_date .= ' to ';
     $filter_range_date .= '<input name="date_range_end" class="date_picker" value="' . $date_end . '"/>';
     $filter_range_date .= ' <input type="button" value="Go" class="date_range_go" title="Apply lead time start date filter" />';
     $filter_range_date .= ' <input type="button" value="Clear" class="date_range_clear" title="Clear lead time start date filter" />';
     $result .= '<div style="margin-bottom:10px;">';
     $result .= '<table border="0" cellpadding="0" cellspacing="0">';
     $result .= '<tr>';
     $result .= '<td rowspan="2" class="w080 bold" style="v-align:middle;">Filter by:</td>';
     $result .= '<td class="bold">Depot Order Type</td>';
     $result .= '<td class="bold">Brand</td>';
     $result .= '<td class="bold">Category</td>';
     $result .= '<td class="bold">Product ID/EAN <span class="notice smallText" style="font-weight:normal;">(press <em>Enter</em> to filter)</span></td>';
     $result .= '<td class="bold">Lead Time Start Date</td>';
     $result .= '</tr>';
     $result .= '<tr><td>' . $filter_dpo . '</td><td>' . $filter_brand . '</td><td>' . $filter_category . '</td><td>' . $filter_prod_search . '</td><td>' . $filter_range_date . '</td></tr>';
     $result .= '</table></div>';
     return $result;
 }
コード例 #20
0
ファイル: print-pi.php プロジェクト: blasiuscosa/manobo-2008
require_once DIR_WS_FUNCTIONS . 'html_output.php';
tep_db_connect();
use_class('logger');
$logger = new logger('cron', 'print-pi');
//$logger->write('DEBUGGING MODE, NO PI IS REALLY PRINTED!');
//load settings for red paper
$pi_settings = load_config('production-instruction-settings');
$sp_using_red_paper = explode(',', $pi_settings['red-paper-sp-id']);
$brand_using_red_paper = explode(',', $pi_settings['red-paper-brand-id']);
$type = isset($_POST['type']) ? tep_db_prepare_input($_POST['type']) : '*';
$mode = isset($_POST['mode']) ? tep_db_prepare_input($_POST['mode']) : '*';
$executer = isset($_POST['excecuter']) ? tep_db_prepare_input($_POST['excecuter']) : 'auto';
$logger->write("EXECUTED BY {$executer}");
use_class('production_instruction_pdf');
use_class('products_brand');
$class_pb = new products_brand();
//inital settings
$output = 'F';
$add_to_daily_statistic = true;
$ignoreStockStatusDepot = false;
$max_item_per_pi = 30;
$pi_created = 0;
$queue_w = array();
//white paper queue
$queue_r = array();
//red paper queue
//Get all ready for pi printed orders 1st time (notes: orders with item cancel requested is still included here, also outsourcing is excluded)
$q = "SELECT * FROM";
$q .= " (";
$q_sp = '';
if ($type == '*' || $type == 'SP') {
コード例 #21
0
ファイル: orders.php プロジェクト: blasiuscosa/manobo-2008
 function retrieveListProductOverview_drawFilter($ean_list = null, $date_start = null, $date_end = null, $brand_id = null, $cat_id = null)
 {
     use_class('products_brand');
     $class_pb = new products_brand();
     $brands = $class_pb->retrieveList("active_status='1'");
     $brand_options = array();
     $brand_options[0] = 'Show All Brands';
     foreach ($brands as $b) {
         $brand_options[$b['products_brand_id']] = $b['brand_name'];
     }
     $filter_brand = '<select name="brand_id">' . loadComboListFromArray($brand_options, null, $brand_id, false) . '</select>';
     $filter_category = comboProductsCategory('cat_id', 'cat_id', $cat_id, '', '', 'Show All Category');
     $filter_prod_search = '<input type="text" name="ean_list" class="product-id input2" value="' . $ean_list . '" />';
     $filter_range_date = '<input name="date_range_start" class="date_picker" value="' . $date_start . '"/>';
     $filter_range_date .= ' to ';
     $filter_range_date .= '<input name="date_range_end" class="date_picker" value="' . $date_end . '"/>';
     $filter_range_date .= ' <input type="button" value="Go" class="date_range_go" title="Apply lead time start date filter" />';
     $filter_range_date .= ' <input type="button" value="Clear" class="date_range_clear" title="Clear lead time start date filter" />';
     $result .= '<div style="margin-bottom:10px;">';
     $result .= '<table border="0" cellpadding="0" cellspacing="0">';
     $result .= '<tr>';
     $result .= '<td rowspan="2" class="w080 bold" style="v-align:middle;">Filter by:</td>';
     $result .= '<td class="bold">Brand</td>';
     $result .= '<td class="bold">Category</td>';
     $result .= '<td class="bold">Product ID/EAN <span class="notice smallText" style="font-weight:normal;">(press <em>Enter</em> to filter)</span></td>';
     $result .= '<td class="bold">Lead Time Start Date</td>';
     $result .= '</tr>';
     $result .= '<tr><td>' . $filter_brand . '</td><td>' . $filter_category . '</td><td>' . $filter_prod_search . '</td><td>' . $filter_range_date . '</td></tr>';
     $result .= '</table></div>';
     return $result;
 }
コード例 #22
0
<?php

use_class('jng_sp');
$class_sp = new jng_sp();
use_class('jng_sp_catalog');
$class_jc = new jng_sp_catalog();
use_class('products_brand');
$class_pb = new products_brand();
//SP SETTING
salesPartnerCombo();
//GET PAGE
$session_page = 'analysis-vc';
$page = 1;
if (isset($_GET['page'])) {
    $page = $_GET['page'];
}
//FILTER OPTIONS
$keywords = '';
$filter_query = " WHERE jc.jng_sp_id={$jng_sp_id} AND jc.active_date!='0000-00-00 00:00:00'";
if (isset($_POST['nav-filter'])) {
    $navfiltered = tep_db_prepare_input($_POST['nav-filter']);
    if ($navfiltered != '') {
        $_SESSION[$session_page]['nav-filter'] = $navfiltered;
    } else {
        unset($_SESSION[$session_page]['nav-filter']);
    }
} elseif (isset($_SESSION[$session_page]['nav-filter'])) {
    $navfiltered = $_SESSION[$session_page]['nav-filter'];
}
if ($navfiltered != '') {
    $filter_query .= " AND (jc.navigation='{$navfiltered}' OR jc.navigation2 LIKE '%{$navfiltered}%')";
コード例 #23
0
<?php

#########################################
#  Author  : D3W4 & SAHAT               #
#  Created : Mar 18, 2011 2:11:13 PM    #
#########################################
use_class('logger');
use_class('products_search');
use_class('products_brand');
$class_ps = new products_search($session_userinfo);
$class_pb = new products_brand();
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'UPDATEBRAND') {
        $pids = tep_db_prepare_input($_POST['pids']);
        $new_brand_id = tep_db_prepare_input($_POST['new_brand_id']);
        $new_brand_name = tep_db_prepare_input($_POST['new_brand_name']);
        $n_request = count(explode(',', $pids));
        $n_updated = 0;
        if ($pids != "" && $n_request > 0) {
            $n_updated = $class_pb->updateProductBrand($pids, $new_brand_id);
        }
        $result = array();
        $result['total_request'] = $n_request;
        $result['total_updated'] = $n_updated;
        $result['new_brand_name'] = $new_brand_name;
        ajaxReturn($result);
    } elseif ($_POST['me_action'] == 'UPDATEPROMONAME') {
        $pids = tep_db_prepare_input($_POST['pids']);
        $new_promoname = tep_db_prepare_input(utf8_decode($_POST['new_promoname']));
        $n_updated = count(explode(',', $pids));
        if ($pids != "" && $n_updated > 0) {
コード例 #24
0
$content .= '  <div style="float:left;">';
$content .= '    <h2>Antitarnish Liquid Usage</h2>';
$content .= '    <table border="0" cellpadding="0" cellspacing="0">';
$content .= '    <tr><th style="width:150px;">Configuration</th><th colspan="2" style="width:150px;">Value</th></tr>';
$content .= '    <tr class="o"><td>Silver Usage</td><td>' . $input72 . '</td><td>gram</td></tr>';
$content .= '    <tr class="e"><td>Antitarnish Usage</td><td>' . $input73 . '</td><td>liter</td></tr>';
$content .= '    </table>';
$content .= '  </div>';
$content .= '</div>';
//#production .draw-table
//
//Production Instruction Settings Form
use_class('jng_sp');
use_class('products_brand');
$class_sp = new jng_sp();
$class_pb = new products_brand();
$sps = $class_sp->retrieveList();
$brands = $class_pb->retrieveList('active_status=1');
$content .= '<div id="production-instruction" class="draw-table" style="clear:both;padding-top:20px;">';
$content .= '  <div style="float:left;">';
$content .= '    <h2>Production Instruction (PI) Using Red Paper</h2>';
$content .= '    <table border="0" cellpadding="0" cellspacing="0">';
$content .= '    <tr><th style="width:150px;">Configuration</th><th style="width:550px;">Value</th></tr>';
$content .= '    <tr class="o"><td>Sales Partner</td><td>';
$checked = in_array('0', $sp_using_red_paper) ? 'checked="checked"' : '';
$cbid = 'set-pi-red-sp-0';
$content .= '<div class="float-left w080 tal" style="margin:2px 0;"><input type="checkbox" id="' . $cbid . '" name="' . $cbid . '" value="0" ' . $checked . '/><label for="' . $cbid . '"> JG.DE</label></div>';
foreach ($sps as $sp_id => $dt) {
    $cbid = 'set-pi-red-sp-' . $sp_id;
    $checked = in_array($sp_id, $sp_using_red_paper) ? 'checked="checked"' : '';
    $content .= '<div class="float-left w080 tal" style="margin:2px 0;"><input type="checkbox" id="' . $cbid . '" name="' . $cbid . '" value="' . $sp_id . '" ' . $checked . '/><label for="' . $cbid . '"> ' . $dt['package_prefix'] . '</label></div>';
コード例 #25
0
<?php

use_class('jng_sp');
$class_sp = new jng_sp();
use_class('jng_sp_catalog');
$class_jc = new jng_sp_catalog();
use_class('products_brand');
$class_pb = new products_brand();
use_class('products_linking');
$class_pl = new products_linking();
$maxlinks = array('C' => 5, 'U' => 1, 'A' => 3, 'D' => 3);
$maxlinks_js = 'var maxlink = new Object;';
foreach ($maxlinks as $type => $maxnum) {
    $maxlinks_js .= "\t\t" . "maxlink.{$type} = {$maxnum};\n";
}
//SP SETTING
salesPartnerCombo();
//GET PAGE
$session_page = 'sp-products-links';
$page = 1;
if (isset($_GET['page'])) {
    $page = $_GET['page'];
}
//AJAX ACTION
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'LOADPRODUCTLINKS') {
        function drawThumbs($links, $type, $addlink)
        {
            global $maxlinks;
            $results = '';
            if (is_array($links[$type]) && count($links[$type]) > 0) {
コード例 #26
0
function comboProductsBrand($id, $name = '', $value = '', $class = '', $html_params = '', $filter = '')
{
    use_class('products_brand');
    $class_pb = new products_brand();
    $brands = $class_pb->retrieveList($filter, 'brand_name');
    $navoptions = '<select id="' . $id . '"';
    if ($name != '') {
        $navoptions .= ' name="' . $name . '"';
    }
    if ($class != '') {
        $navoptions .= ' class="' . $class . '"';
    }
    if ($html_params != '') {
        $navoptions .= ' ' . $html_params;
    }
    $navoptions .= '>';
    $selected = $value == '' ? 'selected="selected"' : '';
    $navoptions .= '<option value="" ' . $selected . '>Please select a brand...</option>';
    $navoptions .= '<option value="0" ' . ($value == '0' ? 'selected="selected"' : '') . '>No Special Brand</option>';
    //$navoptions .= loadComboList('products_brand', 'products_brand_id', 'brand_name', $value, "active_status = '1'");
    foreach ($brands as $brand_id => $brand_data) {
        $navoptions .= '<option value="' . $brand_id . '" ' . ($value == $brand_id ? 'selected="selected"' : '') . '>' . $brand_data['brand_name'] . '</option>';
    }
    $navoptions .= '</select>';
    return $navoptions;
}
コード例 #27
0
 function manageOrderList_drawFilter($jng_sp_id, $ean_list = null, $date_start = null, $date_end = null, $brand_id = null, $cat_id = null, $orders_no = '')
 {
     use_class('jng_sp');
     use_class('products_brand');
     $class_sp = new jng_sp();
     $class_pb = new products_brand();
     $spdata = $class_sp->retrieveList();
     $brands = $class_pb->retrieveList("active_status='1'");
     array_unshift($spdata, array('jng_sp_id' => '0', 'name' => 'All Sales Partners'));
     $filter_sp = $class_sp->drawCombo($spdata, $jng_sp_id, '', 'jng_sp_id', 'orders-spid');
     $brand_options = array();
     $brand_options[0] = 'Show All Brands';
     foreach ($brands as $b) {
         $brand_options[$b['products_brand_id']] = $b['brand_name'];
     }
     $filter_brand = '<select name="brand_id">' . loadComboListFromArray($brand_options, null, $brand_id, false) . '</select>';
     $filter_category = comboProductsCategory('cat_id', 'cat_id', $cat_id, '', '', 'Show All Category');
     $filter_prod_search = '<input type="text" name="ean_list" class="product-id input" value="' . $ean_list . '" />';
     $filter_range_date = '<input name="date_range_start" class="date_picker" value="' . $date_start . '"/>';
     $filter_range_date .= ' to <input name="date_range_end" class="date_picker" value="' . $date_end . '"/>';
     $filter_range_date .= ' <input type="button" value="Go" class="date_range_go" title="Apply lead time start date filter" />';
     $filter_range_date .= ' <input type="button" value="Clear" class="date_range_clear" title="Clear lead time start date filter" />';
     $filter_orders_no = '<input type="text" name="orders_no" class="orders-no" value="' . (is_array($orders_no) ? implode(",", $orders_no) : $orders_no) . '" />';
     $enter_info = '<span class="notice smallText" style="font-weight:normal;">(press <em>Enter</em> to filter)</span>';
     $result .= '<div style="margin-bottom:10px;">';
     $result .= '<table border="0" cellpadding="0" cellspacing="0">';
     $result .= '<tr>';
     $result .= '<td rowspan="2" class="w080 bold" style="v-align:middle;">Filter by:</td>';
     $result .= '<td class="bold">Sales Partner</td>';
     $result .= '<td class="bold">Brand</td>';
     $result .= '<td class="bold">Category</td>';
     $result .= '<td class="bold">Product ID/EAN ' . $enter_info . '</td>';
     $result .= '<td class="bold">Order No. ' . $enter_info . '</td>';
     $result .= '<td class="bold">Lead Time Start Date</td>';
     $result .= '</tr>';
     $result .= '<tr><td>' . $filter_sp . '</td><td>' . $filter_brand . '</td><td>' . $filter_category . '</td><td>' . $filter_prod_search . '</td><td>' . $filter_orders_no . '</td><td>' . $filter_range_date . '</td></tr>';
     $result .= '</table></div>';
     return $result;
 }