Example #1
0
 function drawDetailTable($editable = true, $showImage = true, $columns = 1)
 {
     use_class('styles');
     $class_s = new styles();
     $design_id = $this->id;
     $original_products_id = $this->original_products_id;
     $element_id = $this->element_id;
     $prod_id_disabled = $this->original_products_id != '' ? ' readonly="readonly"' : '';
     $el_id_disabled = $this->element_id != '' ? ' readonly="readonly"' : '';
     $design_name = $this->name;
     $design_owner = ucfirst($this->owner_name);
     $attr_title = 'Product Attributes';
     if ($editable) {
         $sty_disabled = '';
         //$descat_disabled = ($showImage==='copy' || is_null($this->id) || $this->status=='1' || $this->status=='2' || $this->status=='11') ? '' : ' disabled="disabled"';
         $descat_disabled = ' disabled="disabled"';
         $prod_ref_hidden = true;
         $descat_hidden = '<input type="hidden" name="cat" value="' . $this->category . '" />';
         //used this to avoid cat value not submitted when its disabled
         #$destype_hidden = '<input type="hidden" name="type" value="'.$this->type.'" />';   //DISABLED (waiting status from design team need to activate or not)
         if ($showImage === 'copy' || is_null($this->id) || $this->status == '1' || $this->status == '2' || $this->status == '11') {
             $descat_disabled = '';
             $descat_hidden = '';
             $prod_id_disabled = '';
             $prod_ref_hidden = false;
             #$destype_hidden = '';  //DISABLED (waiting status from design team need to activate or not)
         }
         #$destype_disabled = $descat_disabled; //DISABLED (waiting status from design team need to activate or not)
         $destype_array[""] = 'Please select...';
         $descat_array[""] = 'Please select...';
         $destype_array = array_merge($destype_array, $this->getDesignType());
         $descat_array = array_merge($descat_array, $this->getDesignCategory());
         if (is_null($this->id)) {
             if ($this->category == 'R') {
                 $descat_array = array('R' => 'Recombination');
             } elseif ($this->category == 'W') {
                 $descat_array = array('W' => 'New Wax');
             } elseif ($this->category == 'E') {
                 $descat_array = array('E' => 'Revision');
             }
             //elseif($this->category=='V') $descat_array = array('V'=>'Variation');
             //elseif($this->category=='RV') $descat_array = array('R'=>'Recombination', 'V'=>'Variation');
         }
         $design_id = '<input type="text" name="designs_id" class="input" value="' . $design_id . '" readonly="readonly" />';
         $design_owner = '<input type="text" name="owner_name" class="input" value="' . $design_owner . '" disabled="disabled" />';
         $designtype_combo = '<select id="type" name="type" class="input"' . $destype_disabled . '>' . loadComboListFromArray($destype_array, '', $this->type, false) . '</select>';
         $designcat_combo = $descat_hidden . '<select id="cat" name="cat" class="input"' . $descat_disabled . '>' . loadComboListFromArray($descat_array, '', $this->category, false) . '</select>';
         $procat_combo = comboProductsCategory('procat', 'procat', $this->products_category_id, 'input');
         $probra_combo = comboProductsBrand('probra', 'probra', $this->products_brand_id, 'input');
         $original_products_id = '<input type="text" id="products_id" name="products_id" class="input" ' . $prod_id_disabled . ' value="' . $original_products_id . '" maxlength="32" />';
         $original_products_id .= '<br /><small class="notice">Seperate multiple ID by comma</small>';
         $element_id = '<input type="text" id="element_id" name="element_id" class="input" ' . $el_id_disabled . ' value="' . $element_id . '" maxlength="32" />';
         $design_name = '<input type="text" id="name" name="name" class="input" value="' . $design_name . '" /></td>';
         $target_price = '<input type="text" id="price" name="price" class="input" value="' . $this->target_price . '" /> <span class="notice">EUR</span>';
         $option_none = '<option value="0">Please select attribute...</option>';
         $attr_title .= ' <span class="notice smallText">(optional)</span>';
         $attr_collection = '<select name="styles_id_L" class="input"' . $sty_disabled . '>' . $option_none . $class_s->drawComboOptions($this->styles_id_L, 'L') . '</select>';
         //            $attr_fashiongrd = '<select name="styles_id_F" class="input"'.$sty_disabled.'>'.$option_none.$class_s->drawComboOptions($this->styles_id_F, 'F').'</select>';
         $design_structures = array(1 => 'Open', 2 => '100% Copy', 3 => 'Similar');
         $design_structure = '<select name="structure_id" class="input"' . $desstruct_disabled . '><option value="">Please select structure...</option>' . loadComboListFromArray($design_structures, null, $this->structure_id) . '</select>';
         $design_contents = array(1 => 'Open', 2 => '100% Copy', 3 => 'Similar', 4 => '30% Deviation MUST');
         $design_content = '<select name="content_id" class="input"' . $descont_disabled . '><option value="">Please select content...</option>' . loadComboListFromArray($design_contents, null, $this->content_id) . '</select>';
     } else {
         global $product_categories_name;
         global $products_brands_name;
         $sty_disabled = ' disabled="disabled"';
         $designtype_combo = $this->getDesignType($this->type);
         $designcat_combo = $this->getDesignCategory($this->category);
         $procat_combo = $product_categories_name[$this->products_category_id];
         $probra_combo = $product_brands_name[$this->products_brand_id];
         $original_products_id = '<a href="?open=product-detail&amp;products_id=' . $original_products_id . '">' . $original_products_id . '</a>';
         $element_id = '<a href="?open=element&amp;id=' . $element_id . '">' . $element_id . '</a>';
         $target_price = $this->target_price . ' EUR';
         $styles = $class_s->retrieveList('', "s.styles_id IN ({$this->styles_id_L}, {$this->styles_id_F})");
         $styles_name = array();
         foreach ($styles as $style) {
             $styles_name[$style['styles_id']] = $style['name'];
         }
         $attr_collection = $this->styles_id_L > '0' ? $styles_name[$this->styles_id_L] : '<span class="notice">Unset</span>';
         //            $attr_fashiongrd = ($this->styles_id_F>'0') ? $styles_name[$this->styles_id_F] : '<span class="notice">Unset</span>';
     }
     $content = '';
     if (!$editable && $showImage && $columns == 2) {
         $img = webImage($this->image_1, '80', '80', 'Image 1', 'img-border');
         $img .= $this->image_2 != '' ? '<br /><br />' . webImage($this->image_2, '80', '80', 'Image 2', 'img-border') : '';
         $img .= $this->image_3 != '' ? '<br /><br />' . webImage($this->image_3, '80', '80', 'Image 3', 'img-border') : '';
         $img .= $this->image_4 != '' ? '<br /><br />' . webImage($this->image_4, '80', '80', 'Image 4', 'img-border') : '';
         $content .= '<div style="float:left;margin:7px 5px 0 0;">' . $img . '</div>';
     }
     $content .= '<div><table class="form" border="0" cellpadding="0" cellspacing="0">';
     if (!is_null($this->id)) {
         if (!$editable && $showImage && $columns == 1) {
             //                $img1 = webImage($this->image_1, '150', '150', 'Main Image', 'img-border').' ';
             $img1 = webImage($this->image_1, '80', '80', 'Image 1', 'img-border') . ' ';
             //                $img2 = webImage($this->image_2, '150', '150', 'Additional Image', 'img-border');
             $img2 = webImage($this->image_2, '80', '80', 'Image 2', 'img-border');
             $img3 = webImage($this->image_3, '80', '80', 'Image 3', 'img-border');
             $img4 = webImage($this->image_4, '80', '80', 'Image 4', 'img-border');
             $content .= '<tr><td>' . $img1 . '</td><td>' . $img2 . '</td><td>' . $img3 . '</td>' . $img4 . '<td></td></tr>';
         }
         if ($editable !== 'copy') {
             $content .= '<tr><td>Design ID</td><td>' . $design_id . '</td></tr>';
         }
     }
     $content .= '<tr><td class="label">Design Created by</td><td>' . $design_owner . '</td></tr>';
     //$hide_ori_pid = ($this->category=='R' || $this->category=='V') ? false : true;
     //        echo "<pre>";var_dump($this);die();
     if ($prod_ref_hidden) {
         $hide_ori_pid = $prod_ref_hidden && $this->original_products_id != '' ? false : true;
     } else {
         $hide_ori_pid = $prod_ref_hidden;
     }
     $content .= '<tr><td class="label">Design Type</td><td width="230">' . $designtype_combo . '</td></tr>';
     $content .= '<tr><td class="label">Design Category</td><td width="230">' . $designcat_combo . '</td></tr>';
     $content .= '<tr id="oriprodid"' . ($hide_ori_pid ? ' style="display:none;' : '') . '"><td>Product ID (Original)</td><td>' . $original_products_id . '</td></tr>';
     $content .= '<tr><td>Element ID</td><td>' . $element_id . '</td></tr>';
     $content .= '<tr><td>Product Category</td><td>' . $procat_combo . '</td></tr>';
     $content .= '<tr><td>Product Brand</td><td>' . $probra_combo . '</td></tr>';
     $content .= '<tr><td>' . (is_null($this->id) ? 'New ' : '') . 'Design Name</td><td>' . $design_name . '</tr>';
     $content .= '<tr><td>Design Structure</td><td>' . $design_structure . '</td></tr>';
     $content .= '<tr><td>Design Content</td><td>' . $design_content . '</td></tr>';
     $content .= '<tr><td>Target Price</td><td>' . $target_price . '</td></tr>';
     $content .= '<tr><td colspan="2" class="bold" style="padding-top:20px;">' . $attr_title . '</td></tr>';
     $content .= '<tr><td>Collection</td><td>' . $attr_collection . '</td></tr>';
     //        $content .= '<tr><td>Fashion Grade</td><td>'.$attr_fashiongrd.'</td></tr>';
     if ($showImage === 'copy') {
         $status_combo = '<select name="status" class="input red bold">' . loadComboListFromArray($this->getDesignStatus(array('1', '2')), null, $this->status, false) . '</select>';
         $content .= '<tr><td class="red bold">NEW Status</td><td>' . $status_combo . '</td></tr>';
     }
     $content .= '</table></div>';
     return $content;
 }
