<?php use_class('customers_special_list'); $class_csl = new customers_special_list(); $type = isset($_GET['type']) ? tep_db_prepare_input($_GET['type']) : ''; if ($type == '') { exit; } $typename = $class_csl->getTypeName($type); //AJAX ACTION if (isset($_POST['me_action'])) { if ($_POST['me_action'] == 'SEARCHCUSTOMER') { $keywords = tep_db_prepare_input(utf8_decode($_POST['keywords'])); $keywords = strtolower(trim($keywords)); $result = ''; if ($keywords == '') { $result .= '<h3 class="red">Please enter keywords</h3>'; } else { $customers = $class_csl->getCustomersToAdd($keywords); if (count($customers) == 0) { $result .= '<h3 class="red">No Customers found for this keywords</h3>'; } else { $table = array(); $t = array(); $t['d'] = 'ID'; $t['c'] = 'Name'; $t['a'] = 'Action'; $table[] = $t; $keywords_array = explode(' ', $keywords); foreach ($customers as $c) { $cname = strtolower($c['customers_name']);
} $comment = 'Order is revived due to late payment'; $class_o->updateOrderStatus($order_id, '1', $comment); $result = '<h3 class="green">REVIVE Successfully!</h3><div><a href="">Click here to refresh Order detail and view changes</a></div>'; if ($any_deletion_failed) { $result .= '<div class="red">However, some Commissions cancellation are already reported to Partner, this products is not reviveable.</div>'; } } } echo utf8_encode($result); exit; } elseif ($_POST['me_action'] == 'UPDATECUSTOMERSPECIALLIST') { $customers_id = tep_db_prepare_input($_POST['customers_id']); $status = tep_db_prepare_input($_POST['status']); $class_csl->addCustomer($status, $customers_id); $messagebox->add('Successfully set this customer as a ' . $class_csl->getTypeName($status) . ' Customer', 'green'); $openspeciallistdetail = true; } elseif ($_POST['me_action'] == 'CHANGEEMAILADDRESS') { $order_id = tep_db_prepare_input($_POST['order_id']); $old_email = tep_db_prepare_input($_POST['old_email']); $new_email = tep_db_prepare_input($_POST['new_email']); if (tep_validate_email($new_email)) { $class_o->updateEmailAddress($order_id, $old_email, $new_email, $session_userinfo['username']); $result = 'OK'; } else { $result = 'FAIL'; } echo utf8_encode($result); exit; } elseif ($_POST['me_action'] == 'REFRESHORDERTOTAL') { $order_id = tep_db_prepare_input($_POST['order_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); $content = ''; //LEFT COLUMN
$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" />'; $content .= '<input type="button" class="red" name="V" Value="VIP" title="Move customer to VIP list" />';
<?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) {