function generateDesignsId($month) { // $dateObj = DateTime::createFromFormat('!m', $month); // $month_name = $dateObj->format('F'); $month_name = date('F', mktime(0, 0, 0, $month, 10)); echo "<h3>{$month_name}</h3>"; $query = "SELECT designs_id, status_time FROM designs_status_history"; $query .= " WHERE status=9 AND YEAR(FROM_UNIXTIME(status_time)) = '2014' AND MONTH(FROM_UNIXTIME(status_time)) = '{$month}'"; $result = tep_db_query($query); $c = array(); $c['no'] = 'No.'; $c['id'] = 'Designs ID'; $c['date'] = 'Finalized Date'; $table_des[] = $c; while ($row = tep_db_fetch_array($result)) { $no++; $date = date('d-m-Y', $row['status_time']); $c = array(); $c['no'] = $no; $c['id'] = $row['designs_id']; $c['date'] = $date; $table_des[] = $c; } $table = tep_draw_table('main_center', $table_des, true); echo $table; }
function spNAVdrawTable($jng_sp_id, $type, $navigations, $float) { global $type_allowed_clear; $allowed_clear = in_array($jng_sp_id . $type, $type_allowed_clear); $content = '<div id="nc-' . $type . '" class="nav-container" style="width:610px;' . ($float ? 'float:left;margin-right:15px;' : '') . '">'; if (!$float) { $title = 'Primary'; } else { if ($jng_sp_id == '1') { if ($type == 'jng') { $title = 'J&G Brand'; } elseif ($type == 's') { $title = 'Specials'; } } } if (!isset($title)) { $title = 'Secondary'; } $title .= ' Navigations'; $content .= '<h2 style="float:left;padding-top:7px;">' . $title . '</h2>'; $content .= spNAVdravAddButton($jng_sp_id, $type, 'margin-bottom:10px'); $table = array(); $table[] = spNAVdrawRowHeader($allowed_clear); foreach ($navigations as $nav_id => $nav_name) { $table[] = spNAVdrawRow($jng_sp_id, $type, $nav_id, $nav_name, $allowed_clear); } $content .= tep_draw_table('navs', $table); $content .= spNAVdravAddButton($jng_sp_id, $type, 'margin-top:10px'); $content .= '</div>'; //.nav-container return $content; }
public function getList($category_id, $languages_id = 2, $render_to_table = false) { $result = array(); $q = "SELECT m.*, md.name FROM measurements m" . " INNER JOIN measurements_description md" . " ON md.measurements_id = m.measurements_id AND md.languages_id = {$languages_id}" . " WHERE m.categories_id = {$category_id}"; $r = tep_db_query($q); while ($row = tep_db_fetch_array($r)) { $result[$row['measurements_id']] = $row; } if ($render_to_table) { if (is_array($result) && count($result) > 0) { $table = array(); $header['id'] = 'ID'; $header['name'] = 'Name'; $table[] = $header; foreach ($result as $mid => $mdt) { $row = array(); $link_to_edit = "?open=products-measurements&id={$mid}&hidemenu=true"; $row['id'] = '<a href="' . $link_to_edit . '" class="view_webpage">' . $mid . '</a>'; $row['name'] = '<a href="' . $link_to_edit . '" class="view_webpage">' . $mdt['name'] . '</a>'; $table[] = $row; } return tep_draw_table('measurement', $table); } else { return 'No data to show'; } } else { return $result; } }
function manageLogisticList($rowperpage, $page) { $result = ''; $result .= '<div>'; $result .= '<input type="button" id="newlogpack" value="Create New" title="Create New Logistic Package" />'; $result .= '<a href="?open=packages-logistic-detail&hidemenu=true" class="view_webpage"></a>'; $result .= '</div>'; $result .= '<div> </div>'; $count_logistic_query = tep_db_query("SELECT COUNT(logistic_id) AS total FROM minierp_logistic"); $count_logistic = tep_db_fetch_array($count_logistic_query); $offset = ($page - 1) * $rowperpage; $paging_filter = "LIMIT {$rowperpage} OFFSET {$offset}"; $lq = "SELECT ml.*, SUM(products_total_count) AS total_qty"; $lq .= " FROM minierp_logistic ml"; $lq .= " LEFT JOIN minierp_logistic_contents mlc ON mlc.logistic_id=ml.logistic_id"; $lq .= " GROUP BY logistic_id"; $lq .= " ORDER BY logistic_date DESC"; $lq .= " {$paging_filter}"; $logistic_query = tep_db_query($lq); $logistic = array(); while ($row = tep_db_fetch_array($logistic_query)) { $logistic[] = $row; } if (count($logistic) > 0) { $pagelink = tep_paging($count_logistic['total'], $page, '?open=packages-logistic-list&page='); $log_table = array(); $lt = array(); $lt['pac_code'] = 'Shipper Code'; $lt['long_id'] = 'Invoice No'; $lt['date'] = 'Sent Date'; $lt['qty'] = 'Qty'; $lt['countpro'] = 'Weight'; $lt['price'] = 'Price'; $lt['awb_no'] = 'AWB No'; $log_table[] = $lt; foreach ($logistic as $l) { $log_date = strtotime($l['logistic_date']); $sent_date = $l['sent_date'] == '' ? ' ' : date('d-M-Y', strtotime($l['sent_date'])); $lt = array(); $lt['pac_code'] = '<a href="?open=packages-logistic-detail&id=' . $l['logistic_id'] . '&hidemenu=true" class="view_webpage" title="View Logistic Detail">' . $l['logistic_code'] . '</a>'; $lt['long_id'] = $l['ptb_no'] != '' ? date('ym', $log_date) . '-' . $l['ptb_no'] : ' '; $lt['date'] = date('j-M-y', $log_date); $lt['qty'] = $l['total_qty']; $lt['countpro'] = $l['logistic_weight'] . ' Kg'; $lt['price'] = displayCurrency($l['currency'], $l['logistic_price']); $lt['awb_no'] = $this->awbCodeLink($l['awb_no']); $log_table[] = $lt; } $result .= tep_draw_table('packages', $log_table); $result .= $pagelink; } else { $result .= '<h3 class="red">No Logistic Packages is found in database</h3>'; } return $result; }
function managePackageList($rowperpage, $page) { $count_packages_query = tep_db_query("SELECT COUNT(packages_id) AS total FROM minierp_packages"); $count_packages = tep_db_fetch_array($count_packages_query); $offset = ($page - 1) * $rowperpage; $paging_filter = "LIMIT {$rowperpage} OFFSET {$offset}"; $packages_query = tep_db_query("SELECT * FROM minierp_packages {$paging_filter}"); $packages = array(); while ($row = tep_db_fetch_array($packages_query)) { $packages[] = $row; } $pagelink = tep_paging($count_packages['total'], $page, '?open=sp-packages&page='); $package_table = array(); $pt = array(); $pt['pac_code'] = 'Package Code'; $pt['awb_no'] = 'AWB No'; $pt['sen_date'] = 'Sent Date'; $pt['rec_date'] = 'Received Date'; $package_table[] = $pt; if (count($packages) > 0) { foreach ($packages as $p) { $sent_date = $p['sent_date'] == '' ? ' ' : date('d-M-Y', strtotime($p['sent_date'])); $received_date = $p['received_date'] == '' ? ' ' : date('d-M-Y', strtotime($p['received_date'])); $pt = array(); $pt['pac_code'] = '<a href="?open=sp-package&id=' . $p['packages_id'] . '" title="View Package Detail"s>' . $p['packages_code'] . '</a>'; $pt['awb_no'] = $p['awb_no']; $pt['sen_date'] = $sent_date; $pt['rec_date'] = $received_date; $package_table[] = $pt; } } else { $pt = array(); $pt['pac_code'] = ' '; $pt['awb_no'] = ' '; $pt['sen_date'] = ' '; $pt['rec_date'] = ' '; $package_table[] = $pt; } $result = tep_draw_table('packages', $package_table); $result .= $pagelink; return $result; }
$q .= " FROM jng_sp_orders_items_return joir"; $q .= " LEFT JOIN jng_sp_orders_items joi ON joi.jng_sp_orders_items_id=joir.jng_sp_orders_items_id"; $q .= " LEFT JOIN products p ON p.products_id=joi.products_id"; $q .= " WHERE joir.return_comment_customer!='' OR joir.return_comment_jng!=''"; $q .= " ORDER BY p.products_id, joir.return_time"; $r = tep_db_query($q); while ($row = tep_db_fetch_array($r)) { $returns[] = $row; } $table = array(); $t = array(); $t[1] = 'No'; $t[2] = 'Image'; $t[3] = 'Return Date'; $t[4] = 'Product Code'; $t[5] = 'Article No'; $t[6] = 'Reason'; $table[] = $t; foreach ($returns as $counter => $row) { $t = array(); $t[1] = '<div>' . ($counter + 1) . '</div>'; $t[2] = '<div>' . webImage($row['products_image'], '80', '80') . '</div>'; $t[3] = '<div>' . date('d-M-y', strtotime($row['return_time'])) . '</div>'; $t[4] = '<div>' . $row['products_model'] . '</div>'; $t[5] = '<div>' . $row['article_number'] . '</div>'; $t[6] = '<div>' . $row['return_reason'] . '</div>'; $table[] = $t; } $content = tep_draw_table('', $table); echo $content; tep_db_close();
$s['id'] = 'ID'; $s['active'] = 'Active'; $s['name'] = 'Name'; $s['desc'] = 'Description'; $stab[] = $s; foreach ($pi as $row) { $s = array(); $s['qty'] = '<input type="checkbox" name="piids[]" value="' . $row['production_instruction_id'] . '" />'; $s['id'] = $row['production_instruction_id']; $s['active'] = $row['active_status'] ? '<span class="green">A</span>' : '<span class="green">-</span>'; $s['name'] = '<a href="?open=production-instruction-manual&id=' . $row['production_instruction_id'] . '&hidemenu=true" class="view_webpage">' . $row['name'] . '</a>'; $s['desc'] = nl2br($row['description']); //production_instruction_manual::parsingDescription($row['description'], 'ul'); $stab[] = $s; } $pi_table = tep_draw_table('pi_manual', $stab); $action_buttons = ' <input id="delete-submit" type="submit" name="submit" value="Remove" style="display:none;" />'; $action_buttons .= ' <input id="delete-button" type="button" class="button red" value="Delete" />'; } echo utf8_encode($pi_table . '<span id="pibuttons">' . $action_buttons . '</span>'); exit; } else { if ($_POST['me_action'] == 'CREATEPI') { $pi_cat = tep_db_prepare_input($_POST['pi_cat']); $pi_name = tep_db_prepare_input($_POST['pi_name']); $pi_desc = tep_db_prepare_input($_POST['pi_desc']); $pi_active = tep_db_prepare_input($_POST['pi_active']); $class_pim = new production_instruction_manual(); $class_pim->create($pi_cat, $pi_name, $pi_desc, $pi_active); $messagebox->add('Manual Production Instruction created', 'green'); $reloadlist = true;
$r[] = $x; } $x = array(); $x['id'] = ' '; $x['name'] = '<strong>Total: ' . $total . ' Customer(s)<strong>'; $x['email'] = ' '; $x['date'] = ' '; $r[] = $x; } if (isset($_GET['format']) && $_GET['format'] == 'csv') { $file_name = 'jng-not-active-reports-' . date('Ymd-Hi') . '.csv'; header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=\"{$file_name}\""); header("Cache-Control: cache, must-revalidate"); header("Pragma: public"); echo tep_create_csv($r); exit; } $dl = '?report=customers-not-active&format=csv'; $content = '<a class="dl-icon" href="' . $dl . '" target="_blank"></a>'; $content .= ' <a class="dl-text" href="' . $dl . '" target="_blank">Download CSV</a>'; $xlimit = ceil($total / $each); $content .= '<h2>CSV per ' . $each . ' customers</h2>'; for ($x = 1; $x <= $xlimit; $x++) { $dl = '?report=customers-not-active&format=csv&list=' . $x; $content .= '<div><a href="' . $dl . '">Download List Cust #' . $x . ' </a></div>'; } $content .= '<div> </div>'; $content .= '<div class="total">Total: ' . $total . ' Customer(s)</div>'; $content .= tep_draw_table('reports', $r); $title = 'Incomplete Registration';
$content .= '</select></td></tr>'; $content .= '</table>'; $content .= '<table border="0" cellpadding="0" cellspacing="0" style="background:#eee;">'; $content .= '<tr><td rowspan="2"><input type="button" id="print-stock" value="Print Stock List" /></td>'; $content .= '<td><h3>Average DIOH</h3></td><td><h3>: <span id="avg-dioh">' . $dioh_average . '</span></h3></td></tr>'; $content .= '<tr><td><h3>Total Stock Value</h3></td><td><h3>: <span id="total-price">' . displayCurrency('EUR', $total_total) . '</span></h3></td></tr>'; $content .= '</table></div>'; $content .= '<strong>Sort by </strong><select id="sort_option" name="sort_option" onchange="frm_sort.submit();">'; foreach ($sort_options as $value => $option) { $sel = $sort_option == $value ? 'selected="selected"' : ''; $content .= '<option value="' . $value . '" ' . $sel . '>' . $option . '</option>'; } $content .= '</select>'; $content .= '</form></div>'; $content .= '<div style="clear:both;"> </div>'; $content .= tep_draw_table('proman sticky-tablehead', $table); $content .= '<div id="showopt" class="bold">'; $content .= '<div id="showmore">» Show <span class="show">' . $show_amount . '</span> more out of <span class="more"></span></div>'; $content .= '<div id="showall">» Show ALL (<span class="more"></span>)</div>'; $content .= '</div>'; // #showopt $content .= '<div style="display:none;">'; $content .= '<div id="printstocklist" style="width:500px;height:400px;padding:10px;">'; $content .= '<div id="errornotype" class="ui-corner-all" style="position:absolute;top:35px;left:200px;border:2px solid #f00;padding:10px 20px;color:#f00;display:none;">« Please Select a Type</div>'; $content .= '<table border="0" cellpadding="0" cellspacing="0">'; $content .= '<tr><td colspan="2"><h3>Stock List Type:</h3></td></tr>'; $content .= '<tr><td><input id="rad-slt-1" type="radio" name="type" value="FULL" /></td><td><label for="rad-slt-1">Full Stock Info</label></td></tr>'; $content .= '<tr><td><input id="rad-slt-2" type="radio" name="type" value="BLANK" /></td><td><label for="rad-slt-2">Blank / No Stock Info</label></td></tr>'; $content .= '<tr><td colspan="2"> </td></tr>'; $content .= '<tr><td colspan="2"><h3>Filter by Category:</h3></td></tr>'; $content .= '<tr><td><input id="rad-cat-0" type="radio" name="catid" value="0" /></td><td><label for="rad-cat-0">Show All Elements</label></td></tr>';
//PRICE GROUP TABLE $price_category = array(); $price_category[] = formatTableRow(REPORT_TABLE_TYPE_PRICEGROUP); $data_price_categories = queryData(REPORT_TABLE_TYPE_PRICEGROUP, $id_source_order, $start_date, $end_date); foreach ($data_price_categories as $dpc) { $price_category[] = formatTableRow($dpc['row_id'], $dpc['sold_pieces'], $dpc['total_sales'], $dpc['total_sales_ratio'], $dpc['avg_price'], $dpc['avg_margin'], $dpc['total_profit'], $dpc['total_profit_ratio'], $dpc['return_rate'], false); } $table_price_group = tep_draw_table('', $price_category, false, true); //PRODUCT BRAND TABLE $brand_category = array(); $brand_category[] = formatTableRow(REPORT_TABLE_TYPE_BRAND); $data_brand_categories = queryData(REPORT_TABLE_TYPE_BRAND, $id_source_order, $start_date, $end_date); foreach ($data_brand_categories as $dbc) { $brand_category[] = formatTableRow($dbc['row_id'], $dbc['sold_pieces'], $dbc['total_sales'], $dbc['total_sales_ratio'], $dbc['avg_price'], $dbc['avg_margin'], $dbc['total_profit'], $dbc['total_profit_ratio'], $dbc['return_rate'], false); } $table_brand = tep_draw_table('', $brand_category, false, true); //Merge all tables as 1 html $result = '<h3 style="margin-top:20px;">' . REPORT_TABLE_TYPE_CATEGORY . '</h3>' . '<div>' . $table_product_category . '</div>' . '<h3 style="margin-top:20px;margin-bottom:0px;">' . REPORT_TABLE_TYPE_PRICEGROUP . '</h3>' . '<span class="notice">Average price before return is used for seperating data into each Price Group</span>' . '<div style="margin-top:5px;">' . $table_price_group . '</div>' . '<h3 style="margin-top:20px;">' . REPORT_TABLE_TYPE_BRAND . '</h3>' . '<div>' . $table_brand . '</div>'; echo utf8_encode($result); exit; } } //Set Available Tables $arr_data_table = array(); $arr_data_table[] = 'Product Category'; $arr_data_table[] = 'Price Group'; $arr_data_table[] = 'Brand'; $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 {
$bus_partner['to'] = number_format($to_value, 2) . ' EUR'; $bp[] = $bus_partner; } } else { $bp[1]['sel'] = ' '; $bp[1]['company'] = ' '; $bp[1]['name'] = ' '; $bp[1]['email'] = ' '; $bp[1]['date'] = ' '; $bp[1]['lo'] = ' '; $bp[1]['to'] = ' '; } //EXPORT TO CSV DOWNLOAD LINK $export = ''; if ($page == 1) { $dl = '?open=business-partner&format=csv'; $export .= '<a class="dl-icon" href="' . $dl . '" target="_blank"></a>'; $export .= '<a class="dl-text" href="' . $dl . '" target="_blank">Download Complete CSV</a>'; } //START CONTENT $content = ''; $content .= $export; //$content .= '<div style="margin:0px 0px 5px 0px;"><a href="?open=business-p-fixed-disc">Manage Fixed Discount Status</a></div>'; $content .= '<form name="ambassador-status-remove" action="?open=business-partner" method="post">'; $content .= '<input type="hidden" name="me_action" value="BUSINESSPARTNERSTATUSREM" />'; $content .= tep_draw_table('bp', $bp) . $pagelink; $content .= '<div> </div>'; $content .= '<input type="submit" class="red button" name="submit" value="Remove Selected" />'; $content .= '<div> </div>'; $title = 'List of Business Partners'; }
} if ($total_ordered_after_void > 0) { if ($o['payment_status'] == '1') { $button_closed_dis_en = ''; } else { $button_closed_dis_en = ' disabled="disabled"'; } } else { $button_closed_dis_en = ''; } // $button_closed_dis_en = ($o['payment_status']!='1') ? 'disabled="disabled" ' : ''; $ot['d2'] = '<input type="text" id="paydat-' . $oid . '" name="paydat" value="' . $payment_date . '" class="date_picker"' . $payment_dis . ' />'; $ot['act'] = '<input type="button" id="close-' . $oid . '" name="close" value="Close"' . $button_closed_dis_en . ' />'; $otable[] = $ot; } $tabcontent .= tep_draw_table('spo sticky-tablehead', $otable); } } 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>';
$filter_query = ''; $el_query = tep_db_query("SELECT e.elements_id, e.elements_code, etes.item_number, e.elements_image AS image FROM element e\n INNER JOIN elements_to_elements_suppliers etes ON etes.elements_id=e.elements_id AND etes.is_default='1' AND etes.price_quantity_type='set'\n LEFT JOIN elements_images ei ON ei.elements_id=e.elements_id AND ei.elements_sample_name='EC1'\n LEFT JOIN elements_description ed ON ed.elements_id=e.elements_id AND ed.languages_id=2\n {$filter_query}\n GROUP BY e.elements_id ORDER BY e.elements_id"); $elements = array(); $e = array(); $e['i'] = '<div>Image</div>'; $e['j'] = '<div>J&G ID</div>'; $e['k'] = '<div>J&G Code</div>'; $e['l'] = '<div>J&G Name</div>'; $e['m'] = '<div>Supplier Code</div>'; $elements[] = $e; $grouper = array('+', '&', ','); while ($row = tep_db_fetch_array($el_query)) { $grabbed = false; foreach ($grouper as $g) { if (strpos($row['item_number'], $g) !== false) { $grabbed = true; break; } } if ($grabbed) { $e = array(); $e['i'] = '<div>' . webImage($row['image'], '130', '130') . '</div>'; $e['j'] = '<div>' . $row['elements_id'] . '</div>'; $e['k'] = '<div>' . $row['elements_code'] . '</div>'; $e['l'] = '<div>' . $row['name'] . '</div>'; $e['m'] = '<div>' . $row['item_number'] . '</div>'; $elements[] = $e; } } echo tep_draw_table('', $elements); tep_db_close();
$keywords_array = explode(' ', $keywords); foreach ($customers as $c) { $cname = strtolower($c['customers_name']); foreach ($keywords_array as $key) { $cname = str_replace($key, "<strong>{$key}</strong>", $cname); } $t = array(); $t['r'] = $c['partner']; $t['d'] = $c['jng_sp_customers_id']; $t['c'] = $cname; $action = '<input type="button" name="cadd2list" value="Add" />'; $action .= '<input type="hidden" id="cid-' . $c['jng_sp_customers_id'] . '" name="jng_sp_customers_id" value="' . $c['jng_sp_customers_id'] . '" />'; $t['a'] = $action; $table[] = $t; } $result .= tep_draw_table('spo', $table); } } echo utf8_encode($result); } elseif ($_POST['me_action'] == 'ADDCUSTOMER') { $jng_sp_customers_id = tep_db_prepare_input($_POST['jng_sp_customers_id']); $added = $class_jcs->addCustomer($type, $jng_sp_customers_id); $result = $added ? $jng_sp_customers_id : 'fail'; echo utf8_encode($result); } exit; } //START TEMPLATE $content = '<div>Search Customer Name</div>'; $content .= '<div style="margin-bottom:20px;">'; $content .= '<input type="text" id="search_keywords" value="" class="iwbutton" />';
$p_sel['dur'] = '<label for="cb_el' . $row['elements_id'] . '">' . $e_duration . '</label>'; $p_sel['name'] = '<label for="cb_el' . $row['elements_id'] . '">' . $e_name . '</label>'; $new_elements[] = $p_sel; } } else { $new_elements[1]['sel'] = ' '; $new_elements[1]['id'] = ' '; $new_elements[1]['model'] = ' '; $new_elements[1]['since'] = ' '; $new_elements[1]['dur'] = ' '; $new_elements[1]['name'] = ' '; } $ne_form = '<div>'; $ne_form .= '<form name="element-new-add" action="?open=elements-new" method="post">'; $ne_form .= '<input type="hidden" name="me_action" value="ELEMENTNEWADD" />'; $ne_form .= 'Element Code: <input type="text" class="iwbutton" name="elements_code" value="" style="width:200px" />'; $ne_form .= '<input type="submit" class="blue button" name="submit" value="Add" />'; $ne_form .= '</form>'; $ne_form .= '</div>'; $ne_form .= '<div> </div>'; $content = $ne_form; $content .= '<form name="element-new-remove" action="?open=elements-new" method="post">'; $content .= '<input type="hidden" name="me_action" value="ELEMENTNEWREM" />'; $content .= tep_draw_table('products-selected', $new_elements); $content .= '<div> </div>'; $content .= '<div><strong>There are ' . $total_ne . ' New Element(s)</strong></div>'; $content .= '<div> </div>'; $content .= '<input type="submit" class="red button" name="submit" value="Remove Selected" />'; $uppernotes = '<div style="color:#f00;">New Elements will be marked in Configurator</div>'; $uppernotes .= '<div><em>You can add multiple Code seperated by comma</em></div>'; $title = 'List of New Elements';
$invoice_date_end = date('Y-m-d 23:59:59', strtotime(tep_db_prepare_input($_GET['ide']))); $filter = "invoice_date >= '{$invoice_date_start}' AND invoice_date <= '{$invoice_date_end}'"; $payment_summary_data = payone::getPaymentSummaryData('A', $filter); $content = 'Invoice Date from ' . date('d-m-Y', strtotime($invoice_date_start)); $content .= ' to ' . date('d-m-Y', strtotime($invoice_date_end)); if (count($payment_summary_data) > 0) { $table = array(); $th = array(); $th['d'] = 'Invoice<br/>Date'; $th['d2'] = 'Invoice<br/>Due Date'; $th['c'] = 'Customer Name'; $th['o'] = 'Payment<br/>Method'; $th['id2'] = 'Order No'; $th['id3'] = 'Payone<br/>txid'; $th['p'] = 'Saldo<br/>(EUR)'; $table[] = $th; foreach ($payment_summary_data as $dt) { $tr = array(); $tr['d'] = date('d-m-Y', strtotime($dt['invoice_date'])); $tr['d2'] = date('d-m-Y', strtotime($dt['invoice_due_date'])); $tr['c'] = $dt['customers_name']; $tr['o'] = $dt['payment_method']; $order_link = '?open=customer-care-order-detail&source=' . ($dt['invoice_order_type'] == 'S' ? 'SP' : 'JG') . '&id=' . $dt['invoice_order_id'] . '&hidemenu=true'; $tr['id2'] = '<a title="click to view order detail" class="view_webpage" href="' . $order_link . '">' . $dt['order_no'] . '</a>'; $tr['id3'] = $dt['payone_txid']; $tr['p'] = displayCurrency('EUR', $dt['amount_saldo'], false); $table[] = $tr; } $content .= tep_draw_table('spo', $table); } $title = 'Payment Overview Orders List';
$result .= '</h3>'; //echo '<pre>';var_dump($tc_value); echo '</pre><br /><br />'; //Prepare the total values foreach ($table_total[$table_key][$tc_key] as $tt_temp_key => $tt_temp_val) { //Label column need no values if ($tt_temp_key != $classname_label) { if (is_array($tt_temp_val)) { $total = array_sum($tt_temp_val) / count($tt_temp_val); } else { $total = $tt_temp_val; } $table_total[$table_key][$tc_key][$tt_temp_key] = scorecard::finalDisplayFormat($tc_key, $total); } } $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 .= '
} $elements_used .= '<div style="float:left;text-align:center;margin:5px 8px;">' . webImage($re['elements_image'], IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1, 'Element ' . $re['elements_id'], 'img-border') . '<br /><span class="' . $class . '">(' . implode(',', $finishing) . ')</span></div>'; } $t['i'] = $elements_used; $button_el = '<span>'; $button_el .= '<a href="?open=designs-products-elements-used&products_id=' . $products_id . '&act=LOAD&hidemenu=true" class="view_webpage"></a>'; $button_el .= '<input type="button" name="upd-elements" value="» Update Elements Used" class="input tal" />'; $button_el .= '</span>'; $button_pd = '<span>'; $button_pd .= '<a href="?open=product-detail&products_id=' . $products_id . '&hidemenu=true#prodet-tab1d" class="view_webpage"></a>'; $button_pd .= '<input type="button" name="upd-prodescs" value="» Update Product Description" class="input tal" />'; $button_pd .= '</span>'; $t['a'] = $button_el . $button_pd; $table[] = $t; } $tab_content .= tep_draw_table("spo designs-list", $table); if ($total_rows == 200) { $tab_content .= '<h3 class="red">Manobo only show 200 Most Recent Products</h3>'; } } else { $tab_content .= '<h3 class="red">No Products found</h3>'; } $tab_content .= '<div style="margin-top:20px;"><input type="button" name="reloadlist" class="button" value="Reload List" style="font-size:20px;" /></div>'; echo utf8_encode($tab_content); exit; } $main_link = '?open=products-gold-non-finishing&status='; $content .= '<div id="tabs-products-lists">'; $content .= '<ul>'; $content .= '<li><a href="' . $main_link . '0">Goldplated Products with No Golplated Elements (<span id="tc-0"></span>)</a></li>'; $content .= '<li><a href="' . $main_link . '1">Silver Products with Goldplated Elements (<span id="tc-1"></span>)</a></li>';
function analysis_overview($period, $price_type) { use_class('jng_warehouses'); $class_jw = new jng_warehouses(); $q = "SELECT jw.name, jw.warehouse_code, jw.warehouse_type"; $q .= ", IF(jw.warehouse_type='E', SUM(mse.stock_open), SUM(msp.stock_open)) AS stock_open"; $q .= ", IF(jw.warehouse_type='E', SUM(mse.stock_close), SUM(msp.stock_close)) AS stock_close"; /* if($price_type=='mat_exp') { $q .= ", IF(jw.warehouse_type='E', SUM(mse.mat_exp_open), SUM(msp.mat_exp_open)) AS stock_value_open"; $q .= ", IF(jw.warehouse_type='E', SUM(mse.mat_exp_close), SUM(msp.mat_exp_close)) AS stock_value_close"; } else { $q .= ", IF(jw.warehouse_type='E', 0, SUM(msp.purchase_price_open)) AS stock_value_open"; $q .= ", IF(jw.warehouse_type='E', 0, SUM(msp.purchase_price_close)) AS stock_value_close"; } */ if ($price_type == 'mat_exp') { $q .= ", IF(jw.warehouse_type='E', SUM(mse.stock_open*mse.mat_exp_open), SUM(msp.stock_open*msp.mat_exp_open)) AS stock_value_open"; $q .= ", IF(jw.warehouse_type='E', SUM(mse.stock_close*mse.mat_exp_close), SUM(msp.stock_close*msp.mat_exp_close)) AS stock_value_close"; } else { $q .= ", IF(jw.warehouse_type='E', 0, SUM(msp.stock_open*msp.purchase_price_open)) AS stock_value_open"; $q .= ", IF(jw.warehouse_type='E', 0, SUM(msp.stock_close*msp.purchase_price_close)) AS stock_value_close"; } $q .= " FROM jng_warehouses jw"; $q .= " LEFT JOIN minierp_stock_elements mse ON mse.jng_warehouses_id=jw.jng_warehouses_id AND mse.stock_period='{$period}'"; $q .= " LEFT JOIN minierp_stock_products msp ON msp.jng_warehouses_id=jw.jng_warehouses_id AND msp.stock_period='{$period}'"; $q .= " GROUP BY jw.jng_warehouses_id"; $q .= " ORDER BY jw.jng_warehouses_id"; $r = tep_db_query($q); $stocks = array(); $s = array(); $s['name'] = 'Warehouse Name'; $s['long_id'] = 'Code'; $s['status'] = 'Type'; $s['price'] = 'Inventory<br />BoP Value'; $s['price2'] = 'Inventory<br />EoP Value'; $s['price3'] = 'Inventory<br />Ave.Value'; $stocks[] = $s; while ($row = tep_db_fetch_array($r)) { $bop = $row['stock_value_open']; $eop = $row['stock_value_close']; $avg = ($bop + $eop) / 2; $s['name'] = $row['name']; $s['long_id'] = $row['warehouse_code']; $s['status'] = $class_jw->typeName($row['warehouse_type']); if ($row['warehouse_type'] == 'E' && $price_type != 'mat_exp') { $s['price'] = '-'; $s['price2'] = '-'; $s['price3'] = '-'; } else { $s['price'] = number_format($bop, 2); $s['price2'] = number_format($eop, 2); $s['price3'] = number_format($avg, 2); } $stocks[] = $s; } $result = tep_draw_table('', $stocks); return $result; }
$row['jg'] = displayCellValue($ss[0]); foreach ($sp_active as $spid => $sp) { $row[$spid] = displayCellValue($ss[$spid]); } $row['total'] = displayCellValue($total_per_period[$p]); $table[] = $row; } $total = array(); $total['date'] = 'TOTAL'; $total['jg'] = displayCellValue($total_weekly[0]); foreach ($sp_active as $spid => $sp) { $total[$spid] = displayCellValue($total_weekly[$spid]); } $total['total'] = displayCellValue($total_total); $table[] = $total; $result = tep_draw_table('summary', $table, false, true); } elseif ($_GET['week-sum'] == 'SALESSUMMARYCHART') { $d = tep_db_prepare_input($_GET['d']); $id = 'graph-sales-sum-l' . $d . 'd'; $result = '<div id="' . $id . '"></div>'; } echo utf8_encode($result); exit; } /* if(isset($_GET['todos'])) { $user_id = ($session_userinfo['group']==1) ? tep_db_prepare_input($_GET['todos']) : $session_userinfo['id']; $todos = $class_td->retrieveList($user_id); $result = $class_td->drawTodoTable($user_id, $todos); echo utf8_encode($result); exit;
<?php $cid = tep_db_prepare_input($_GET['categories_id']); $otto_sp_id = '2'; $spm = getSellingPointMatrix($cid, null, $otto_sp_id); $spm_materials = array('1' => 'Plain Silver', '2' => 'Silver with CZ', '4' => 'Silver with Swarovski', '22' => 'Silver with Enamel', '17' => 'Plain Gold', '17-2' => 'Gold with CZ', '17-4' => 'Gold with Swarovski', '17-22' => 'Gold with Enamel'); $spm_table = array(); $spm_row = array(); $spm_row['id'] = 'No'; $spm_row['long_id'] = 'Material ID'; $spm_row['name'] = 'Material Name'; $spm_row['desc'] = 'Selling Points'; $spm_table[] = $spm_row; $spm_no = 0; foreach ($spm_materials as $spm_mat_id => $spm_mat_name) { $spm_no++; $spm_list = explode(';', $spm[$spm_mat_id]); $spm_text = '<ul>'; foreach ($spm_list as $spl) { $spm_text .= '<li>' . $spl . '</li>'; } $spm_text .= '</ul>'; $spm_row = array(); $spm_row['id'] = $spm_no; $spm_row['long_id'] = $spm_mat_id; $spm_row['name'] = $spm_mat_name; $spm_row['desc'] = $spm_text; $spm_table[] = $spm_row; } $content .= tep_draw_table('', $spm_table); $title = 'Selling Points Matrix for ' . $product_categories_name[$cid];
return $element_list; } $elist_non_outsourse = runElementQuery('0'); $elist_outsourse = runElementQuery('1'); $headers = array(); $headers['id'] = 'ID'; $headers['image'] = 'Image'; $headers['stock'] = 'Current Stock (Pieces)'; $headers['order'] = 'Open Orders (Pieces)'; foreach ($all_period as $p) { $headers[$p] = date('M', strtotime("2013-{$p}-1")) . ' in Qty (Pieces)'; } $headers['total'] = 'Total in Qty (Pieces)'; $headers['unitm'] = 'Qty per Unit'; $headers['totalunit'] = 'Total in Unit (Rounded Up)'; $headers['unit'] = 'Unit'; echo '<h2>NON OUTSOURCE PRODUCTS</h2>'; foreach ($elist_non_outsourse as $cid => $elist) { echo '<h3 style="margin-bottom:0;">Elements Category ' . $ecats[$cid] . '</h3>'; array_unshift($elist, $headers); echo tep_draw_table('', $elist); } echo '<div style="clear:both;"> </div>'; echo '<div style="clear:both;"> </div>'; echo '<div style="clear:both;"> </div>'; echo '<h2>OUTSOURCE PRODUCTS</h2>'; foreach ($elist_outsourse as $cid => $elist) { echo '<h3 style="margin-bottom:0;">Elements Category ' . $ecats[$cid] . '</h3>'; array_unshift($elist, $headers); echo tep_draw_table('', $elist); }
$bit['source'] = 'On Stock in DB<br />Before Transaction'; $elup_table[] = $bit; $euh_count = 0; $stock_movement = $cs; foreach ($euh as $h) { $euh_count++; $stock_movement -= $h['stock_add'] > 0 ? $h['stock_add'] : -1 * $h['stock_reduce']; $bit = array(); $bit['sort'] = $euh_count; $bit['date_add'] = date('d.m.Y H:i:s', strtotime($h['transaction_time'])); $bit['qty'] = $h['stock_add'] > 0 ? '+' . $h['stock_add'] : '-' . $h['stock_reduce']; $bit['name'] = $h['info']; $bit['source'] = strval($stock_movement); $elup_table[] = $bit; } $article_stock .= tep_draw_table('spo sticky-tablehead', $elup_table); } else { $article_stock .= '<strong class="red">No update found</strong >'; } } $article_stock .= '</div>'; echo utf8_encode($article_stock); exit; } elseif ($_POST['me_action'] == 'LOADADJUSTSTOCKFORM') { $psid = tep_db_prepare_input($_POST['psid']); $ps = $class_pm->stockRetrieveDetailByPSID($psid); $bbro = $class_pm->productsBookedCount($ps['jng_warehouses_id'], $ps['products_id'], $ps['articles_id']); $stock_total = $ps['stock'] + $bbro; $adjustform = '<div class="float-box ui-corner-all">'; $adjustform .= '<h3>Adjust On Stock Total</h3>'; $adjustform .= '<div class="smallText red" style="width:180px;margin-bottom:10px;"><strong>Important:</strong><br />Before comparing manobo stock total and actual physical stock please make sure that all daily logistic processes are closed and all Easylog Export files are uploaded to Manobo!</div>';
if ($customer_id != 0) { $order['id'] = ' '; } $orders[1]['orders_id'] = ' '; $orders[1]['orders_date'] = ' '; if ($customer_id == 0) { $orders[1]['customers'] = ' '; } $orders[1]['delivery_to'] = ' '; $orders[1]['status'] = ' '; $orders[1]['payment_method'] = ' '; $orders[1]['paid_status'] = ' '; $orders[1]['source'] = ' '; $orders[1]['amount'] = ' '; } $content = tep_draw_table('orders', $orders) . $pagelink; $content .= '<div> </div>'; $content .= '<div class="total">Total Sales: ' . number_format($total_sales_page, 2, ',', '.') . ' EUR</div>'; if ($showall_link) { $content .= '<div> </div>'; $content .= '<div><a href="?open=orders&customers_id=' . $customer_id . '&showall=true">Click here to <strong>include all old orders</strong> of ' . $customer_name . '</a></div>'; } if ($customer_id == 0) { $filter_query = tep_db_query("SELECT orders_status_id as id, orders_status_name as name FROM orders_status WHERE language_id=" . LANGUAGEID); $filteroption = '<div class="filteroption"><form name="orders" action="?open=orders" method="post"> Filter By '; $filteroption .= '<select id="filterbytype" name="filterbytype">'; $filteroption .= '<option value="">None</option>'; $filteroption .= '<option value="customers_name">Customers Name</option>'; $filteroption .= '<option value="date_purchased">Order Date</option>'; $filteroption .= '<option value="payment_method">Payment Method</option>'; $filteroption .= '<option value="orders_status">Order Status</option>';
$el_used_lists = array(); foreach ($el_used as $el_id => $data) { $e = new element($el_id); $el_image = ''; if ($e->id != null) { $el_used_lists[] = $el_id; $el_image = webImageWithDetailLink($e->image, IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1, 'Element ' . $e->id, 'img-border'); // $elements_used .= (($elements_used!='') ? "|" : "").$e->id.",".$e->detail['name'].",$el_image,$data[quantity]"; $ht['sp'] = $el_image; $ht['q'] = $e->id; $ht['r'] = $e->detail['name']; $ht['s'] = '<input type="text" style="text-align:center; width:40px;" maxlength="3" id="q-' . $e->id . '" value="' . $data['quantity'] . '" onfocus="$(this).select();"/>'; $htable[] = $ht; } } $loe = tep_draw_table('spo', $htable); $loe .= '<br/><input type="button" id="btn-copy-elements" class="button blue" value="Copy Elements" />'; $loe .= '<input type="hidden" id="el-copy-lists" value="' . implode(",", $el_used_lists) . '" />'; } else { $loe = '<span class="bold red">Elements Used Not Found !</span>'; } $result = array(); $result['loe'] = $loe; ajaxReturn($result); exit; } elseif ($_POST['me_action'] == 'COPYELEMENTS') { $pid_to_applied = tep_db_prepare_input($_POST['pid']); $pid_to_copied = tep_db_prepare_input($_POST['pidcopy']); $el_id_excluded = tep_db_prepare_input($_POST['elidexcluded']); $elidcopy = tep_db_prepare_input($_POST['elidcopy']); $qtycopy = tep_db_prepare_input($_POST['qtycopy']);
$table[] = $header; $row_template = '<tr id="id-{ID1}" class="{ODDEVEN}">'; $row_template .= '<td class="img">' . webImage('', '80', '80') . '</td>'; $row_template .= '<td class="id"><a href="?open=element&id={ID2}&hidemenu=true" class="view_webpage">{ID3}</a></td>'; $row_template .= '<td colspan="' . (count($header) - 2) . '" class="load"> </td>'; $row_template .= '</tr>'; $content .= '<div style="width:740px;">'; $content .= '<div style="width:670px;">'; $content .= '<div style="float:right;text-align:right;"><form name="sort" action="?open=element-list-weeklysold" method="post">'; $content .= '<input type="hidden" name="me_action" value="SORTLIST" />'; $content .= $sort_combo; $content .= '</form></div>'; $content .= '<div class="buttons-top" style="padding:6px 0;">'; $content .= '<input type="button" id="backtolist" value="Clear Weekly Sold Filter" />'; $content .= '</div>'; $content .= tep_draw_table('proman', $table); $content .= '<div id="showopt" class="bold">'; $content .= '<div id="showmore">» Show <span class="show">' . $show_amount . '</span> more out of <span class="more"></span></div>'; $content .= '<div id="showall">» Show ALL (<span class="more"></span>)</div>'; $content .= '</div>'; $content .= '</div>'; $javascript = ' var current_pos = 0; var show_amount = ' . $show_amount . '; var colids = new Array(' . implode(',', $listofids) . '); function rowDeleted(target_id, txtStatus) { if(txtStatus=="success") { $("#id-"+target_id).fadeOut(fadeSpeed); } } function rowLoaded(htmlResult, txtStatus) {
$table = array(); $header = array(); $header['d'] = 'Day'; $header['i'] = 'Lead Time'; $header['t'] = 'Total Orders'; $table[] = $header; foreach ($orders_dailly_leadtime as $period => $lt) { $total_orders = count($lt); $row = array(); $row['d'] = substr($period, -2) . '.' . substr($period, 4, 2) . '.' . substr($period, 0, 4); $row['i'] = displayDuration(array_sum($lt) / $total_orders); $row['t'] = $total_orders; //.'<br />'.implode(',', $orders_daily[$period]); $table[] = $row; } $daily_table = count($table) > 1 ? tep_draw_table('spo', $table) : ''; if (isset($_POST['me_action']) && $_POST['me_action'] == 'RELOAD') { echo utf8_encode($average_leadtime_text); echo utf8_encode($daily_table); exit; } $content .= '<div class="notice" style="margin:-15px 0 20px 0;">Average time of SP orders from set to <strong>"Production"</strong> until shipped <strong>"to HH"</strong> (namechains are excluded).</div>'; $content .= '<div class="bold">Period</div>'; $content .= '<div style="margin:5px 0 20px 0;">'; $content .= ' <input type="text" class="date_picker" id="start_date" value="' . $start_date . '" />'; $content .= ' <input type="text" class="date_picker" id="end_date" value="' . $end_date . '" />'; $content .= '</div>'; $content .= '<div id="leadtime">'; $content .= $average_leadtime_text; $content .= $daily_table; $content .= '</div>';
function retrieveOverview($page = 1, $filterby = "", $sortby = "") { $row_per_page = ROWPERPAGE; $offset = ($page - 1) * $row_per_page; $limit_query = "LIMIT {$row_per_page} OFFSET {$offset}"; $filter_query = $filterby == "" ? "" : "WHERE {$filterby}"; $sort_query = $sortby == "" ? "" : "ORDER BY {$sortby}"; $q_total = tep_db_query("SELECT COUNT(log_id) AS total FROM payone_log {$filter_query}"); $r_total = tep_db_fetch_array($q_total); $total_rows = $r_total['total']; $q = tep_db_query("SELECT * FROM payone_log {$filter_query} {$sort_query} {$limit_query}"); $logs = array(); while ($row = tep_db_fetch_array($q)) { $logs[] = $row; } $result = ''; if (count($logs) == 0) { $result .= 'No Log Data Found'; } else { $table = array(); $t = array(); $t['id'] = 'ID'; $t['e'] = 'TXID'; $t['a'] = 'Time'; $t['id1'] = 'Process'; $t['id2'] = 'Method'; $t['id3'] = 'Mode'; $t['s'] = 'Status'; $table[] = $t; foreach ($logs as $l) { $log_time = date('d.m.y H:i', strtotime($l['log_process_time'])); $log_process = '<span class="' . ($l['log_process'] == 'S' ? 'green">Submit' : 'blue">Receive') . '</span>'; $request = unserialize($l['log_process_data_submit']); $response = strlen($l['log_process_data_result']) <= 4 ? $l['log_process_data_result'] : unserialize($l['log_process_data_result']); if ($response == "TSOK") { $response = array("status" => "TSOK"); } $mode = '<span class="' . (strtolower($request['mode']) == 'live' ? 'bold' : '') . '">' . $request['mode'] . '</span>'; $status = '<img src="/images/icon-' . ($response['status'] == "TSOK" || $response['status'] == 'APPROVED' || $response['status'] == 'REDIRECT' ? 'yes' : 'no') . '.png" title="' . $response['status'] . '" />'; $t['id'] = $l['log_id']; $t['e'] = isset($request['txid']) && $request['txid'] != '' ? $request['txid'] : '-'; $t['a'] = $log_time; $t['id1'] = $log_process; $t['id2'] = $l['log_process_method']; $t['id3'] = $mode; $t['s'] = $status; $table[] = $t; } $result .= tep_draw_table('spo', $table); $result .= tep_paging($total_rows, $page, '?open=payone-logger&page='); } return $result; }
/** * Create widget of Actual Silver and Gold Price * @return string */ function widgetActualGoldSilverPrice() { $box = '<div id="widget-gold-silver-price" class="ui-corner-all">'; $i_info = '<small>'; //$i_info .= '<strong>Manobo Current Rate:</strong>'; //$i_info .= '<br/>» 1 EUR = ' . displayCurrency('IDR', convertCurrency(1, 'EUR', 'IDR')); //$i_info .= '<br/>» 1 USD = ' . displayCurrency('IDR', convertCurrency(1, 'USD', 'IDR')); //$i_info .= '<br/>» 1 USD = ' . displayCurrency('EUR', convertCurrency(1, 'USD', 'EUR')); $i_info .= '1 ounce = 31.1 gram'; $i_info .= '</small>'; $box .= '<span class="ui-icon ui-icon-info help float-right" title="' . $i_info . '"></span>'; $box .= '<h3>Gold and Silver Actual Price</h3>'; $row = array(); $row['k tac w200'] = 'Carat'; $row['u tac'] = 'USD<sub><small>/gram</small></sub>'; $row['e tac'] = 'EUR<sub><small>/gram</small></sub>'; $table[] = $row; //Draw 925 Silver Prices $sign = ''; $sign_title = ''; $silver_price_data = getGoldSilverPriceData(); $silver_price_data_ounce = getGoldSilverPriceData('ounce'); if ($silver_price_data['price'] > $silver_price_data['price_old']) { $sign = 'icon-value-increase.gif'; $sign_title = 'Increase ' . displayCurrency('USD /ounce', $silver_price_data_ounce['price'] - $silver_price_data_ounce['price_old']); } elseif ($silver_price_data['price'] < $silver_price_data['price_old']) { $sign = 'icon-value-decrease.gif'; $sign_title = 'Decrease ' . displayCurrency('USD /ounce', $silver_price_data_ounce['price_old'] - $silver_price_data_ounce['price']); } if ($sign != '') { $sign = '<img title="' . $sign_title . '" src="images/' . $sign . '" /> '; } $silver_price_usd = number_format($silver_price_data['price'], 2); $silver_price_eur = number_format(convertCurrency($silver_price_data['price'], 'USD', 'EUR'), 2); $row = array(); $row['k tac'] = $sign . '<a style="color:#000;" target="_blank" title="' . $silver_price_data_ounce['price'] . ' USD /ounce" href="http://www.gold.de/silberkurs-silberpreis.html">925</a>'; $row['u tac'] = $silver_price_usd; $row['e tac'] = $silver_price_eur; $table[] = $row; //Draw 24K Gold Prices $sign = ''; $sign_title = ''; $gold_price_data = getGoldSilverPriceData('gram', true); $gold_price_data_ounce = getGoldSilverPriceData('ounce', true); if ($gold_price_data['price'] > $gold_price_data['price_old']) { $sign = 'icon-value-increase.gif'; $sign_title = 'Increase ' . displayCurrency('USD /ounce', $gold_price_data_ounce['price'] - $gold_price_data_ounce['price_old']); } if ($gold_price_data['price'] < $gold_price_data['price_old']) { $sign = 'icon-value-decrease.gif'; $sign_title = 'Decrease ' . displayCurrency('USD /ounce', $gold_price_data_ounce['price_old'] - $gold_price_data_ounce['price']); } if ($sign != '') { $sign = '<img title="' . $sign_title . '" src="images/' . $sign . '" /> '; } $gold_price_usd = number_format($gold_price_data['price'], 2); $gold_price_eur = number_format(convertCurrency($gold_price_data['price'], 'USD', 'EUR'), 2); $row = array(); $row['k tac w150'] = $sign . '<a style="color:#000;" target="_blank" title="' . $gold_price_data_ounce['price'] . ' USD /ounce" href="http://www.gold.de/goldkurs-goldpreis.html">1000 <small>(24K)</small></a>'; $row['u tac w100'] = $gold_price_usd; $row['e tac w100'] = $gold_price_eur; $table[] = $row; $gold_price_per_carat = $gold_price_data['price'] / 24; //Draw 14K/585 Gold Prices $gold_price_585 = $gold_price_per_carat * 14; $gold_price_585_usd = number_format($gold_price_585, 2); $gold_price_585_eur = number_format(convertCurrency($gold_price_585, 'USD', 'EUR'), 2); $row = array(); $row['k tac w150'] = $sign . '<a style="color:#000;" target="_blank" title="' . $gold_price_data_ounce['price'] . ' USD /ounce" href="http://www.gold.de/goldkurs-goldpreis.html">585 <small>(14K)</small></a>'; $row['u tac w100'] = $gold_price_585_usd; $row['e tac w100'] = $gold_price_585_eur; $table[] = $row; //Draw 9K/375 Gold Prices $gold_price_375 = $gold_price_per_carat * 9; $gold_price_375_usd = number_format($gold_price_375, 2); $gold_price_375_eur = number_format(convertCurrency($gold_price_375, 'USD', 'EUR'), 2); $row = array(); $row['k tac w150'] = $sign . '<a style="color:#000;" target="_blank" title="' . $gold_price_data_ounce['price'] . ' USD /ounce" href="http://www.gold.de/goldkurs-goldpreis.html">375 <small>(9K)</small></a>'; $row['u tac w100'] = $gold_price_375_usd; $row['e tac w100'] = $gold_price_375_eur; $table[] = $row; $box .= tep_draw_table('', $table); $box .= '</div>'; return $box; }
echo '<h3>Payment Status</h3>'; $q = "SELECT jo.order_id, jo.order_date, jo.shipment_date" . ", pi.invoice_amount AS original_invoice_amount" . ", SUM(receipt_amount) AS total_payment" . ", MAX(receipt_received) AS last_payment_date" . " FROM jng_sp_orders jo" . " LEFT JOIN payone_invoice pi ON pi.invoice_order_type='S' AND pi.invoice_order_id=jo.jng_sp_orders_id" . " LEFT JOIN payone_receipt pr ON pr.invoice_id=pi.invoice_id" . " {$filter}" . " GROUP BY jo.jng_sp_orders_id"; $r = tep_db_query($q); $paid_orders = array(); while ($row = tep_db_fetch_array($r)) { if (count($paid_orders) == 0) { $header_raw = array_keys($row); $header = array(); foreach ($header_raw as $k => $v) { $header[$k + 1] = $v; } $paid_orders[] = $header; } $paid_orders[] = $row; } echo tep_draw_table('', $paid_orders); exit; } //Block 0 - Get total orders $to_q = tep_db_query("SELECT COUNT(jo.jng_sp_orders_id) AS total FROM jng_sp_orders jo {$filter}"); $to_r = tep_db_fetch_array($to_q); $total_orders = $to_r['total']; //Block 1 - Get ordered products $ta_q = tep_db_query("SELECT SUM(joi.order_quantity) AS total_qty, SUM(joi.order_quantity*joi.price) AS total_price\n FROM jng_sp_orders jo\n INNER JOIN jng_sp_orders_items joi ON joi.jng_sp_orders_id=jo.jng_sp_orders_id\n {$filter}"); $ta_r = tep_db_fetch_array($ta_q); $total_amount_qty = round($ta_r['total_qty']); $total_amount_price = $ta_r['total_price']; $total_amount_price_net = $total_amount_price / (1 + VAT); //Block 2 - Canceled products $tc_q = tep_db_query("SELECT SUM(joi.order_quantity) AS total_qty, SUM(joi.order_quantity*joi.price) AS total_price\n FROM jng_sp_orders jo\n INNER JOIN jng_sp_orders_items joi ON joi.jng_sp_orders_id=jo.jng_sp_orders_id \n {$filter_cancelations}"); $tc_r = tep_db_fetch_array($tc_q);