Example #2
0
 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;
 }
 /**
  * Build input for $filters
  * @return string
  */
 private function createFiltersInput()
 {
     // >,>=,=,<=,<
     $input .= $this->createInputTextRange('filters-prod-id', 'products id', '', '', '', '', true);
     $input .= $this->createInputTextRange('filters-prod-price', 'price', '', '', ' ' . DEFAULT_CURRENCY, 'currency');
     $input .= $this->createInputTextRange('filters-prod-age', 'days');
     $input .= $this->createInputTextRange('filters-prod-disc', 'discount % ', 3, '', '%');
     $input .= $this->createInputTextRange('filters-prod-vc', 'vc ');
     $input .= $this->createInputTextRange('filters-prod-vcpct', 'vc % ', '', '', '%');
     $input .= $this->createInputTextRange('filters-prod-margin', 'margin % ', '', '', '%');
     $input .= $this->createInputTextRange('filters-prod-soldlast30', 'pieces', '', '', ' pieces');
     $input .= $this->createInputTextRange('filters-prod-soldlast60', 'pieces', '', '', ' pieces');
     $input .= $this->createInputTextRange('filters-prod-soldlast90', 'pieces', '', '', ' pieces');
     for ($y = product::STATIC_LOG_YEAR_START; $y <= date('Y'); $y++) {
         $input .= $this->createInputTextRange('filters-prod-sold' . $y, 'pieces', '', '', ' pieces');
     }
     $input .= $this->createInputTextRange('filters-prod-totalsold', 'pieces', '', '', ' pieces');
     $input .= $this->createInputTextRange('filters-prod-stars', 'stars', '', '', ' stars');
     $input .= $this->createInputTextRange('filters-prod-matexp', 'amount on EUR', '', '', ' EUR');
     $input .= $this->createInputTextRange('filters-hh-stock', 'pieces', '', '', ' pieces');
     $input .= $this->createInputTextRange('filters-prod-deflength', 'default length');
     $input .= $this->createInputTextRange('filters-prod-returnrate', 'return %');
     $input .= $this->createInputTextRange('filters-pd2-ttlstones', 'pieces', '', '', ' pieces');
     $input .= $this->createInputTextRangeDate('filters-date-killed');
     $input .= $this->createInputTextRangeDate('filters-date-keep');
     $input .= $this->createInputTextRangeDate('filters-date-keep-exclude');
     $input .= $this->createInputTextRangeDate('filters-date-finalized');
     // =, != with input free text
     $input .= $this->createInputTextEqualOrNot('filters-el-used', 'elements id', '', '', '', true);
     $input .= $this->createInputTextEqualOrNot('filters-prod-ean', 'product ean', '', '', '', true);
     $input .= $this->createInputTextEqualOrNot('filters-prod-model', 'products model', '', '', '', true);
     // like %input%, not like %input%
     $input .= $this->createInputTextContainOrNot('filters-prod-name', 'name');
     $input .= $this->createInputTextContainOrNot('filters-prod-description', 'description');
     $input .= $this->createInputTextContainOrNot('filters-prod-promoname', 'promoname');
     // =, != with input drop down combo
     //prepare data combo
     $combo_element_finishing = $this->createCombo('filters-el-finishing', 'status', array('1' => 'Yellow Goldplate', '11' => 'Hammer', '111' => 'Brush', '1111' => 'Oxid', '11111' => 'Rose Goldplate'), null, null);
     $combo_prod_clearimage = $this->createCombo('filters-prod-clearimage', 'status', array('0' => 'Has NO Clear Image', '1' => 'Has a Clear Image'), null, null);
     $combo_prod_complexity = $this->createCombo('filters-prod-complexity', 'status', productComplexityName(), null, null);
     $combo_prod_content = $this->createCombo('filters-prod-content', 'status', array('0' => 'NOT Improved', '1' => 'Improved'), null, null);
     $combo_prod_discounted = $this->createCombo('filters-prod-discounted', 'status', array('0' => 'No', '1' => 'Yes'), null, null);
     $combo_prod_family = $this->createCombo('filters-prod-family', 'status', array('0' => 'Has NO Family', '1' => 'Has a Family'), null, null);
     $combo_prod_image = $this->createCombo('filters-prod-image', 'status', array('0' => 'NOT Improved', '1' => 'Improved'), null, null);
     $combo_prod_margin_status = $this->createCombo('filters-prod-margin-status', 'status', array('0' => 'Bad', '1' => 'Good'), null, null);
     $combo_prod_outsourced = $this->createCombo('filters-prod-outsourced', 'status', array('0' => 'No (Produce in House)', '1' => 'Yes (Outsourced)'), null, null);
     $combo_prod_wholesale = $this->createCombo('filters-prod-wholesale', 'status', array('0' => 'No', '1' => 'Yes'), null, null);
     //prepare input filters
     // =
     $input .= $this->createInputComboEqual('filters-prod-clearimage', '', '', '', '', null, '', '', false, $combo_prod_clearimage);
     $input .= $this->createInputComboEqual('filters-prod-content', '', '', '', '', null, '', '', false, $combo_prod_content);
     $input .= $this->createInputComboEqual('filters-prod-discounted', '', '', '', '', null, '', '', false, $combo_prod_discounted);
     $input .= $this->createInputComboEqual('filters-prod-family', '', '', '', '', null, '', '', true, $combo_prod_family);
     $input .= $this->createInputComboEqual('filters-prod-image', '', '', '', '', null, '', '', false, $combo_prod_image);
     $input .= $this->createInputComboEqual('filters-prod-outsourced', '', '', '', '', null, '', '', false, $combo_prod_outsourced);
     $input .= $this->createInputComboEqual('filters-prod-wholesale', '', '', '', '', null, '', '', false, $combo_prod_wholesale);
     // =, !=
     $input .= $this->createInputComboEqualOrNot('filters-el-finishing', 'finishing', '', '', '', null, '', '', false, $combo_element_finishing);
     $input .= $this->createInputComboEqualOrNot('filters-prod-brand', '', '', '', '', null, '', '', true, comboProductsBrand('filters-prod-brand', '', '', 'filters-val', 'style="display:none;margin-left:20px;"'));
     $input .= $this->createInputComboEqualOrNot('filters-prod-cat-top', '', '', '', '', null, '', '', true, CategoryTop::displayAsComboBox('filters-prod-cat-top', '', '', 'filters-val', 'display:none;margin-left:20px;'));
     $input .= $this->createInputComboEqualOrNot('filters-prod-cat', '', '', '', '', null, '', '', true, comboProductsCategory('filters-prod-cat', '', '', 'filters-val', 'style="display:none;margin-left:20px;"'));
     $input .= $this->createInputComboEqualOrNot('filters-prod-description-imp-stat', '', '', '', '', null, '', '', true, comboProductsDescriptionImprovedStatus('filters-prod-description-imp-stat', '', '', 'filters-val', 'style="display:none;margin-left:20px;"'));
     $input .= $this->createInputComboEqualOrNot('filters-prod-color', 'color', 'color_pattern_description', 'color_pattern_id', 'name', null, "languages_id = '1'", '', true);
     $input .= $this->createInputComboEqualOrNot('filters-prod-complexity', '', '', '', '', null, '', '', true, $combo_prod_complexity);
     $input .= $this->createInputComboEqualOrNot('filters-prod-margin-status', 'status', '', '', '', null, '', '', false, $combo_prod_margin_status);
     $input .= $this->createInputComboEqualOrNot('filters-prod-mat', 'material', 'products_materials', 'products_materials_id', 'material_name', null, '', '', true);
     $input .= $this->createInputComboEqualOrNot('filters-watchlist-of', '', '', '', '', null, '', '', true, comboWatchlistUsers('filters-watchlist-of', '', '', 'filters-val', 'style="display:none;margin-left:20px;"'));
     foreach ($this->class_styles->groups as $gk => $gv) {
         $input .= $this->createInputComboEqualOrNot("filters-prod-styles-{$gk}", 'attribute', 'styles s LEFT JOIN styles_description sd ON sd.styles_id=s.styles_id AND sd.languages_id=2', 's.styles_id', 'sd.name', null, "groups='{$gk}'", '', true);
     }
     return $input;
 }
Example #4
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;
 }
 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;
 }