} */ if ($customer_id != 0 && !isset($customer_name)) { $customer_name = $row['customers_name']; $customer_id = $row['customers_id']; $customer_email = $row['customers_email_address']; } if ($customer_id != 0) { $order['id'] = $row['customers_order_count']; } $order['orders_id'] = '<a href="?open=order&id=' . $row['orders_id'] . '" title="View Order Detail">' . $row['orders_no'] . '</a>'; $order_date = strtotime($row['date_purchased']); $order['orders_date'] = '<div title="' . date("H:i ", $order_date) . '">' . date("d-M-y", $order_date) . '</title>'; if ($customer_id == 0) { //$order['customers'] = '<a href="?open=orders&customers_id='.$row['customers_id'].'&hidemenu=true" class="view_webpage" title="Show all orders of '.$row['customers_name'].'">'.$row['customers_name'].'</a> <sup>'.$row['customers_order_count'].'</sup>'; $cust = $class_csl->getTypeSymbol($row['list_type'], $row['customers_id']); $cust .= '<a href="?open=customer&id=' . $row['customers_id'] . '&hidemenu=true" class="view_webpage" title="View Customer Detail">' . $row['customers_name'] . '</a> <sup>' . $row['customers_order_count'] . '</sup>'; $order['customers'] = $cust; } //if($row['customers_name']==$row['delivery_name']) $order['delivery_to'] = ''; //else $order['delivery_to'] = "<strong>$row[delivery_name]</strong><br />"; $order['delivery_to'] = "{$row['delivery_city']}, {$row['delivery_country']}"; $class = $row['orders_status'] == '6' ? 'class="hl_red"' : ''; $status = '<div style=""' . $class . '>' . $row['orders_status_name'] . '</div>'; $order['status'] = $status; if ($row['rent_status'] == '1') { $order['payment_method'] = 'Rent Option'; } else { if ($row['payment_method'] == 'Direct debiting') { $order['payment_method'] = '<abbr title="Direct debiting">DD</abbr>'; } elseif ($row['payment_method'] == 'Internet Transfer or Direct Bank') {
$orders = $class_o->searchBanktransferOrders($search_field, $search_keywords, "o.date_purchased>DATE('{$date_filter}')"); $result = ''; $table = array(); if (count($orders) > 0) { $t = array(); $t['d'] = 'Date'; $t['c'] = 'Customer'; $t['o'] = 'Order No'; $t['i'] = 'Bank Info'; $t['p'] = 'Order Value'; $t['t'] = 'Withdrawal Date'; $table[] = $t; foreach ($orders as $row) { $order_date = strtotime($row['date_purchased']); $customer_special = $class_csl->getCustomerDetail($row['customers_id']); $crown_img = is_null($customer_special) ? '' : $class_csl->getTypeSymbol($customer_special['list_type'], $row['customers_id']); $t = array(); $t['d'] = date('d-M-y', $order_date); $t['c'] = $crown_img . ' <a href="?open=customer&id=' . $row['customers_id'] . '" target="_blank" title="View Customer Detail" >' . $row['customers_name'] . '</a> <sup>' . $row['customers_order_count'] . '</sup>'; $t['o'] = '<a href="?open=order&id=' . $row['orders_id'] . '" target="_blank" title="View Order Detail">' . $row['orders_no'] . '</a>'; $bank_name = $row['banktransfer_bankname']; $max_bank_chars = 40; if (strlen($bank_name) > $max_bank_chars) { $bank_name = substr($bank_name, 0, $max_bank_chars - 3) . '...'; } $bank_info = array(); $bank_info[] = 'No: ' . $row['banktransfer_number']; $bank_info[] = '<strong>Owner: ' . $row['banktransfer_owner'] . '</strong>'; $bank_info[] = 'Bank: ' . $bank_name; $t['i'] = implode('<br />', $bank_info); $t['p'] = displayCurrency($row['currency'], $row['total_value']);
$redirect_link .= "&opid=" . $order_code; } header($redirect_link); exit; } $invoice = new payone_invoice(); $invoice->retrieveDetail('J', $order_id); $order_int_comments = $class_o->retrieveComments($order_id); $returns = $class_o->retrieveProductsReturned($order_id); $order_currency = $order['currency']; $order_status = $order['orders_status']; $customer_id = $order['customers_id']; $order_sl_type = ''; $order_sl_icon = ''; if ($order['list_type'] != '') { $crown_img = $class_csl->getTypeSymbol($order['list_type'], $order['customers_id']); $order_sl_icon = $crown_img . ' '; $order_sl_type = $class_csl->getTypeName($order['list_type']); if ($order_sl_type != '') { $order_sl_type = ' (' . $order_sl_type . ')'; } } $customer_address = '<strong>' . ($order['customers_company'] == '' ? '' : "{$order['customers_company']}<br />") . $order['customers_name'] . '</strong>'; $customer_address .= '<br />' . "{$order['customers_street_address']}<br />{$order['customers_postcode']} {$order['customers_city']}<br />{$order['customers_country']}"; $delivery_address = '<strong>' . ($order['delivery_company'] == '' ? '' : "{$order['delivery_company']}<br />") . $order['delivery_name'] . '</strong>'; $delivery_address .= '<br />' . "{$order['delivery_street_address']}<br />{$order['delivery_postcode']} {$order['delivery_city']}<br />{$order['delivery_country']}"; $billing_address = '<strong>' . ($order['billing_company'] == '' ? '' : "{$order['billing_company']}<br />") . $order['billing_name'] . '</strong>'; $billing_address .= '<br />' . "{$order['billing_street_address']}<br />{$order['billing_postcode']} {$order['billing_city']}<br />{$order['billing_country']}"; //TOP OPENER $content .= '<div class="order-top">'; $content .= '<table border="0" cellpadding="0" cellspacing="0"><tr>';
function drawOrderDisplay($order_type, $order_id, $displaypart = 'ALL', $excludecurrentorderinhistory = true) { //$displaypart = 'ALL' / 'NEW' / 'HISTORY' global $class_do, $class_pm, $class_pa, $class_mc, $class_jo, $class_jc, $class_o, $sp_list; //ORDERED PRODUCTS DISPLAY SETTING $col_limit = 5; //max no of columns $row_limit = 5; //max no of rows $border = '1'; //border width $imgsize = '80'; //image size $padding = '5'; //box padding $margin = '10'; //box margin $po_limit = $col_limit * $row_limit; //max no of products - auto calc $powidth = ceil($col_limit * ($imgsize + 2 * ($border + $padding) + $margin) / 10) * 10; $total_price = 0; if ($order_type == 'SP') { use_class('jng_sp_customers_special'); $csl = new jng_sp_customers_special(); $order = $class_jo->retrieveDetail($order_id); $order_source = $sp_list[$order['jng_sp_id']]['name']; $order_products = $class_jo->retrieveItems($order_id); $customer = $class_jc->retrieveDetail(null, $order['jng_sp_id'], $order['customer_billing_id']); $list_type = $csl->getListType($customer['jng_sp_customers_id']); $cust_crown = $csl->getTypeSymbol($list_type, $customer['jng_sp_customers_id']); $customer_name = $cust_crown . $order['customer_billing_firstname'] . ' ' . $order['customer_billing_lastname']; $customer_address = $order['customer_billing_address']; if ($order['customer_billing_address2'] != '') { $customer_address .= ', ' . $order['customer_billing_address2']; } $customer_address .= ', ' . $order['customer_billing_postcode']; $customer_address .= ' ' . $order['customer_billing_city']; $customer_address .= ', ' . $order['customer_billing_country']; $products_ordered = $class_jc->retrieveOrdersItems($customer['jng_sp_customers_id']); $colname_order_id = 'jng_sp_orders_id'; $colname_items_id = 'jng_sp_orders_items_id'; $colname_order_date = 'order_date'; $colname_order_qty = 'order_quantity'; $colname_return_qty = 'return_quantity'; $colname_products_id = 'products_id'; $colname_products_code = 'article_number'; $colname_articles_id = 'products_articles_id'; $colname_custom_text1 = null; $colname_custom_text2 = null; $colname_custom_image = null; $order_history_display = null; $total_price = getTotalOrderAmount('S', $order_id); } elseif ($order_type == 'JG') { use_class('customers_special_list'); $csl = new customers_special_list(); $order = $class_o->retrieveDetail($order_id); $order_source = 'JULIE&GRACE'; $total_price = getTotalOrderAmount('J', $order_id, $order['currency']); $order_products = $class_o->retrieveProducts($order_id); //$customer = $class_mc->retrieveDetail($order['customers_id']); $list_type = $csl->getListType($order['customers_id']); $cust_crown = $csl->getTypeSymbol($list_type, $order['customers_id']); $customer_name = $cust_crown . $order['customers_name']; $customer_address = ''; if ($order['customers_company'] != '') { $customer_address .= $order['customers_company'] . ', '; } $customer_address .= $order['customers_street_address']; $customer_address .= ', ' . $order['customers_postcode']; $customer_address .= ' ' . $order['customers_city']; $customer_address .= ', ' . $order['customers_country']; $products_ordered = $class_mc->retrieveOrdersProducts($order['customers_id'], 'op.status>0'); $colname_order_id = 'orders_id'; $colname_items_id = 'orders_products_id'; $colname_order_date = 'date_purchased'; $colname_order_qty = 'products_quantity'; $colname_return_qty = 'return_quantity'; $colname_products_id = 'products_id'; $colname_products_code = 'products_model'; $colname_articles_id = 'products_articles_id'; $colname_custom_text1 = 'customers_text_line1'; $colname_custom_text2 = 'customers_text_line2'; $colname_custom_image = 'customers_image'; $order_history_display = null; } elseif ($order_type == 'DP') { $order = $class_do->retrieveDetail($order_id); $product_detail = $class_pm->retrieveDetail($order['products_id'], 'p'); $order['products_image'] = $product_detail['p']['products_image']; $order['products_model'] = $product_detail['p']['products_model']; $order['order_item_count'] = '1'; $order['order_item_total'] = '1'; $order_products = array(); $order_products[] = $order; $colname_order_id = 'depot_orders_id'; $colname_items_id = 'depot_orders_id'; $colname_order_date = 'order_date'; $colname_order_qty = 'quantity'; $colname_return_qty = ''; $colname_products_id = 'products_id'; $colname_products_code = 'products_model'; $colname_articles_id = 'articles_id'; $colname_custom_text1 = null; $colname_custom_text2 = null; $colname_custom_image = null; if ($order['trans_type'] == 'SP' || $order['trans_type'] == 'JG') { if ($order['trans_type'] == 'SP') { $item = $class_jo->retrieveItemDetail($order['trans_id']); //if ($item['jng_sp_id'] != '2') { //echo "<pre>"; //var_dump($item); //die("ttt"); if ($item['stock_status'] == '0') { $order_history_display = drawOrderDisplay($order['trans_type'], $item['jng_sp_orders_id'], 'HISTORY', false); } $total_price = getTotalOrderAmount('S', $item['jng_sp_orders_id']); //} } else { //die("test"); $item = $class_o->retrieveProductDetail($order['trans_id']); $total_price = getTotalOrderAmount('J', $item['orders_id']); if ($item['stock_status'] == '0') { $order_history_display = drawOrderDisplay($order['trans_type'], $item['orders_id'], 'HISTORY', false); } } } } $result = ''; if ($displaypart == 'ALL' || $displaypart == 'NEW') { //NEW ORDER $result .= '<h2 style="position:fixed;top:0;left:0;line-height:20px;width:480px;padding:5px 10px;background:#ccc;border-right:1px inset #666;">New ' . $order_type . ' Order ' . $order_id . ' (' . $total_price . ')</h2>'; //$result .= '<div style="position:fixed;top:30;bottom:0;left:0;width:480px;padding:10px;background:#efefef;border-right:1px inset #666;overflow:auto;">'; $result .= '<div id="box-order-items" style="position:fixed;top:30;bottom:0;height:93%;left:0;width:480px;padding:10px;background:#efefef;border-right:1px inset #666;overflow:auto;">'; $neworder = array(); $no = array(); $no['l'] = 'No'; $no['d'] = 'Image'; $no['t2'] = 'Info'; $no['q'] = 'Order<br/>Qty.'; $no['r'] = 'Stock Status<br /> and Actions'; $neworder[] = $no; foreach ($order_products as $op) { if ($op[$colname_articles_id] > 0) { $article = $class_pa->retrieveDetail($op[$colname_articles_id]); $prolength = $article['length']; } else { $product_detail = $class_pm->retrieveDetail($op[$colname_products_id], 'pnc'); $prolength = $product_detail['pnc']['products_length']; } $customize_info = ''; if (!is_null($colname_custom_text1) && !is_null($colname_custom_text2)) { if ($op[$colname_custom_text1] != '' || $op[$colname_custom_text2] != '') { $customize_info .= '<div style="margin-top:10px;">'; if ($op[$colname_custom_text1] != '') { $customize_info .= $op[$colname_custom_text1]; } if ($op[$colname_custom_text2] != '') { $customize_info .= '<br />' . $op[$colname_custom_text2]; } $customize_info .= '</div>'; } } if (!is_null($colname_custom_image) && $op[$colname_custom_image] != '') { $customize_info .= webImage($op[$colname_custom_image], '80', '80', 'Custom Image'); } $length_text = $prolength > 0 ? 'Length: ' . textLength($prolength) : '<span class="notice">No Length</span>'; //$tooltip_data = getTooltipThumbData($op[$colname_products_id], $op[$colname_articles_id], 0); $pdata = $class_pm->retrieveDetail($op[$colname_products_id], 'pl,sp'); $tooltip_text = '<table class="tiny" border="0" cellpadding="0" cellspacing="0" align="center">'; $tooltip_text .= '<tr><td width="80" title="Sold Last 30 Days">Sold L30D</td><td>' . intval($pdata['pl']['sold_monthly_1']) . ' products</td></tr>'; $tooltip_text .= '<tr><td>Total sold</td><td>' . intval($pdata['sp']['0']['total_sold']) . ' products</td></tr>'; $tooltip_text .= '<tr><td>Return Rate</td><td>' . number_format($pdata['sp']['0']['returned_rate'], 1) . '%</td></tr>'; $tooltip_text .= '<tr><td>Product Age</td><td>' . $pdata['sp']['0']['active_age'] . ' days</td></tr>'; $tooltip_text .= '</table>'; $info = array(); //var_dump($order_type); $info[] = $order_type . '-' . $op[$colname_items_id]; $info[] = $op['products_ean']; $info[] = $op[$colname_products_id] . ' / ' . $op[$colname_products_code]; $info[] = $length_text; $info[] = ' '; $info[] = '<strong>All SP Summary</strong>'; $info[] = $tooltip_text; $action_hidden = '<input type="hidden" id="' . $order_type . '-' . $op[$colname_items_id] . '" name="oiid" value="' . $op[$colname_items_id] . '" />'; $action_hidden .= '<input type="hidden" name="type" value="' . $order_type . '" />'; $action = array(); $action[] = stockStatusDisplay($op['stock_status'], $op['status'], $op[$colname_products_id], $op[$colname_articles_id], $op[$colname_order_qty], null); $action[] = ' '; if ($op['stock_status'] == 'S') { $action[] = '<input type="button" name="2" value="» Sourcing" class="bl green" />'; } elseif ($op['stock_status'] == 'R' || $op['stock_status'] == 'P' || $op['stock_status'] == 'W') { $action[] = '<input type="button" name="3" value="» Ready" class="bl green" />'; //$action[] = '<input type="button" name="test" value="» Sourcing" class="bl red" />'; } $action[] = '<input type="button" name="10" value="× Cancel" class="bl red" />'; $no = array(); $no['l'] = $op['order_item_count'] . '/' . $op['order_item_total']; $no['d'] = webImage($op['products_image'], '80', '80', 'Product Image') . $customize_info; $no['t2'] = implode('<br />', $info); if (isset($op['order_quantity'])) { $order_quantity = $op['order_quantity']; } elseif (isset($op['products_quantity'])) { $order_quantity = $op['products_quantity']; } else { $order_quantity = $op['quantity']; } $no['q'] = $order_quantity; $no['r'] = $action_hidden . implode('<br />', $action); $neworder[] = $no; } $result .= tep_draw_table('spo', $neworder); $result .= '<div class="buttons"><input type="button" name="nextorder" value="Next Order" class="button" /></div>'; $result .= '</div>'; //NEW ORDER - CLOSER } if (!is_null($order_history_display)) { $result .= $order_history_display; } elseif ($displaypart == 'ALL' || $displaypart == 'HISTORY') { $result .= '<div style="margin-left:510px;color:#666;" >'; //HISTORICAL INFO if ($order_type == 'DP') { $result .= '<h2>DEPOT ' . ($order['trans_type'] == 'AR' ? 'REFILL' : 'MANUAL ORDER') . '</h2>'; } else { //var_dump($order_type); $result .= '<h2>Customer Detail</h2>'; // $result .= '<table border="0" cellpadding="0" cellspacing="0">'; // $result .= '<tr><td width="150">Customer From</td><td>'.$order_source.'</td></tr>'; // $result .= '<tr><td>Customer Name</td><td>'.$customer_name.'</td></tr>'; // $result .= '<tr><td>Customer Address</td><td>'.$customer_address.'</td></tr>'; // $result .= '<tr><td></td><td></td></tr>'; // $result .= '</table>'; $result .= '<div class="bold">' . $order_source . '</div>'; $result .= '<div>' . $customer_name . '</div>'; $result .= '<div>' . $customer_address . '</div>'; $result .= '<div> </div>'; $orders_collection = array(); $products_ordered_total = 0; $products_returned_total = 0; $products_canceled_total = 0; $products_inprocess_total = 0; foreach ($products_ordered as $pok => $pov) { if ($excludecurrentorderinhistory && $pov[$colname_order_id] == $order[$colname_order_id]) { unset($products_ordered[$pok]); } else { if (!in_array($pov[$colname_order_id], $orders_collection)) { $orders_collection[] = $pov[$colname_order_id]; } $products_ordered_total += $pov[$colname_order_qty]; $products_returned_total += $pov[$colname_return_qty]; if (statusIsCancelled($pov['status'])) { $products_canceled_total += $pov[$colname_order_qty]; } if ($pov['status'] < 9) { $products_inprocess_total += $pov[$colname_order_qty]; } } } $result .= '<h2>Customer Historical Info</h2>'; if ($products_ordered_total > 0) { $products_success_total = $products_ordered_total - ($products_inprocess_total + $products_canceled_total); $return_rate = $products_returned_total == 0 ? 0 : $products_returned_total / $products_success_total * 100; $process_class = $products_inprocess_total > 0 ? 'red' : 'green'; $success_class = $products_success_total > 0 ? 'green' : 'red'; $return_class = $products_returned_total > 0 ? 'red' : 'green'; $return_rate_class = $return_rate <= 10 ? 'green' : 'red'; $prevtext = $excludecurrentorderinhistory ? 'Previous' : ''; $result .= '<h3>» Customer ' . $prevtext . ' Orders Total = ' . count($orders_collection) . '</h3>'; $result .= '<h3>» Ordered Products Total = ' . $products_ordered_total . '</h3>'; $result .= '<h3>» Ordered Products Canceled = ' . $products_canceled_total . '</h3>'; $result .= '<h3 class="' . $process_class . '">» Ordered Products in Progress = ' . $products_inprocess_total . '</h3>'; $result .= '<h3 class="' . $success_class . '">» Ordered Products Received = ' . $products_success_total . '</h3>'; $result .= '<h3 class="' . $return_class . '">» Ordered Products Returns = ' . $products_returned_total . '</h3>'; $result .= '<h3 class="' . $return_rate_class . '">» Customer Return Rate = ' . number_format($return_rate, 1) . '%</h3>'; $result .= '<h3>» Recent Ordered Products List (Showing Max ' . $po_limit . ' Products): ' . '</h3>'; $result .= '<div style="width:' . $powidth . 'px;">'; $pocount = 0; foreach ($products_ordered as $po) { $pocount++; if ($pocount <= $po_limit) { if ($po[$colname_articles_id] > 0) { $article = $class_pa->retrieveDetail($po[$colname_articles_id]); $prolength = $article['length']; } else { $product_detail = $class_pm->retrieveDetail($po[$colname_products_id], 'pnc'); $prolength = $product_detail['pnc']['products_length']; } $length_text = $prolength > 0 ? textLength($prolength) : '<span class="notice">No Length</span>'; $status = $po['status'] == '8' ? modeName($po['mode']) : statusNameShort($po['status'], true); $status_class = $po['status'] < 9 ? 'red' : 'notice'; $qty_class = statusIsCancelled($po['status']) > 0 ? 'notice' : 'green'; $result .= '<div style="float:left;border:' . $border . 'px solid #ccc;text-align:center;margin:0 ' . $margin . 'px ' . $margin . 'px 0;padding:' . $padding . 'px;">'; $result .= webImage($po['products_image'], $imgsize, $imgsize); $result .= '<br />'; $result .= $length_text; $result .= '<br />'; $result .= '<span title="Order Date">' . date('d.m.Y', strtotime($po[$colname_order_date])) . '</span>'; $result .= '<br />'; $result .= '<span class="' . $status_class . '" title="Current Status">' . $status . '</span>'; $result .= '<br />'; $result .= '<strong class="' . $qty_class . '" title="Order Quantity">+' . intval($po[$colname_order_qty]) . '</strong>'; $result .= ' '; $returns = intval($po[$colname_return_qty]); $retclas = $returns > 0 ? 'red' : 'notice'; $result .= '<strong class="' . $retclas . '" title="Return Quantity">-' . $returns . '</strong>'; $result .= '</div>'; } } $result .= '</div>'; $result .= '<div style="clear:both;"> </div>'; } else { $result .= '<h3>» No Order Historical info, a New Customer</h3>'; } } $result .= '</div>'; //HISTORICAL INFO - CLOSER } return $result; }
} elseif ($_POST['me_action'] == 'SAVETEXTALERT') { $text_alert = tep_db_prepare_input(utf8_decode($_POST['text_alert'])); $result = $class_csl->updateCustomer($customers_id, 'text_alert', $text_alert); exit; } elseif ($_POST['me_action'] == 'CHANGELISTTYPE') { $new_type = tep_db_prepare_input(utf8_decode($_POST['new_type'])); $result = $class_csl->updateCustomer($customers_id, 'list_type', $new_type); exit; } } //START TEMPLATE $customer = $class_mc->retrieveDetail($customers_id); $customer_info = $class_mc->retrieveDetailInfo($customers_id); $total_orders = $class_mc->retrieveTotalOrders($customers_id); $total_products_ordered = $class_mc->retrieveTotalProductsOrdered($customers_id); $typeimg = $class_csl->getTypeSymbol($detail['list_type']); $typename = $class_csl->getTypeName($detail['list_type']); $content = ''; $content .= '<div style="float:left;width:330px;">'; $content .= '<table border="0" cellpadding="0" cellspacing="0">'; $content .= '<tr><td colspan="2"><h2 style="margin:0"><a href="?open=customer&id=' . $customers_id . '" title="View Customer Detail">' . $customer['customers_firstname'] . ' ' . $customer['customers_lastname'] . '</h2></a></td></tr>'; //$content .= '<tr><td width="110">Source</td><td>'.(($customer_info['dti_referrers_code']=='') ? 'julie-grace.de' : '<strong class="red">'.$customer_info['dti_referrers_code'].'</strong>').'</td></tr>'; //$content .= '<tr><td width="110">Email Address</td><td>'.$customer['customers_email_address'].'</td></tr>'; //$register = strtotime($customer_info['customers_info_date_account_created']); //$last_login = strtotime($customer_info['customers_info_date_of_last_logon']); //if($last_login===false) $last_login = $register; //$content .= '<tr><td>Register Date</td><td>'.date('d M Y H:i:s', $register).'</td></tr>'; //$content .= '<tr><td>Last Login</td><td>'.date('d M Y H:i:s', $last_login).'</td></tr>'; $content .= '<tr><td colspan="2"><div id="btn-mover">'; if ($detail['list_type'] == 'N') { $content .= '<input type="button" class="red" name="B" Value="Blacklist" title="Move customer to Blacklist" />';
} else { $orders_query = tep_db_query("SELECT COUNT(o.orders_id) AS count, SUM(ot.value) AS total FROM orders o INNER JOIN orders_total ot ON ot.orders_id=o.orders_id AND ot.class='ot_total' WHERE o.customers_id={$customer_id} GROUP BY o.customers_id"); $orders = tep_db_fetch_array($orders_query); $has_orders = is_array($orders) && isset($orders['count']); if ($customer['customers_dob'] != '') { $dob = $customer['customers_dob']; $customer['customers_dob'] = substr($dob, 8, 2) . '.' . substr($dob, 5, 2) . '.' . substr($dob, 0, 4); } if ($customer['customers_dob'] == '00.00.0000' || $customer['customers_dob'] == '') { $customer['customers_dob'] = 'dd.mm.yyyy'; } $customer_special = $class_csl->getCustomerDetail($customer_id); $order_sl_type = ''; $order_sl_icon = ''; if (!is_null($customer_special)) { $crown_img = $class_csl->getTypeSymbol($customer_special['list_type'], $customer_id); $order_sl_icon = $crown_img . ' '; $order_sl_type = $class_csl->getTypeName($customer_special['list_type']); if ($order_sl_type != '') { $order_sl_type = ' (' . $order_sl_type . ')'; } } $customer_info = $class_mc->retrieveDetailInfo($customer_id); $customer_profile = $class_mc->retrieveProfile($customer_id); $customer_addresses_query = tep_db_query("SELECT ab.*, c.countries_name FROM address_book ab LEFT JOIN countries c ON c.countries_id=ab.entry_country_id WHERE ab.customers_id={$customer_id}"); $customer_addresses = array(); while ($row = tep_db_fetch_array($customer_addresses_query)) { $customer_addresses[] = $row; } $customer_banktransfer_query = tep_db_query("SELECT * FROM customers_banktransfer WHERE customers_id={$customer_id}"); $customer_banktransfer = tep_db_fetch_array($customer_banktransfer_query);
<?php use_class('customers_special_list'); $class_csl = new customers_special_list(); //AJAX ACTION if (isset($_GET['type'])) { $type = tep_db_prepare_input($_GET['type']); $list = $class_csl->retrieveList($type); $result = ''; $result .= '<h2>'; $result .= $class_csl->getTypeSymbol($type) . ' '; $result .= $class_csl->getTypeName($type) . ' Customers'; $result .= '</h2>'; $result .= '<div style="margin:10px 0 20px 0;">'; if ($type != 'N') { $result .= '<a href="?open=customers-special-list-add&type=' . $type . '&hidemenu=true" class="view_webpage"></a>'; $result .= '<input type="button" class="button" name="addnew" value="Add Customer" onclick="$(this).siblings(\'a\').click();" />'; } else { $result .= '<span class="notice">When removed from Blacklist/VIP list, customer will be moved here so all historical information is not lost</span>'; } $result .= '</div>'; if (count($list) == 0) { $result .= '<h3 class="red">No customer is found</h3>'; } else { $table = array(); $t = array(); $t['d'] = 'ID'; $t['c'] = 'Name'; $t['a'] = 'Action'; $table[] = $t; foreach ($list as $l) {