function getDisplay($pid, $spid, $amvd_provision_rate, $row_class = 'o')
{
    global $class_jc;
    $result = '';
    $obj_product = new Product($pid);
    $have_amvd_catalog = $obj_product->isAddedToSalesPartner($spid);
    $is_active = $obj_product->isActiveInSalesPartner($spid);
    $products_image = $obj_product->displayImage(IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1);
    $info = '<div style="margin-bottom:20px;">' . $obj_product->displayIDAndCode() . '</div>';
    $info .= '<div class="w150" style="margin:0 auto;">' . $obj_product->displayRecentSoldTable() . '</div>';
    $navids = array('0' => 'Please select a navigation...');
    $navids_opts = retrieveNavIDs($spid, 'bn');
    foreach ($navids_opts as $n_id => $n_name) {
        //if doesn't work in dev environment, it could be caused by umlauts
        //in the navigation name. Can be fixed by adding htmlspecialchars or
        //but we don't need it for live (sahat- 16.09.2014)
        $navids[$n_id] = $n_name;
    }
    $navid = $have_amvd_catalog ? $obj_product->getSalesPartnerMainNavigationID($spid) : null;
    $navigation = '<select class="navigation input">' . loadComboListFromArray($navids, null, $navid, false) . '</select>';
    $result .= '<tr id="' . $pid . '" class="' . $row_class . '">';
    $result .= '<td class="img">' . $products_image . '</td>';
    $result .= '<td class="name">' . $info . '</td>';
    $result .= '<td class="pb">' . $navigation . '</td>';
    $btn_update_text = $is_active ? 'Update' : 'Activate';
    $btn_add = '<input type="button" style="width:90px;" class="add button blue" value="Add" title="Add this product to AM.VD Catalogue"/>';
    $btn_update = '<input type="button" style="width:90px;" class="update button blue" value="' . $btn_update_text . '" title="Update and activate this product on AM.VD Catalogue"/>';
    $btn_ignore = '<input type="button" style="width:90px;" class="ignore button" value="Ignore" title="Ignore from list"/>';
    $btn_deactivate = '<input type="button" style="width:90px;" class="deactivate button blue" value="Deactivate" title="Deactivate or remove from AM.VD catalog"/>';
    $i_hidden = '<input type="hidden" name="jcid" value="' . $obj_product->getSalesPartnerCatalogID($spid) . '"/>';
    if ($have_amvd_catalog) {
        $btn = $i_hidden . $btn_update . '<br/>' . $btn_deactivate;
    } else {
        $btn = $btn_add . '<br/>' . $btn_ignore;
    }
    $result .= '<td class="act">' . $btn;
    $result .= '<input type="hidden" class="pid" value="' . $pid . '"/>';
    $result .= '</td>';
    $result .= '</tr>';
    return $result;
}
Esempio n. 2
0
 public function displayTypeAsComboBox($name = '', $id = '', $class = '', $style = '')
 {
     $options = array();
     $options[self::TYPE_B2C] = self::TYPE_B2C_TEXT;
     $options[self::TYPE_B2B] = self::TYPE_B2B_TEXT;
     $combo = '<select';
     if ($name != '') {
         $combo .= ' name="' . $name . '"';
     }
     if ($id != '') {
         $combo .= ' id="' . $id . '"';
     }
     if ($class != '') {
         $combo .= ' class="' . $class . '"';
     }
     if ($style != '') {
         $combo .= ' style="' . $style . '"';
     }
     $combo .= '>' . loadComboListFromArray($options, $this->displayType()) . '</select>';
     return $combo;
 }
$date_oldest = date('Y-m-d', strtotime("-14 day"));
$date_today = date('j M Y');
$date_yesterday = date('j M Y', strtotime("-1 day"));
$n_lists = $notifications->retrieveListGeneralQuery("muhn.user_id={$session_userinfo['id']} AND (muhn.status=0 OR muhn.need_feedback=1 OR muhn.posted_date>='{$date_oldest}') {$filter}", 'muhn.posted_date DESC, muhn.posted_by');
$notifications_new = array();
$printed_date = '';
$previous_date = '';
//$dbposted = tep_db_query("SELECT DISTINCT posted_by FROM minierp_users_has_notifications WHERE user_id = '$session_userinfo[id]'");
//while($r=tep_db_fetch_array($dbposted))$postedusers[$r['posted_by']] = $r['posted_by'];
$postedusers = array();
foreach ($n_lists as $n) {
    if (!isset($postedusers[$n['posted_by']])) {
        $postedusers[$n['posted_by']] = $n['posted_by'] == '0' || $n['posted_by'] == 'auto-set' ? 'Manobo' : $n['posted_by'];
    }
}
$content .= '<div style="float:right;"><form id="filters" action="" method="post"><input type="hidden" name="me_action" value="REFRESHFILTERS"/><strong style="margin-right:10px;">Show posted by</strong><select name="sender" onchange="$(\'#filters\').submit();"><option value="">All</option>' . loadComboListFromArray($postedusers, null, $sender) . '</select></form></div>';
$content .= '<br/><br/>';
if (count($n_lists) > 0) {
    $content .= '<div id="my-notifications"><div id="notifications-list">';
    foreach ($n_lists as $list) {
        if ($list['status'] == 0) {
            $notifications_new[] = $list['notifications_id'];
        }
        $list_date = date("j M Y", strtotime($list['posted_date']));
        if ($printed_date != $list_date) {
            $previous_date = $printed_date;
            $class = 'dt' . strtolower(str_replace(' ', '', $list_date));
            $style = $previous_date != '' ? ' style="margin-top:40px;"' : '';
            $printed_date = $list_date;
            $content .= '<h3 class="' . $class . '"' . $style . '>';
            if ($list_date == $date_today) {
function drawProductInfo($pid, $aid)
{
    global $product_categories_name, $class_pm, $class_pa;
    $product = $class_pm->retrieveDetail($pid, 'p,pnc,cat');
    $result = '<div style="float:left;">';
    $result .= '<div>' . webImageWithDetailLinkStars($product['p']['products_image'], IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1, 'Product ' . $product['p']['products_id'], '', '', IMAGE_SIZE_BIG_1, IMAGE_SIZE_BIG_1, $product['p']['stars']) . '</div>';
    $result .= '</div>';
    $result .= '<div style="margin-left:' . (intval(IMAGE_SIZE_THUMBNAIL_1) + 20) . 'px;">';
    $result .= '<h2>' . $product_categories_name[$product['categories_id']] . '</h2>';
    $result .= '<h3>' . $product['p']['products_id'] . ' / ' . $product['p']['products_model'] . '</h3>';
    if (is_array($aid)) {
        $a_option = array();
        $a_option[$product['p']['products_ean']] = textLength($product['pnc']['products_length']);
        foreach ($aid as $a) {
            $a_option[$a['products_ean']] = textLength($a['length']);
        }
        $result .= '<select id="choose-article" class="input"><option value="X">please select a length...</option>' . loadComboListFromArray($a_option) . '</select>';
    } else {
        $article = $aid > 0 ? $class_pa->retrieveDetail($aid) : null;
        $ean = is_null($article) ? $product['p']['products_ean'] : $article['products_ean'];
        $length = is_null($article) ? $product['pnc']['products_length'] : $article['length'];
        $length_text = $length > 0 ? textLength($length) : '';
        if ($length_text != '') {
            $result .= '<h3>Length ' . $length_text . '</h3>';
        }
        $result .= '<h3>EAN ' . $ean . '</h3>';
    }
    $result .= '</div>';
    return $result;
}
<?php

$year_now = date('Y');
$month_prev = date('m', strtotime("-1 month"));
$year_options = array();
$month_options = array();
for ($y = 2010; $y <= $year_now; $y++) {
    $year_options[$y] = $y;
}
for ($m = 1; $m <= 12; $m++) {
    $m2 = $m < 10 ? "0{$m}" : $m;
    $month_options[$m2] = date('F', strtotime("2009-{$m2}-01"));
}
$content .= '<div style="margin-bottom:20px;">' . 'Period: ' . '<select id="oc-period-month">' . loadComboListFromArray($month_options, null, $month_prev) . '</select><select id="oc-period-year"">' . loadComboListFromArray($year_options, null, $year_now) . '</select></div>' . '<div style="margin-bottom:40px;">' . '<input type="button" id="oc-period-submit" value="Download Excel File" />' . '</div><div><a href="/?report=otto-commissions-2012">' . '&raquo; Go to old OTTO Commission Report</a>';
$javascript = '
            $("#oc-period-submit").click(function() {
                var year = $("#oc-period-year").val();
                var month = $("#oc-period-month").val();
                window.open("/print/otto-commission.php?year=" + year + 
                    "&month=" + month);
            });
';
$title = 'Otto Commission Report';
Esempio n. 6
0
         $m['owner_id'] = $row['owner'];
         $m['owner_name'] = $row['owner_name'];
         $m['pic_id'] = $row['pic'];
         $m['pic_name'] = $row['pic_name'];
         $m['eta'] = $row['eta'];
         $m['status'] = $row['status'];
         $mims[$pic][$id] = $m;
     }
     $status_history = 'status_' . $row['hstatus'];
     if (!isset($mims[$pic][$id][$status_history]) || $mims[$pic][$id][$status_history] <= $row['hstatus_time']) {
         $mims[$pic][$id][$status_history] = $row['hstatus_time'];
         $mims[$pic][$id][$status_history . '_by'] = $row['hstatus_by'];
     }
 }
 $result .= '<div id="kpi-mims">';
 $result .= '<h2>Show KPI of Team &nbsp; <select id="kpi-mims-team-combo" class="input">' . loadComboListFromArray($teams, null, $team_id) . '</select></h2>';
 $result .= '<input type="hidden" id="kpimims" value="' . $filterdate_start . '" />';
 $result .= '<div id="kpi-mims-content"></div>';
 $result .= '<div id="kpi-mims-content-2"></div>';
 foreach ($mims as $pic => $mims_per_pic) {
     $pic_mims_counter = 0;
     $kpi_table = array();
     $row = array();
     $row['id'] = 'No';
     $row['desc'] = 'MIMS Name';
     $row['countpro'] = 'ETA';
     $row['s3 date'] = 'In Progress';
     $row['s4 date'] = 'Testings';
     $row['s5 date'] = 'Checkings';
     $row['s6 date'] = 'Done';
     $kpi_table[] = $row;
 function comboRange($id, $show = false)
 {
     $display = $show ? 'display:block;' : 'display:none;';
     $cbo_data = array('>=' => '( &ge; ) greater than or equal to', '>' => '( > ) greater than', '<=' => '( &le; ) less than or equal to', '<' => '( < ) less than', '=' => '( = ) equal', '!=' => '( &ne; ) not equal');
     //$cbo_data = array('='=>'( = ) equal', '>'=>'( > ) greater than', '>=' => '( &ge; ) greater than or equal to', '<'=>'( < ) less than', '<='=>'( &le; ) less than or equal to');
     $cbo = '<select id="' . $id . '" name="' . $id . '" class="filters-range-selector" style="margin-left:20px;' . $display . '">' . loadComboListFromArray($cbo_data, null, null, false) . '</select>';
     return $cbo;
 }
Esempio n. 8
0
     $content .= ComboBoxAmazonDeNavIDs('navigation', $product_navigation, 'input2', 'id="navigation"');
     $content .= '<input type="checkbox" name="navigation" value="1" style="display:none;" />';
     $content .= '</td></tr>';
     $content .= '<tr><td colspan="2">&nbsp;</td></tr>';
     $content .= '<tr><td colspan="2"><strong>Secondary</strong></td></tr>';
     $content .= '<tr><td width="150">Nav ID</td><td>';
     $content .= ComboBoxAmazonDeNavIDs('navid0', $product_nav_secondary[0], 'input2', 'id="nav0"');
     $content .= '</td></tr>';
     $content .= '</table></div>';
 } elseif ($jng_sp_id == '5') {
     $content .= '<div><table class="form" border="0" cellpadding="0" cellspacing="0">';
     $content .= '<tr><td colspan="2"><strong>Primary (BrowseNode)</strong></td></tr>';
     $content .= '<tr><td width="150">Nav ID</td><td>';
     $navids = array('' => 'Please select a navigation...') + retrieveNavIDs($jng_sp_id, 'bn');
     $navid_filters = '<select id="navigation" name="navigation" class="input2">';
     $navid_filters .= loadComboListFromArray($navids, null, $product_navigation, false);
     $navid_filters .= '</select>';
     //$content .= ComboBoxneckermannAtNavIDs('p','navigation', $product_navigation, 'input2', 'id="navigation"');
     $content .= $navid_filters;
     $content .= '<input type="checkbox" name="navigation" value="1" style="display:none;" />';
     $content .= '</td></tr>';
     $content .= '</table></div>';
 } else {
     $content .= '<div>No Structure Info yet</div>';
 }
 $content .= '</div>';
 $content .= '<div>';
 $content .= '<h3><a href="#">Images</a></h3>';
 $content .= '<div><table class="form" border="0" cellpadding="0" cellspacing="0">';
 $current_brand = $product['p']['products_brand_id'];
 if ($current_brand == '0') {
         $tab_content .= '<textarea name="template_content" class="w500" rows="20">' . $template_content . '</textarea>';
         $tab_content .= '<div class="buttons">';
         $tab_content .= '<input type="hidden" name="languages_id" value="' . $languages_id . '" />';
         $tab_content .= '<input type="button" class="btn-content-save" value="Save" />';
         $tab_content .= '<input type="button" class="btn-content-preview" value="Save & Preview" />';
         $tab_content .= '<input type="button" class="btn-content-delete" value="Delete" />';
         $tab_content .= '</div>';
         $tab_content .= '</div>';
         unset($unused_languages[$languages_id]);
     }
     if (count($unused_languages) > 0) {
         $tab_id = 'add-language';
         $content .= '<li><a href="#' . $tab_id . '">+</a></li>';
         $tab_content .= '<div id="' . $tab_id . '">';
         $tab_content .= '<div class="bold">Select new language to add:</div>';
         $tab_content .= '<div><select id="add-language-id" class="w200">' . loadComboListFromArray($unused_languages) . '</select></div>';
         $tab_content .= '<div class="buttons-left"><input type="button" id="btn-language-add" value="Add Selected Language" /></div>';
         $tab_content .= '</div>';
     }
     $content .= '</ul>';
     $content .= $tab_content;
     $content .= '</div>';
     //#template-contents
     $content .= '</div>';
 }
 $javascript .= '
         var preview_after_saved = false;
         function validateTemplate()
         {
             var error_message = new Array();
             if ($("#template-name").val() == "") error_message.push("&sdot; Please specify a valid Template Name");
Esempio n. 10
0
 $content .= '<form name="fin_zade" action="?open=product-detail&amp;products_id=' . $products_id . '#prodet-tab5" method="post">';
 $content .= '<input type="hidden" name="me_action" value="FINALIZETRADEBYTE" />';
 $content .= '<input type="hidden" id="products_id" name="products_id" value="' . $products_id . '" />';
 $content .= '<div style="margin-top:20px;">';
 //$content .= '<h3>Final Settings</h3>';
 $products_data = $class_pm->retrieveDetail($products_id, 'p,pd,cat');
 $description = $products_data['pd'];
 $keywords_nice = str_replace(',', ', ', $description[2]['products_head_keywords_tag']);
 $table_2nd_column_widthclass = 'w450';
 $content .= '<table class="form" border="0" cellpadding="0" cellspacing="0">';
 $content .= '<tr><td style="width:150px;">Product Name</td><td>' . $products_brand['brand_name'] . ' - ' . $obj_product->category_name . ' - <span id="zade_name">' . $description[2]['products_name'] . '</a></td><td>&nbsp;</td></tr>';
 $content .= '<tr><td>Product Keywords</td><td id="zade_keywords" colspan="2">' . $keywords_nice . '</td></tr>';
 $content .= '<tr><td>Product Gender</td><td><select name="products_gender" class="input">' . loadComboListFromArray($class_pm->productGenderName(), null, $zade_gender) . '"</select></td><td>&nbsp;</td></tr>';
 $content .= '<tr><td>Product Age Group</td><td><select name="products_agegroup" class="input">' . loadComboListFromArray($products_agegroup_options, null, $zade_agegroup) . '"</select></td><td>&nbsp;</td></tr>';
 if ($catalog_zade !== false) {
     $content .= '<tr><td>Zalando Season</td><td><select name="zade_season" class="input">' . loadComboListFromArray($zade_season_options, null, $zade_season) . '</select></td><td>&nbsp;</td></tr>';
 }
 if ($catalog_ebde !== false) {
     $ebay_name_suggestion = $obj_product->getEbayNameSuggestion($ebay_language_id);
     $ebay_name_suggestion_length = strlen($ebay_name_suggestion);
     $ebay_suggestion_rule = 'Name is auto generated from:<br />' . Product::getEbayNameSuggestionTemplate() . '<br />' . '<strong>&laquo; Click suggested name to use it</strong>!';
     $info_icon = '<span class="help ui-icon ui-icon-info" style="float:right;" title="' . $ebay_suggestion_rule . '"></span>';
     $suggestion_class = $ebay_name_suggestion_length > $ebay_name_max_chars ? 'red' : 'notice';
     $content .= '<tr><td>Ebay Name Suggestion</td><td class="' . $table_2nd_column_widthclass . '">' . $info_icon . '<span id="ebde_name_suggest" class="blue pointer" title="Click to use this suggested name">' . $ebay_name_suggestion . '</span>' . '</td><td><div class="w080 tar ' . $suggestion_class . '">(' . $ebay_name_suggestion_length . ' chars)</div></td></tr>';
     $content .= '<tr><td>Ebay Name to Upload</td><td class="' . $table_2nd_column_widthclass . '">' . '<input type="text" id="ebde_name" name="ebay_name" class="' . $table_2nd_column_widthclass . '" value="' . $obj_product->getEbayName($ebay_language_id) . '" />' . '<br /><span class="smallText notice">* Max characters allowed by eBay = ' . $ebay_name_max_chars . ' Chars</span>' . '</td><td><div id="ebde_name_length" class="w080 tar notice">&nbsp;</div></td></tr>';
 }
 $content .= '</table>';
 $content .= '<h3 style="margin:20px 0 0 0;">Finalize Price using below module</h3>';
 $content .= '<iframe src="/?open=products-price&amp;pids=' . $products_id . '&amp;hidemenu=true&amp;hidecopyurl=true" width="1200" height="540" style="border:none;overflow:hidden;" scrolling="no"></iframe>';
 $content .= '<div style="margin-top:20px;">';
 if ($catalog_zade !== false) {
                $result .= tep_draw_table('scorecard', $tc_value, false, true);
            }
        }
        echo utf8_encode($result);
        exit;
    }
}
$period_options = array();
$period_options['all'] = 'Show All Months';
$period_options['actual'] = 'Show Actual Months';
$view_option = array();
$view_option['overview'] = 'Show Overview';
$view_option['details'] = 'Show Details';
$content .= '<div>';
$content .= '<select id="cmb_period" class="input">' . loadComboListFromArray($period_options, null, 'actual') . '</select>';
$content .= '<select id="cmb_view" class="input">' . loadComboListFromArray($view_option, null, 'details') . '</select>';
$content .= '</div>';
$content .= '<div id="div_period_actual" class="w150 tac" style="margin:5px 0 5px 15px;">';
$content .= '<span class="ui-state-default ui-corner-all" style="float:left;"><span id="icn-period-prev" class="ui-icon ui-icon-triangle-1-w pointer"></span></span>';
$content .= 'Change Period';
$content .= '<span class="ui-state-default ui-corner-all" style="float:right;"><span id="icn-period-next" class="ui-icon ui-icon-triangle-1-e pointer"></span></span>';
$content .= '</div>';
$content .= '<div style="width:100%;padding-bottom:40px;overflow:auto;"><div id="scorecard_container" style="width:2000px;"></div></div>';
$javascript .= '
    function loadTable() {
        $("#scorecard_container").html(img_ajax_load_1);
        $.post(url, { me_action: "LOADTABLES" }, tableLoaded, "html");
    }
    function tableLoaded(htmlResult, txtStatus) {
        if(txtStatus=="success") {
            $("#scorecard_container").html(htmlResult);
Esempio n. 12
0
        }
        echo utf8_encode($late_orders);
        exit;
    }
}
//TEMPLATE START
$orders_late_status_filter = array();
$orders_late_status_filter['S'] = 'Show All';
$orders_late_status_filter['U'] = 'Unhandled';
$orders_late_status_filter['H'] = 'Handled';
$orders_late_status_filter['O'] = 'OK';
//$orders_late_status_filter['1'] = 'Closed';
$content = '';
$content .= '<div id="filter_box" style="float:left;">';
$content .= '<div style="padding-bottom:10px;float:left;"><strong>Query Date </strong><input type="text" id="late_date" title="select date to load order late" class="date_picker input" readonly="readonly" value="' . $date_id_userformat . '"/></div>';
$content .= '<div style="float:left;"><strong>&nbsp; Status </strong><select id="status_filter" class="input">' . loadComboListFromArray($orders_late_status_filter, null, $filter_status, false) . '</select></div>';
$content .= '</div>';
$content .= '<form name="printtoexcel" method="POST" action="print/print-orders-late.php" target="_blank">';
$content .= '<input type="hidden" id="pte-oids" name="oids" value=""/>';
$content .= '<input type="hidden" id="pte-date" name="late_date" value="' . $date_id_userformat . '"/>';
$content .= '<input type="hidden" id="pte-status" name="status_late" value="' . $filter_status . '"/>';
$content .= '</form>';
$content .= '<div id="printtoexcel" style="margin-bottom:10px;">';
$content .= '<input style="margin-left:10px;" type="button" class="w200" id="pte-button"  value="Export Orders to Excel File" title="Export orders list to MS Excel format file" />';
$content .= '</div>';
$content .= '<div id="orders_late_table"></div>';
$javascript .= '
reloadList = function() {
    var filter_date = $("#late_date").val();
    var filter_status = $("#status_filter").val();
    $("#orders_late_table").html(img_ajax_load_1);
     $content .= '<form name="closesenttab" action="?open=sp-orders-amvd-upload' . $addhidemenu . '#ui-tabs-6" method="post">';
     $content .= '<input type="hidden" name="me_action" value="CLOSEORDERSINSENTTAB" >';
     $content .= tep_draw_table('', $table);
     $content .= '<div class="buttons-left"><input type="submit" name="submit" class="button" value="Close all Checked Orders" />';
     $content .= '</form>';
 } elseif ($_GET['tab'] == 'po-sndsscc') {
     $header = 'Serial Shipping Container Code (SSCC)';
     $paragraphs = array();
     $paragraphs[] = '&sdot; currently available only for Amazon German';
     $paragraphs[] = '&sdot; Use this function to send 1 ASN with multiple boxes/carton';
     $paragraphs[] = '&sdot; ALWAYS WRITE DOWN THE TIME WHEN WE START USING 2ND BOXES (AND NEXT ONES)';
     $paragraphs[] = '&sdot; ALWAYS <strong><em>CLOSE</em></strong> PREVIOUS BOX BEFORE STARTING A NEW ONE';
     $paragraphs[] = '&sdot; Use this function when ready for shipment';
     $destination_options = loadComboListFromArray($amazon_address_key);
     $order_type_options = loadComboListFromArray($amazon_order_type);
     $total_boxes_options = loadComboListFromArray(array(1, 2, 3, 4, 5));
     $total_boxes = '<select id="sscc-total-box" class="w040 tac">' . $total_boxes_options . '</select>';
     $sending_date = '<input type="text" id="sscc-send-date" class="date_picker" value="" />';
     $list_gap = 'style="margin-top:8px;"';
     $style = 'margin:10px 0 20px 0;';
     $content .= drawSOPinfo($header, $paragraphs, $style);
     $unconfirmed_orders = $class_jo->getUnconfirmedOrders($default_sp_id);
     if (count($unconfirmed_orders) > 0) {
         $po_list = array();
         foreach ($unconfirmed_orders as $order) {
             if (!in_array($order['order_id'], $po_list)) {
                 $po_list[] = $order['order_id'];
             }
         }
         $content .= '<div class="red" style="margin-bottom:0;">' . 'Some POs are not yet confirmed to SP: ' . implode(', ', $po_list) . '</div>' . '<h3 class="red">Please confirm it first!</h3>';
     }
Esempio n. 14
0
            $upload_sp_id = $_POST['upload_sp_id'];
            header("Location: ?open=sp-catalog-generator&jng_sp_id={$upload_sp_id}&reupload=true");
            exit;
        } else {
            $upload_id = tep_db_prepare_input($_POST['upload_id']);
            $status = $_POST['submit'] == 'Success' ? 'S' : 'F';
            $class_ju->updateStatus($upload_id, $status, $session_userinfo['username']);
            header("Location: ?open=sp-catalog");
            exit;
        }
    } elseif ($_POST['me_action'] == 'COUNTCATSTATUS') {
        $category_top_id = $_POST['top_cat_id'];
        $sp = new SalesPartner($jng_sp_id);
        $status_arr = array('all', 'new', 'update', 'deactivate');
        $total_catalog_status = $sp->getCatalogTotalCount($status_arr, $category_top_id);
        $catalog_status_combo_box = '<select id="status-catalog" style="width:180px;"><option value="0">Choose Catalog Status..</option>' . loadComboListFromArray($total_catalog_status, null, null, false) . '</select>';
        echo $catalog_status_combo_box;
        exit;
    }
}
//START TEMPLATE
//CHECK IF UPLOAD IS ALREADY MADE
$status = $class_ju->retrieveNotSetStatus($jng_sp_id, 'CAT,PRI');
if ($status !== false) {
    // Instead shows the confirmation of Success/Fail for last generated upload file, just set the uploaded file into Success 'S'
    $class_ju->updateStatus($status['jng_sp_upload_id'], 'S', $session_userinfo['username']);
    header("Location: ?open=sp-catalog");
} else {
    /*
    $filter_query = " WHERE jc.active_status='1'";
    $cat_total_query = tep_db_query("SELECT count(jc.jng_sp_catalog_id) AS total FROM jng_sp_catalog jc".$filter_query);
Esempio n. 15
0
function drawLengthsForm($products_id)
{
    global $class_pm, $class_pa;
    use_class('Product');
    $product = $class_pm->retrieveDetail($products_id, 'p,pd,pnc,cat');
    $articles = $class_pa->retrieveList($products_id);
    $category = $class_pm->retrieveCategoryName($product['categories_id'], '1');
    $use_size = Product::isUsingSizeInsteadOfLength($product['categories_id']);
    $result = '<h2 class="red-bright" style="margin-bottom:0;text-transform:uppercase;">' . $category . '</h2>';
    $result .= '<span class="red">Please make sure product category is correct,<br />contact IT Team if you need to change it!</span><br /><br />';
    $result .= 'Default Length/Size:<br />';
    $input_id = 'deflength';
    $input_class = 'class="w080"';
    if ($use_size) {
        $sizes = getLength2Sizes();
        $size_options = loadComboListFromArray($sizes, null, $product['pnc']['products_length'], false);
        $result .= '<select id="' . $input_id . '" ' . $input_class . '>' . $size_options . '</select>';
    } else {
        $result .= '<input type="text" id="' . $input_id . '" ' . $input_class . 'value="' . number_format($product['pnc']['products_length'], 2) . '" onfocus="$(this).select();" /> cm';
    }
    $result .= '<br /><br />';
    //Set MAX additional length per category
    switch ($product['categories_id']) {
        case '2':
        case '3':
        case '30':
            $al_max = 2;
            break;
        case '4':
        case '9':
        case '28':
            $al_max = 0;
            break;
        case '29':
            $al_max = 7;
            break;
        default:
            $al_max = 5;
    }
    $al_count = 0;
    if ($al_max > 0 || count($articles) > 0) {
        $result .= 'Additional Lengt/Size:<br />';
        if (count($articles) > 0) {
            $input_class = 'class="updlength w080"';
            foreach ($articles as $a) {
                $al_count++;
                $input_id = 'paid-' . $a['products_articles_id'];
                if ($use_size) {
                    $size_options = loadComboListFromArray($sizes, null, $a['length'], false);
                    $result .= $al_count . ' - <select id="' . $input_id . '" ' . $input_class . '>' . $size_options . '</select>';
                } else {
                    $result .= $al_count . ' - <input type="text" id="' . $input_id . '" ' . $input_class . ' value="' . number_format($a['length'], 2) . '" /> cm';
                }
                $result .= '<br />';
            }
        }
        if ($al_count < $al_max) {
            $input_class = 'class="addlength w080"';
            for ($al = $al_count + 1; $al <= $al_max; $al++) {
                if ($use_size) {
                    $size_options = loadComboListFromArray($sizes, null, null, false);
                    $result .= $al . ' - <select ' . $input_class . '>' . $size_options . '</select>';
                } else {
                    $result .= $al . ' - <input type="text" ' . $input_class . ' value="" /> cm';
                }
                $result .= '<br />';
            }
        }
        $result .= '<br /><br />';
    }
    $result .= '<input id="setlengthok" type="button" class="button green" value="Save Lengths" />';
    return $result;
}
Esempio n. 16
0
 /**
  * Display category combobox
  * @param String $id ID of combobox
  * @param String $name Name parameter of combobox
  * @param String $value Default value of combobox
  * @param String $class Class parameter of combobox
  * @param String $style Style parameter of combobox
  * @param Boolean $use_placeholder Show default hint text
  * @param String $place_holder_text Text to show as hint text
  * @param Boolean $show_only_with_categories Set to true to hide top cat without cats
  * @return String combobox in html format
  */
 public static function displayAsComboBox($id = '', $name = '', $value = '', $class = '', $style = '', $use_placeholder = true, $place_holder_text = 'Please select a top category...', $show_only_with_categories = false, $selected_id = null)
 {
     $ct_options = array();
     while ($ct = self::getOneByOneAsObject()) {
         if ($ct->getCategoriesTotalCount() > 0) {
             $ct_options[$ct->id] = $ct->name;
         }
     }
     $ct_select = '<select';
     if ($id != '') {
         $ct_select .= ' id="' . $id . '"';
     }
     if ($name != '') {
         $ct_select .= ' name="' . $name . '"';
     }
     if ($class != '') {
         $ct_select .= ' class="' . $class . '"';
     }
     if ($style != '') {
         $ct_select .= ' style="' . $style . '"';
     }
     $ct_select .= '>';
     if ($use_placeholder) {
         $ct_select .= '<option value="0" selected disabled>' . $place_holder_text . '</option>';
     }
     if (!is_null($selected_id)) {
         $ct_select .= loadComboListFromArray($ct_options, '', $selected_id);
     } else {
         $ct_select .= loadComboListFromArray($ct_options);
     }
     $ct_select .= '</select>';
     return $ct_select;
 }
Esempio n. 17
0
$content .= '<div>';
//$content .= '<iframe id="upload_target" name="upload_target" style="width:0;height:0;border:0px solid #fff;"></iframe>';
//$content .= '<form name="frm_upload_image" action="?open=element" method="post" enctype="multipart/form-data" target="upload_target">';
//$content .= '<input type="hidden" name="me_action" value="ELEMENTUPLOADIMAGE" />';
//$content .= '<input type="hidden" id="image_elements_id" name="elements_id" />';
$content .= '<input type="file" id="upload_image" name="elements_image" disabled="disabled" />';
$content .= ' <span class="notice">* JPG 500x500 pixels</span>';
$content .= '</form>';
$content .= '</div>';
$content .= '</td></tr>';
//$content .= '<tr><td>Wax Complexity</td><td colspan="2">'.$element_wax_complexity.'</td></tr>';
$content .= '<tr><td>Wax Complexity</td><td rowspan="2" width="200">' . $element_wax_complexity . '</td>';
$descat_array = $design->getDesignCategory();
$content .= '<td><form name="el-revision" method="post" action="?open=designs-detail" enctype="multipart/form-data">';
$content .= '<input type="hidden" name="me_action" value="CREATENEWDESIGN" />';
$content .= '<select id="cbo-descat" name="cat" class="input" style="display:none;">' . loadComboListFromArray($descat_array, '', 'E') . '</select>';
$content .= '<input id="el_id" name="element_id" type="hidden" class="input" value="' . $element->id . '" />';
$content .= '<input id="el_name" name="name" type="hidden" class="input" value="Revision element ' . $element->id . '" />';
$content .= '<input type="button" id="el-revision-button" value="Revision" />';
$content .= '</form></td>';
$content .= '</tr>';
$content .= '</table>';
$content .= '</div>';
//STOCKLESS CATEGORY NOTICE
$catnot_bg = '#efefef';
$catnot_fg = '#fcc';
$elcats = $class_ea->retrieveListData('cat');
$elcats_stockless = array();
foreach ($elcats as $elcat) {
    if (in_array($elcat['element_category_id'], $STOCKLESS_ELEMENTS_CATEGORY)) {
        $elcats_stockless[] = $elcat;
$year_start = '2013';
$year_end = date('Y') + 1;
$year_options = array();
for ($y = $year_start; $y <= $year_end; $y++) {
    $year_options[$y] = $y;
}
$week_options = array();
for ($w = 1; $w <= 52; $w++) {
    $week_options[$w] = str_pad($w, 2, '0', STR_PAD_LEFT);
}
$fc = new forecasting($kw_year);
$esp_options = array('1' => '1 week', '2' => '2 weeks', '3' => '3 weeks', '4' => '4 weeks');
$cmb_week_start = '<select id="cmb-week_start" class="w080">' . loadComboListFromArray($week_options, 1) . '</select>';
$cmb_week_end = '<select id="cmb-week_end" class="w080">' . loadComboListFromArray($week_options, 52) . '</select>';
$cmb_years = '<select id="cmb-year" class="w080 bold">' . loadComboListFromArray($year_options, $kw_year) . '</select>';
$cmb_esp = '<select id="cmb-esp" class="w200">' . loadComboListFromArray($esp_options, null, $forecasting_conf['elements-sourcing-projection']) . '</select>';
$content .= '<h2>Showing forecasting factor of year &nbsp; ' . $cmb_years . '</h2>';
$content .= '<div id="graph-forecasting"></div>';
$content .= '<div style="width:1000px;">';
$content .= '<div style="float:right;"><input id="btn-update" type="button" value="Update Factors" /></div>';
//$content .= '<input id="btn-update-esp" type="button" value="Update Elements Sourcing Projection" />';
$content .= '<div class="box w500 ui-corner-all" style="padding:5px;margin-top:10px;">';
$content .= '<h3>Chart Legend</h3>';
$content .= '<div><table border="0" cellspacing="0" cellpadding="0">';
$content .= '<tr style="background:#efccef;"><td class="w080">Purple Block</td><td>=</td><td>Current Calendar Week</td></tr>';
$content .= '<tr><td class="blue">Blue Line</td><td class="blue">=</td><td class="blue">Default Factor (use for Depot Refill)</td></tr>';
//$content .= '<tr><td class="red">Red Line</td><td class="red">=</td><td class="red">Elements Sourcing Factor (projected earlier from Default Factor)</td></tr>';
$content .= '</table></div>';
$content .= '</div>';
$content .= '</div>';
$content .= '<div id="ltf-settings" style="margin-top:30px;"></div>';
Esempio n. 19
0
                $tc_value[$total_key] = $table_total[$table_key][$tc_key];
                $result .= tep_draw_table('scorecard', $tc_value, false, true);
            }
        }
        //That's it, now give back the table
        echo utf8_encode($result);
        exit;
    }
}
$period_options = array();
$period_options['all'] = 'Show All Months';
$period_options['actual'] = 'Show Actual Months';
$view_option = array();
$view_option['overview'] = 'Show Overview';
$view_option['details'] = 'Show Details';
$content .= '<div>' . '<select id="cmb_based" class="input">' . loadComboListFromArray($based_options, null, 'sp') . '</select>' . '<select id="cmb_period" class="input">' . loadComboListFromArray($period_options, null, 'actual') . '</select>' . '<select id="cmb_view" class="input">' . loadComboListFromArray($view_option, null, 'details') . '</select>' . '</div>' . '<div id="div_period_actual" class="w150 tac" style="margin:5px 0 5px 215px;">' . '<span class="ui-state-default ui-corner-all" style="float:left;">' . '<span id="icn-period-prev" class="ui-icon ui-icon-triangle-1-w pointer">' . '</span></span>' . 'Change Period' . '<span class="ui-state-default ui-corner-all" style="float:right;">' . '<span id="icn-period-next" class="ui-icon ui-icon-triangle-1-e pointer">' . '</span></span>' . '</div>' . '<div style="width:100%;padding-bottom:40px;overflow:auto;">' . '<div id="scorecard_container" style="width:2000px;">' . '</div></div>';
$javascript .= '
    $("#cmb_based").change(function() {
        $("#scorecard_container").html(img_ajax_load_1);
        var based_option = $(this).val();
        $.post(
            url, 
            { 
                me_action: "LOADTABLES", 
                based_option: based_option 
            }, 
            tableLoaded, 
            "html");
    });
    function tableLoaded(htmlResult, txtStatus) {
        if (txtStatus=="success") {
    $content .= tep_draw_table('', $table);
    $content .= '<div class="buttons-left"><input type="submit" name="submit" value="Cancel Orders!" title="Click here to cancel orders as " /></div>';
    $content .= '</form>';
} else {
    $jng_sp_id = '5';
    $sp_detail = $class_sp->retrieveDetail($jng_sp_id);
    $option_sp = array($sp_detail['jng_sp_id'] => $sp_detail['package_prefix']);
    $option_stars = array('SHOWALL' => 'Show All', '0' => '0 Star', '1' => '1 Star', '2' => '2 Stars', '3' => '3 Stars');
    $content .= '<div id="search_form" class="ui-widget-content ui-corner-all" style="position:fixed;padding:10px;cursor:move;">';
    $content .= '<h2>Filter Window</h2>';
    $content .= '<table class="form" border="0" cellpadding="0" cellspacing="0">';
    $content .= '<tr><td width="120">Sales Partner</td><td><select name="sales_partner">' . loadComboListFromArray($option_sp) . '</select></td></tr>';
    $content .= '<tr><td>Order Date</td><td><input type="text" name="order_date" /></td></tr>';
    $content .= '<tr><td>Products ID</td><td><input type="text" name="products_id" /></td></tr>';
    $content .= '<tr><td>Products EAN</td><td><input type="text" name="products_ean" /></td></tr>';
    $content .= '<tr><td>Product Stars</td><td><select name="stars">' . loadComboListFromArray($option_stars, null, null, false) . '</select></td></tr>';
    $content .= '<tr><td>Order SP&ge;</td><td><input type="text" name="order_ge" /></td></tr>';
    $content .= '<tr><td>Order SP&le;</td><td><input type="text" name="order_le" /></td></tr>';
    $content .= '<tr><td>Stock SP&ge;</td><td><input type="text" name="sp_stock_ge" /></td></tr>';
    $content .= '<tr><td>Stock SP&le;</td><td><input type="text" name="sp_stock_le" /></td></tr>';
    $content .= '<tr><td>Stock HH&ge;</td><td><input type="text" name="hh_stock_ge" /></td></tr>';
    $content .= '<tr><td>Stock HH&le;</td><td><input type="text" name="hh_stock_le" /></td></tr>';
    $content .= '<tr><td>Sold &ge;</td><td><input type="text" name="sp_delivered_ge" /></td></tr>';
    $content .= '<tr><td>Sold &le;</td><td><input type="text" name="sp_delivered_le" /></td></tr>';
    $content .= '</table>';
    $content .= '<h2 class="tac" style="margin-top:10px;border-top:1px dashed #ccc;padding-top:10px;" title="Overview table of all orders of the selected date">Orders Overview</h2>';
    $content .= '<div class="tac"><table id="overview-table" class="form" border="0" cellpadding="0" cellspacing="0" style="margin:auto;">';
    $content .= '<tr><td width="120" class="tal">Total Orders</td><td id="overview-orders" class="tar">0</td></tr>';
    $content .= '<tr><td class="tal">Total Cancels</td><td id="overview-cancels" class="tar">0</td></tr>';
    $content .= '<tr><td class="tal">Total Confirmed</td><td id="overview-confirmed" class="tar">0</td></tr>';
    $content .= '</table></div>';
        }
    } elseif ($status == 'F') {
        $filter_month = array();
        $filter_year = array();
        for ($d = 1; $d <= 12; $d++) {
            $filter_month[$d] = date("F", mktime(0, 0, 0, $d));
        }
        $current_year = date('Y');
        $fsy = $current_year - 2;
        //Filter Start Year
        for ($y = $fsy; $y <= $current_year; $y++) {
            $filter_year[$y] = $y;
        }
        $tabcontent .= '<div style="margin-bottom:10px;">';
        $tabcontent .= '<select id="months" name="months">' . loadComboListFromArray($filter_month, null, date('n'), false) . '</select>';
        $tabcontent .= '<select id="years" name="years" style="margin-left:10px;">' . loadComboListFromArray($filter_year, null, $current_year) . '</select>';
        $tabcontent .= '<input type="button" id="btn-search-po" value="Search" style="margin-left:10px;" />';
        $tabcontent .= '</div>';
        $tabcontent .= '<div id="search-po-result"></div>';
    } else {
        $tabcontent = '<h3>UNDER CONSTRUCTION</h3>';
    }
    echo utf8_encode($headbutton . $tabcontent);
    exit;
}
element::loadDIOHsettings();
$content = '<div id="curset-block" style="width:300px;position:fixed;top:174px;right:35px;z-index:1;">';
$content .= '<div class="ui-state-default ui-corner-all" style="float:right;margin:10px 10px 0 0"><span title="Hide/Show Current Settings" class="ui-icon ui-icon-info" id="curset-icon"></span></div>';
$content .= '<div class="ibox ui-corner-all" style="padding:10px;display:none;">';
//$content .= '<h3>Current Settings</h3>';
$content .= '<h3>DIOH Target</h3>';
 $content .= '<tr><td>Sourcing Type</td><td><select name="estype">' . loadComboListFromArray($option_sourcing_type, null, null, false) . '</select></td></tr>';
 $content .= '<tr><td>Default Supplier</td><td><select name="edefsup">' . loadComboListFromArray($option_suppliers, null, null, false) . '</select></td></tr>';
 $content .= '<tr><td>Sold L30D &ge;</td><td><input type="text" name="esold_ge" /></td></tr>';
 $content .= '<tr><td>Sold L30D &le;</td><td><input type="text" name="esold_le" /></td></tr>';
 $content .= '<tr><td>Usage L30D &ge;</td><td><input type="text" name="eused_ge" /></td></tr>';
 $content .= '<tr><td>Usage L30D &le;</td><td><input type="text" name="eused_le" /></td></tr>';
 $content .= '<tr><td>Stock Available &ge;</td><td><input type="text" name="stock_ge" /></td></tr>';
 $content .= '<tr><td>Stock Available &le;</td><td><input type="text" name="stock_le" /></td></tr>';
 $content .= '<tr><td>Refill Ordered &ge;</td><td><input type="text" name="ordered" /></td></tr>';
 //$content .= '<tr><td>Refill Requested &ge;</td><td><input type="text" name="requested" /></td></tr>';
 $content .= '<tr><td>Missing Quantity &ge;</td><td><input type="text" name="MISSING" /></td></tr>';
 $content .= '<tr><td>Stock DIOH &ge;</td><td><input type="text" name="DIOHGE" /></td></tr>';
 $content .= '<tr><td>Stock DIOH &le;</td><td><input type="text" name="DIOHLE" /></td></tr>';
 $content .= '<tr><td>Stock+Refill DIOH &ge;</td><td><input type="text" name="DIOH2GE" /></td></tr>';
 $content .= '<tr><td>Stock+Refill DIOH &le;</td><td><input type="text" name="DIOH2LE" /></td></tr>';
 $content .= '<tr><td>Refill Flag</td><td><select name="REFILL">' . loadComboListFromArray($option_refill, null, null, false) . '</select></td></tr>';
 $content .= '<tr><td>Max Usage &ge;</td><td><input type="text" name="maxusage_ge" /></td></tr>';
 $content .= '<tr><td>Max Usage &le;</td><td><input type="text" name="maxusage_le" /></td></tr>';
 $content .= '</table>';
 $content .= '</div>';
 $header = 'Missing Quantity Formula';
 $paragraphs = array();
 $paragraphs[] = 'Missing Quantity = (Stock Target + Orders in Sourcing) - (Stock Available + Refill Ordered)';
 $content .= drawSOPinfo($header, $paragraphs, $list_margin . 'margin-bottom:20px;');
 $content .= '<div id="search_result" class="draw-table" style="' . $list_margin . 'width:900px;"></div>';
 $javascript = '
             function poResult(txtResult, txtStatus) {
                if(txtStatus="success") {
                 alert(txtResult);
                }
             }
        $bcid = tep_db_prepare_input($_POST['bcid']);
        $new_status = '11';
        $exclude_status = $class_ml->removeFromPackage($logistic_id, $log_partner, $bcid, $new_status);
        echo $exclude_status;
    }
    exit;
}
//START TEMPLATE
$logistic_id = isset($_GET['id']) ? tep_db_prepare_input($_GET['id']) : '';
$log_data = $class_ml->retrieveDetail($logistic_id);
$title = 'Package Info';
$logparts = array();
$logparts['ged'] = 'GED';
$logparts['dhl'] = 'DHL';
$logpart = substr($log_data['logistic_code'], 0, 3) == 'DHL' ? 'DHL' : 'GED';
$logpart_options = '<select id="cmb_logpart" style="width:142px;">' . loadComboListFromArray($logparts, $logpart) . '</selct>';
$date_time = $log_data['logistic_date'] == '' || $log_data['logistic_date'] == '0000-00-00' ? time() : strtotime($log_data['logistic_date']);
$date_value = date('d.m.Y', $date_time);
$date = '<input type="text" id="log_date" class="date_picker" value="' . $date_value . '" />';
$code_ged = '<input type="text" id="log_code-ged" value="' . $log_data['logistic_code'] . '" />';
if ($logpart == 'DHL' && $log_data['logistic_id'] != '' && $log_data['ptb_no'] == '') {
    $dhlcode = $class_ml->PTBinvoiceNoOldFormat($date_time);
} else {
    $dhlcode = $class_ml->PTBinvoiceNo($date_time, $log_data['ptb_no']);
}
$code_dhl = '<input type="text" id="log_code-dhl" value="' . $dhlcode . '" disabled="disabled" />';
$weight = '<input type="text" id="log_weight" value="' . $log_data['logistic_weight'] . '" /> <span class="notice">Kg</span>';
$sel_usd = $log_data['currency'] == 'USD' ? 'selected="selected"' : '';
$sel_eur = $log_data['currency'] == 'EUR' ? 'selected="selected"' : '';
$sel_idr = $log_data['currency'] == 'IDR' ? 'selected="selected"' : '';
$price = '<input type="text" id="log_price" value="' . $log_data['logistic_price'] . '" />';
             $qty_to_qtytype_raw = $stock['pieces_per_qty_type'] > 0 ? $eqty / $stock['pieces_per_qty_type'] : 0;
             $qty_to_qtytype = ceil($qty_to_qtytype_raw);
             $current_stock = intval($stock['stock']);
             $show_qty_detail = $stock['pieces_per_qty_type'] > 1 ? '' : 'display:none;';
             $sdt = $stock['pieces_per_qty_type'] == 1 ? '' : '<br /><br /><span title="Safety Delivery Time">(SDT: ' . $elements[$eid]->displaySafetyDT($stock['stock'], $elements[$eid]->suppliers[$supid]['resourcing_day']) . ')</span>';
             $content .= '<tr id="' . $rowid . '" class="eid ' . $rowclass . '">';
             $content .= '<td class="img">' . webImageWithDetailLinkStars($elements[$eid]->image, IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1, "Element {$eid}", '', 'View Larger Image', IMAGE_SIZE_BIG_1, IMAGE_SIZE_BIG_1, $elements[$eid]->stars) . '</td>';
             $content .= '<td class="w200 tac"><a href="?open=element&amp;id=' . $eid . '&amp;hidemenu=true" class="view_webpage">' . $eid . '</a>' . $elements[$eid]->displayStockInfoTable($current_stock) . '</td>';
             $content .= '<td class="w150 tac">';
             $content .= '<div id="e' . $eid . 'qtydet" class="notice" style="' . $show_qty_detail . '"><span class="red"><span id="e' . $eid . 'defqty">' . $eqty . '</span> qty</span> &asymp; <span id="e' . $eid . 'unitqtyraw">' . number_format($qty_to_qtytype_raw, 2) . '</span> <span class="e' . $eid . 'unit">' . $stock['qty_type'] . '</span></div>';
             $content .= '<div class="smallText notice" style="margin-bottom:10px;' . $show_qty_detail . '"><span id="e' . $eid . 'uqpp">' . $stock['pieces_per_qty_type'] . '</span> qty = 1 <span class="e' . $eid . 'unit">' . $stock['qty_type'] . '</span></div>';
             $content .= '<input type="text" id="e' . $eid . 'order" class="w080 tac" value="' . $qty_to_qtytype . '" />';
             $content .= '<br />' . $stock['qty_type'];
             $content .= '</td>';
             $content .= '<td class="w150 tac">' . $elements[$eid]->displayDIOH($current_stock) . $sdt . '</td>';
             $content .= '<td class="w200 tac"><select id="e' . $eid . 'supchange" name="supchange" class="input"><option value="0">Source to...</option>' . loadComboListFromArray($suppliers_options[$eid]) . '</select></td>';
             $content .= '</tr>';
         }
     }
     $content .= '</tbody>';
     $content .= '</table></div>';
     $content .= '</div>';
 }
 if (count($suppliers) > 0) {
     $content .= '<div class="buttons-left"><input id="makepo" type="button" value="Create PO" title="Create PO for each Supplier" /></div>';
 } else {
     $content .= '<h3 class="green">No On Demand Products are planned in this Preorder</h3>';
 }
 $javascript .= '
         $("select[name=supchange]").change(function() {
             var supid = parseInt($(this).val());
 function drawTableAction($products_id, $default_length = '', $default_price = '', $default_ean = '')
 {
     if ($default_length == '' || $default_price == '') {
         $default = $this->getDefault($products_id);
         $default_price = number_format($default['products_price'], 2);
         $default_length = $default['products_length'];
         $default_ean = $default['products_ean'];
     }
     $default_length_text = textLength($default_length);
     if ($default_ean == '') {
         $default_ean .= '<input id="ean_to_product" type="button" value="Attach EAN No" />';
         $default_ean .= '<img src="images/ajax-load-3.gif" id="pa-defean-process" style="display:none;" />';
     }
     $style_length = 'style="width:50px;"';
     $style_price = 'style="width:60px;"';
     $sizes = getLength2Sizes();
     array_shift($sizes);
     $use_size = array_key_exists(strval($default_length), $sizes);
     if ($use_size) {
         $size_options = loadComboListFromArray($sizes, null, null, false);
         $new_length = '<select id="new_length">' . $size_options . '</select>';
     } else {
         $new_length = '<input type="text" id="new_length" value="" ' . $style_length . ' />';
     }
     $result = '';
     $totalcols = 5;
     $rowsep = '<tr><td colspan="' . $totalcols . '">&nbsp;</td></tr>';
     $result .= '<div class="form"><table class="nltable" border="0" cellpadding="0" cellspacing="0">';
     $result .= '<tr><td colspan="' . $totalcols . '">';
     $result .= '<div class="red">* Changes will affect all sales partner</div>';
     $result .= '<div class="red">&nbsp;</div>';
     $result .= '</td></tr>';
     $tctemp = $totalcols - 2;
     $result .= '<tr><td colspan="2" class="bold">Default Length/Size</td><td colspan="' . $tctemp . '" class="bold"><span id="pa-deflength">' . $default_length_text . '</span></td></tr>';
     //$result .= '<tr><td colspan="2" class="bold">Default Price</td><td colspan="'.$tctemp.'" class="bold"><span id="pa-defprice">'.$default_price.'</span> EUR</td></tr>';
     $result .= '<tr><td colspan="2" class="bold">EAN No</td><td colspan="' . $tctemp . '" class="bold"><span id="pa-defean">' . $default_ean . '</span></td></tr>';
     $result .= $rowsep;
     if ($default_length == 0) {
         $result .= '<tr><td colspan="' . $totalcols . '" class="bold red">Adding article is not available for this product.</td></tr>';
     } else {
         $result .= '<tr><td colspan="4" class="bold">Add New Length/Size:</td></tr>';
         $result .= '<tr>';
         $result .= '<td>' . $new_length . '</td>';
         //$result .= '<td><input type="text" id="new_length_price" value="" '.$style_price.' /></td>';
         //$result .= '<td><input type="text" id="new_length_price_old" value="" '.$style_price.' /></td>';
         $result .= '<td><input type="button" id="new_length_add" value="Add" /></td>';
         $result .= '<td>&nbsp;</td>';
         $result .= '</tr>';
         $result .= $rowsep;
         $result .= '<tr><td colspan="' . $totalcols . '" class="bold">Additional Length/Size</td></tr>';
         //$result .= '<tr><td>No</td><td>EAN</td><td>Length <small>(cm)</small> &nbsp;</td><td>Price <small>(EUR)</small> &nbsp;</td><td>Old Price <small>(EUR)</small> &nbsp;</td><td>Action</td><td>isActive</td></tr>';
         $result .= '<tr><td class="w040">No</td><td class="w150">EAN</td><td class="w080">Length/Size</td><td class="w200">Action</td><td class="w080">isActive</td></tr>';
         $products_articles = $this->retrieveList($products_id);
         if (count($products_articles) > 0) {
             $article_counter = 0;
             foreach ($products_articles as $pa) {
                 $article_counter++;
                 $el_id = 'extra-length-' . $pa['products_articles_id'];
                 $class_with_id = 'class="extra-length-' . $pa['products_articles_id'] . '"';
                 if ($pa['products_ean'] != '') {
                     $ean_no = $pa['products_ean'];
                     $length_readonly = 'readonly="readonly"';
                     $action = '<div class="notice">Not Editable</div>';
                 } else {
                     $ean_no = '<span class="notice">Unset</span>';
                     $length_readonly = '';
                     $action = '<span class="update-extra-length blue" id="upd-' . $pa['products_articles_id'] . '">Update</span>';
                     $action .= '<span class="sep"> &bull; </span><span class="remove-extra-length red" id="del-' . $pa['products_articles_id'] . '">Remove</span>';
                     $action .= '<span class="sep"> &bull; </span><span class="extra-length-ean red" id="ean-' . $pa['products_articles_id'] . '">Attach EAN</span>';
                 }
                 $result .= '<tr id="' . $el_id . '">';
                 $result .= '<td>' . $article_counter . ' &raquo; </td>';
                 $result .= '<td id="pa-ean-' . $pa['products_articles_id'] . '">' . $ean_no . '</td>';
                 $result .= '<td><input type="hidden" id="pa-length-' . $pa['products_articles_id'] . '" value="' . $pa['length'] . '" />' . textLength($pa['length']) . '</td>';
                 //$result .= '<td><input type="text" id="pa-price-'.$pa['products_articles_id'].'" value="'.$pa['price'].'" '.$style_price.' /></td>';
                 //$result .= '<td><input type="text" id="pa-price-old-'.$pa['products_articles_id'].'" value="'.$pa['price_old'].'" '.$style_price.' /></td>';
                 $result .= '<td id="pa-act-' . $pa['products_articles_id'] . '">';
                 $result .= '<div>' . $action . '</div>';
                 $result .= '<div style="display:none;"><img src="/images/ajax-load-3.gif" /></div>';
                 $result .= '</td>';
                 $check = $pa['active_status'] == '0' ? ' disabled="disabled"' : ' checked="checked"';
                 $result .= '<td class="tac"><input type="checkbox" id="cb-pa-active-' . $pa['products_articles_id'] . '" name="pa-active-status" value="' . $pa['products_articles_id'] . '"' . $check . ' /></td>';
                 $result .= '</tr>';
             }
         }
     }
     $result .= '</table></div>';
     return $result;
 }
Esempio n. 26
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;
 }
$select_sp = '<select id="source_order" title="Select Main Filter">';
if (!SERVER_IS_LOCAL) {
    $select_sp .= '<option value="0">Julie & Grace</option>' . '<option value="allsp">All SP and J&G</option>';
} else {
    $select_sp .= '<option value="allsp">All Sales Partner</option>';
}
$select_sp .= loadComboList('jng_sp', 'jng_sp_id', 'name', $selected_sp) . '</select>';
//Set date filters field
$input_start_date = '<input type="text" class="date_picker" id="start_date" value="" />';
$input_end_date = '<input type="text" class="date_picker" id="end_date" value="" />';
//Set Available Numbering Format (to be used in table)
$number_format = array();
$number_format['EN'] = 'Flat (English)';
$number_format['DE'] = 'Flat (Deutsch)';
$number_format['MX'] = 'Manobo Default';
$select_number_format = '<select id="number_format" title="Select Number Format" />' . loadComboListFromArray($number_format) . '</select>';
$header = 'Important Information about Sales Data';
$paragraphs = array();
$paragraphs[] = 'All values are using the same data from <a href="?open=analysis-value-contribution">VC Analysis</a>, which means';
$paragraphs[] = '&sdot; Based on order date';
$paragraphs[] = '&sdot; All values are after return';
$paragraphs[] = '&sdot; <span class="red">B2B Sales Partner is based on <strong>REAL</strong> customer orders and not on PO (currently only AM.DE data is available)</a>';
$paragraphs[] = '&sdot; Data for B2B Sales Partner need to be uploaded on VC Analysis module before it can be used here';
$style = 'margin:0 0 20px 0;';
$content .= drawSOPinfo($header, $paragraphs, $style);
$content .= '<div id="form">' . '<table class="form" border="0" cellpadding="0" cellspacing="0">' . '<tr><td class="bold">Order Source</td><td class="bold">Start Date</td>' . '<td class="bold">End Date</td><td class="bold">Number Format</td><td>&nbsp;</td></tr>' . '<tr><td>' . $select_sp . '</td><td>' . $input_start_date . '</td>' . '<td>' . $input_end_date . '</td><td>' . $select_number_format . '</td>' . '<td><input type="button" id="submit" value="Generate Report" /></td></tr>' . '</table>' . '</div>' . '<div id="table-data"></div>' . '<div id="legend" class="float-box ui-corner-all" style="margin-top:40px;">' . '<h3>LEGEND (Sales Report Terms Explanation)</h3>' . '<table class="form" cellpadding="0" cellspacing="0">' . '<tr><td>Sold</td><td>=</td>' . '<td>Quantity sold after cancels and returns</td></tr>' . '<tr><td>Net Sales</td><td>=</td>' . '<td>Net sales after cancels and returns</td></tr>' . '<tr><td>Net Sales Ratio</td><td>=</td>' . '<td>Ratio of net sales compare to the total net sales</td></tr>' . '<tr><td>Average Price</td><td>=</td><td>Average products price</td></tr>' . '<tr><td>Average Margin</td><td>=</td><td>Average products margin</td></tr>' . '<tr><td>Profit</td><td>=</td>' . '<td>Net sales deducted by COGS</td></tr>' . '<tr><td>Profit Ratio</td><td>=</td>' . '<td>Ratio of profit compare to the total profit</td></tr>' . '<tr><td>Return Rate</td><td>=</td><td>Return rate in percentage</td></tr>' . '</table></div>';
$javascript = '
    $("#start_date,#end_date").datepicker({
        dateFormat: "dd.mm.yy",
        minDate: new Date("2010-04-00"),
        maxDate: new Date(),
$search_tip = 'Products ID, Code or Name (seperate by comma if > 1)';
$content .= '<div style="margin:20px 0;">';
$content .= $segment_combo;
$content .= '</div>';
//SPECIAL BUTTON TO OPEN LEVELLING OVERVIEW
$content .= '<div class=buttons-left" style="margin-bottom:10px;">' . '<input type="button" id="load-daily-nrf-orders" value="Show/Reload Daily Non-Refill Orders Overview" />' . '<input type="button" id="reload-main-table" value="Reload Table" />' . '</div>' . '<div id="daily-nrf-overview" style="display:none;margin-bottom:20px;">' . '</div>';
$content .= '<div id="search-box" style="margin:20px 0;">';
$content .= 'Search Products <input type="text" id="keywords" value="' . $search_tip . '" class="iwbutton input2 notice" title="Search specific products by ID, code or name" />';
$content .= '<input type="button" id="showreclist" value="Generate List" title="Show Recommendation List" />';
//$content .= '<input type="button" id="togglethumbs" value="Toggle Product Thumbnails" title="Show or hide product thumbnails for each items" />';
$content .= '</div>';
$content .= '<div id="depo-reclist"></div>';
//UPDATE FORM TEMPLATE
$suppliers_combo = '<select name="suppliers_id"><option value="0">Please select...</option>' . loadComboListFromArray($class_do->getOutsourceSuppliers()) . '</select>';
$price = '<input type="text" name="price" class="w100"/>';
$price .= '<select name="price_cur"><option value="0"></option>' . loadComboListFromArray($class_do->getOutsourceSuppliersCurrencies()) . '</select>';
$outsourcing_form .= '<div id="osform-box" style="margin-left:100px;">';
$outsourcing_form .= '<input type="hidden" name="aid" />';
$outsourcing_form .= '<table class="form" border="0" cellpadding="0" cellspacing="0">';
$outsourcing_form .= '<tr><td class="w100">Product ID</td><td><input type="text" name="pid" class="w100" readonly="readonly" /></td></tr>';
$outsourcing_form .= '<tr><td>Length</td><td><input type="text" name="length" class="w100" readonly="readonly" /></td></tr>';
$outsourcing_form .= '<tr><td>EAN</td><td><input type="text" name="ean" class="w100" readonly="readonly" /></td></tr>';
$outsourcing_form .= '<tr><td>Total Quantity</td><td><input type="text" name="qty_full" class="w100" /></td></tr>';
$outsourcing_form .= '<tr><td>Batch Size</td><td><input type="text" name="qty_batch" class="w100" /></td></tr>';
$outsourcing_form .= '<tr><td>Total Orders</td><td><input type="text" name="qty_multiplier" class="w100" readonly="readonly" /></td></tr>';
$outsourcing_form .= '<tr><td>Suppliers</td><td>' . $suppliers_combo . '</td></tr>';
$outsourcing_form .= '<tr><td>Price</td><td>' . $price . '</td></tr>';
$outsourcing_form .= '</table>';
$outsourcing_form .= '<div class="buttons"><input id="osform-submit" type="button" value="Create Outsourcing Order" /><input type="button" value="Close" class="simplemodal-close" /></div>';
$outsourcing_form .= '</div>';
//#osform-box
Esempio n. 29
0
function leadTimeCombo($lead_time_value, $event = '')
{
    $leadTimes = array('1' => '1 to 7 days', '2' => '8 to 14 days', '3' => '15 to 30 days', '4' => 'more than 30 days');
    $lead_time_combo = '<select ' . ($event ? 'onchange="' . $event . '"' : '') . '><option value="0" selected="selected">Show All</option>';
    $lead_time_combo .= loadComboListFromArray($leadTimes, null, $lead_time_value, false);
    $lead_time_combo .= '</select>';
    return $lead_time_combo;
}
Esempio n. 30
0
    foreach ($cat[0] as $key => $val) {
        $c = array();
        $c[$key] = '&nbsp;';
        $cat[] = $c;
    }
}
$actfil_options = array('act' => 'only Active Products', 'ina' => 'only Inactive Products', 'all' => 'all Active and Inactive Products');
$activefilter = '<select name="active-filter" class="input" onchange="filtering.submit();">';
foreach ($actfil_options as $value => $option) {
    $sel = $activefiltered == $value ? 'selected="selected"' : '';
    $activefilter .= '<option value="' . $value . '" ' . $sel . '>' . $option . '</option>';
}
$activefilter .= '</select>';
$navids = array('0' => 'Please select a navigation...', 'UNSET' => 'None / Unset') + retrieveNavIDs($jng_sp_id, '*');
$navid_filters = '<select name="nav-filter" class="input" onchange="filtering.submit();">';
$navid_filters .= loadComboListFromArray($navids, null, $navfiltered, false);
$navid_filters .= '</select>';
if ($navid_filters != '') {
    $navid_filters = '<tr><td>Filter by Nav ID</td><td>' . $navid_filters . '</td></tr>';
}
$content = '';
$content .= '<div style="float:right;">';
$content .= '<form name="filtering" action="?open=analysis-vc" method="post">';
$content .= '<table class="form" border="0" cellpadding="0" cellspacing="0">';
$content .= $navid_filters;
$content .= '<tr><td>Filter by Brand</td><td>' . drawBrandCombo(true, 'brand-filter', $brandfiltered, 'class="input" onchange="filtering.submit();"') . '</td></tr>';
$content .= '<tr><td>Filter by</td><td>' . $activefilter . '</td></tr>';
$content .= '</table>';
$content .= '</form>';
$content .= '</div>';
$content .= '<div style="margin-bottom:10px;">' . $sort_opt . '</div>';