| 1 | <?php
|
|---|
| 2 | /*-------------------------------------------------------------
|
|---|
| 3 | $Id: orders_listing.php 13852 2021-12-01 09:38:18Z GTB $
|
|---|
| 4 |
|
|---|
| 5 | modified eCommerce Shopsoftware
|
|---|
| 6 | http://www.modified-shop.org
|
|---|
| 7 |
|
|---|
| 8 | Copyright (c) 2009 - 2013 [www.modified-shop.org]
|
|---|
| 9 | --------------------------------------------------------------
|
|---|
| 10 | Released under the GNU General Public License
|
|---|
| 11 | --------------------------------------------------------------*/
|
|---|
| 12 |
|
|---|
| 13 | defined( '_VALID_XTC' ) or die( 'Direct Access to this location is not allowed.' );
|
|---|
| 14 |
|
|---|
| 15 | //display per page
|
|---|
| 16 | $cfg_max_display_results_key = 'MAX_DISPLAY_ORDER_RESULTS';
|
|---|
| 17 | $page_max_display_results = xtc_cfg_save_max_display_results($cfg_max_display_results_key);
|
|---|
| 18 | $sorting = (isset($_GET['sorting']) ? $_GET['sorting'] : '');
|
|---|
| 19 |
|
|---|
| 20 | $customers_statuses_array = xtc_get_customers_statuses();
|
|---|
| 21 |
|
|---|
| 22 | $payment_array = array();
|
|---|
| 23 | $payments_query = xtc_db_query("SELECT payment_class
|
|---|
| 24 | FROM ".TABLE_ORDERS."
|
|---|
| 25 | GROUP BY payment_class
|
|---|
| 26 | ORDER BY payment_class");
|
|---|
| 27 | while ($payments = xtc_db_fetch_array($payments_query)) {
|
|---|
| 28 | $payment_text = $payments['payment_class'];
|
|---|
| 29 | if (is_file(DIR_FS_LANGUAGES . $_SESSION['language'] . '/modules/payment/' . $payments['payment_class'].'.php')) {
|
|---|
| 30 | include_once(DIR_FS_LANGUAGES . $_SESSION['language'] . '/modules/payment/' . $payments['payment_class'].'.php');
|
|---|
| 31 | $payment_text = constant('MODULE_PAYMENT_'.strtoupper($payments['payment_class']).'_TEXT_TITLE');
|
|---|
| 32 | }
|
|---|
| 33 | $payment_array[] = array('id' => $payments['payment_class'], 'text' => $payment_text);
|
|---|
| 34 | }
|
|---|
| 35 | ?>
|
|---|
| 36 |
|
|---|
| 37 | <div class="pageHeadingImage"><?php echo xtc_image(DIR_WS_ICONS.'heading/icon_orders.png'); ?></div>
|
|---|
| 38 | <div class="pageHeading flt-l"><?php echo HEADING_TITLE; ?>
|
|---|
| 39 | <div class="main pdg2"><?php echo TABLE_HEADING_CUSTOMERS ?></div>
|
|---|
| 40 | </div>
|
|---|
| 41 |
|
|---|
| 42 | <div class="main flt-l pdg2 mrg5" style="margin-left:20px;">
|
|---|
| 43 | <?php echo xtc_draw_form('status', FILENAME_ORDERS, '', 'get'); ?>
|
|---|
| 44 | <?php
|
|---|
| 45 | $orders_statuses_array = array();
|
|---|
| 46 | if (defined('ORDER_STATUSES_DISPLAY_DEFAULT') && ORDER_STATUSES_DISPLAY_DEFAULT != '') {
|
|---|
| 47 | $orders_statuses_array[] = array('id' => '-1', 'text' => TEXT_ALL_ORDERS);
|
|---|
| 48 | $orders_statuses_array[] = array('id' => '', 'text' => TEXT_ORDERS_STATUS_FILTER);
|
|---|
| 49 | } else {
|
|---|
| 50 | $orders_statuses_array[] = array('id' => '', 'text' => TEXT_ALL_ORDERS);
|
|---|
| 51 | }
|
|---|
| 52 | $orders_statuses_array[] = array('id' => '0', 'text' => TEXT_VALIDATING);
|
|---|
| 53 | echo HEADING_TITLE_STATUS . ' ' . xtc_draw_pull_down_menu('status', array_merge($orders_statuses_array, $orders_statuses),(isset($_GET['status']) && xtc_not_null($_GET['status']) ? (int)$_GET['status'] : ''),'onchange="this.form.submit();"');
|
|---|
| 54 | ?>
|
|---|
| 55 | <?php echo xtc_draw_hidden_filter_field('cgroup', ((isset($_GET['cgroup'])) ? $_GET['cgroup'] : ''))?>
|
|---|
| 56 | <?php echo xtc_draw_hidden_filter_field('payment', ((isset($_GET['payment'])) ? $_GET['payment'] : ''))?>
|
|---|
| 57 | </form>
|
|---|
| 58 | </div>
|
|---|
| 59 | <div class="main flt-l pdg2 mrg5" style="margin-left:20px;">
|
|---|
| 60 | <?php echo xtc_draw_form('payment', FILENAME_ORDERS, '', 'get'); ?>
|
|---|
| 61 | <?php echo TEXT_INFO_PAYMENT_METHOD . ' ' . xtc_draw_pull_down_menu('payment',array_merge(array (array ('id' => '', 'text' => TXT_ALL)), $payment_array), isset($_GET['payment']) ? $_GET['payment'] : '', 'onChange="this.form.submit();"'); ?>
|
|---|
| 62 | <?php echo xtc_draw_hidden_filter_field('status', ((isset($_GET['status'])) ? $_GET['status'] : ''))?>
|
|---|
| 63 | <?php echo xtc_draw_hidden_filter_field('cgroup', ((isset($_GET['cgroup'])) ? $_GET['cgroup'] : ''))?>
|
|---|
| 64 | </form>
|
|---|
| 65 | </div>
|
|---|
| 66 | <div class="main flt-l pdg2 mrg5" style="margin-left:20px;">
|
|---|
| 67 | <?php echo xtc_draw_form('cgroup', FILENAME_ORDERS, '', 'get'); ?>
|
|---|
| 68 | <?php echo ENTRY_CUSTOMERS_STATUS . ' ' . xtc_draw_pull_down_menu('cgroup',array_merge(array (array ('id' => '', 'text' => TXT_ALL)), $customers_statuses_array), isset($_GET['cgroup']) ? $_GET['cgroup'] : '', 'onChange="this.form.submit();"'); ?>
|
|---|
| 69 | <?php echo xtc_draw_hidden_filter_field('status', ((isset($_GET['status'])) ? $_GET['status'] : ''))?>
|
|---|
| 70 | <?php echo xtc_draw_hidden_filter_field('payment', ((isset($_GET['payment'])) ? $_GET['payment'] : ''))?>
|
|---|
| 71 | </form>
|
|---|
| 72 | </div>
|
|---|
| 73 | <div class="clear"></div>
|
|---|
| 74 |
|
|---|
| 75 | <table class="tableCenter">
|
|---|
| 76 | <tr>
|
|---|
| 77 | <td class="boxCenterLeft">
|
|---|
| 78 | <!-- BOC ORDERS LISTING -->
|
|---|
| 79 | <table class="tableBoxCenter collapse">
|
|---|
| 80 | <tr class="dataTableHeadingRow">
|
|---|
| 81 | <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS.xtc_sorting(FILENAME_ORDERS, 'name'); ?></td>
|
|---|
| 82 | <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDERS_ID.xtc_sorting(FILENAME_ORDERS, 'id'); ?></td>
|
|---|
| 83 | <?php if (defined('MODULE_INVOICE_NUMBER_STATUS') && MODULE_INVOICE_NUMBER_STATUS == 'True') { ?>
|
|---|
| 84 | <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_INVOICE_NUMBER.xtc_sorting(FILENAME_ORDERS, 'invoice'); ?></td>
|
|---|
| 85 | <?php } ?>
|
|---|
| 86 | <td class="dataTableHeadingContent" align="right" style="width:120px"><?php echo TEXT_SHIPPING_TO.xtc_sorting(FILENAME_ORDERS, 'country'); ?></td>
|
|---|
| 87 | <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDER_TOTAL/*.xtc_sorting(FILENAME_ORDERS, 'total')*/; ?></td>
|
|---|
| 88 | <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_PURCHASED.xtc_sorting(FILENAME_ORDERS, 'date'); ?></td>
|
|---|
| 89 | <td class="dataTableHeadingContent" align="center"><?php echo str_replace(':','',TEXT_INFO_PAYMENT_METHOD).xtc_sorting(FILENAME_ORDERS, 'payment'); ?></td>
|
|---|
| 90 | <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS.xtc_sorting(FILENAME_ORDERS, 'status'); ?></td>
|
|---|
| 91 | <?php if (AFTERBUY_ACTIVATED=='true') { ?>
|
|---|
| 92 | <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_AFTERBUY; ?></td>
|
|---|
| 93 | <?php } ?>
|
|---|
| 94 | <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
|
|---|
| 95 | </tr>
|
|---|
| 96 | <?php
|
|---|
| 97 | switch ($sorting) {
|
|---|
| 98 | case 'name':
|
|---|
| 99 | $osort = 'o.customers_name ASC';
|
|---|
| 100 | break;
|
|---|
| 101 | case 'name-desc':
|
|---|
| 102 | $osort = 'o.customers_name DESC';
|
|---|
| 103 | break;
|
|---|
| 104 | case 'id':
|
|---|
| 105 | $osort = 'o.orders_id ASC';
|
|---|
| 106 | break;
|
|---|
| 107 | case 'id-desc':
|
|---|
| 108 | $osort = 'o.orders_id DESC';
|
|---|
| 109 | break;
|
|---|
| 110 | case 'invoice':
|
|---|
| 111 | $osort = 'o.ibn_billnr ASC';
|
|---|
| 112 | break;
|
|---|
| 113 | case 'invoice-desc':
|
|---|
| 114 | $osort = 'o.ibn_billnr DESC';
|
|---|
| 115 | break;
|
|---|
| 116 | case 'country':
|
|---|
| 117 | $osort = 'o.shipping_method ASC';
|
|---|
| 118 | break;
|
|---|
| 119 | case 'country-desc':
|
|---|
| 120 | $osort = 'o.shipping_method DESC';
|
|---|
| 121 | break;
|
|---|
| 122 | // ToDo
|
|---|
| 123 | /*
|
|---|
| 124 | case 'total':
|
|---|
| 125 | $osort = 'ot.value ASC';
|
|---|
| 126 | break;
|
|---|
| 127 | case 'total-desc':
|
|---|
| 128 | $osort = 'ot.value DESC';
|
|---|
| 129 | break;
|
|---|
| 130 | */
|
|---|
| 131 | case 'date':
|
|---|
| 132 | $osort = 'o.date_purchased ASC';
|
|---|
| 133 | break;
|
|---|
| 134 | case 'date-desc':
|
|---|
| 135 | $osort = 'o.date_purchased DESC';
|
|---|
| 136 | break;
|
|---|
| 137 | case 'payment':
|
|---|
| 138 | $osort = 'o.payment_method ASC';
|
|---|
| 139 | break;
|
|---|
| 140 | case 'payment-desc':
|
|---|
| 141 | $osort = 'o.payment_method DESC';
|
|---|
| 142 | break;
|
|---|
| 143 | case 'status':
|
|---|
| 144 | $osort = 'o.orders_status ASC';
|
|---|
| 145 | break;
|
|---|
| 146 | case 'status-desc':
|
|---|
| 147 | $osort = 'o.orders_status DESC';
|
|---|
| 148 | break;
|
|---|
| 149 | default:
|
|---|
| 150 | $osort = 'o.date_purchased DESC';
|
|---|
| 151 | break;
|
|---|
| 152 | }
|
|---|
| 153 |
|
|---|
| 154 | $sort = " ORDER BY ".$osort;
|
|---|
| 155 | $filter = isset($_GET['cgroup']) && $_GET['cgroup'] != '' ? " AND o.customers_status = '" . (int)$_GET['cgroup'] ."'": '';
|
|---|
| 156 | $filter .= isset($_GET['payment']) && $_GET['payment'] != '' ? " AND o.payment_class = '" . xtc_db_input($_GET['payment']) ."'": '';
|
|---|
| 157 | if (isset($_GET['cID'])) {
|
|---|
| 158 | $cID = (int) $_GET['cID'];
|
|---|
| 159 | $orders_query_raw = "SELECT o.*
|
|---|
| 160 | FROM ".TABLE_ORDERS." o
|
|---|
| 161 | WHERE o.customers_id = '".xtc_db_input($cID)."'
|
|---|
| 162 | ".$filter.$sort;
|
|---|
| 163 |
|
|---|
| 164 | } elseif (isset($_GET['status']) && $_GET['status'] == '0') {
|
|---|
| 165 | $orders_query_raw = "SELECT o.*
|
|---|
| 166 | FROM ".TABLE_ORDERS." o
|
|---|
| 167 | WHERE o.orders_status = '0'
|
|---|
| 168 | ".$filter.$sort;
|
|---|
| 169 |
|
|---|
| 170 | } elseif (isset($_GET['status']) && xtc_not_null($_GET['status']) && $_GET['status'] != '-1') {
|
|---|
| 171 | $status = xtc_db_prepare_input($_GET['status']);
|
|---|
| 172 | $orders_query_raw = "SELECT o.*
|
|---|
| 173 | FROM ".TABLE_ORDERS." o
|
|---|
| 174 | WHERE o.orders_status = '".(int)$status."'
|
|---|
| 175 | ".$filter.$sort;
|
|---|
| 176 |
|
|---|
| 177 | } elseif ($action == 'search' && $search && $customer == '') {
|
|---|
| 178 | // ADMIN SEARCH BAR $orders_query_raw moved it to the top
|
|---|
| 179 | } elseif ($action == 'search' && $customer) {
|
|---|
| 180 | $orders_query_raw = "SELECT o.*
|
|---|
| 181 | FROM ".TABLE_ORDERS." o
|
|---|
| 182 | WHERE (o.orders_id LIKE '%".xtc_db_input($customer)."%'
|
|---|
| 183 | OR o.customers_email_address LIKE '%".xtc_db_input($customer)."%'
|
|---|
| 184 | OR o.customers_name LIKE '%".xtc_db_input($customer)."%'
|
|---|
| 185 | OR o.customers_firstname LIKE '%".xtc_db_input($customer)."%'
|
|---|
| 186 | OR o.customers_lastname LIKE '%".xtc_db_input($customer)."%'
|
|---|
| 187 | OR o.customers_company LIKE '%".xtc_db_input($customer)."%'
|
|---|
| 188 | OR o.delivery_name LIKE '%".xtc_db_input($customer)."%'
|
|---|
| 189 | OR o.delivery_firstname LIKE '%".xtc_db_input($customer)."%'
|
|---|
| 190 | OR o.delivery_lastname LIKE '%".xtc_db_input($customer)."%'
|
|---|
| 191 | OR o.delivery_company LIKE '%".xtc_db_input($customer)."%'
|
|---|
| 192 | OR o.billing_name LIKE '%".xtc_db_input($customer)."%'
|
|---|
| 193 | OR o.billing_firstname LIKE '%".xtc_db_input($customer)."%'
|
|---|
| 194 | OR o.billing_lastname LIKE '%".xtc_db_input($customer)."%'
|
|---|
| 195 | OR o.billing_company LIKE '%".xtc_db_input($customer)."%'
|
|---|
| 196 | )
|
|---|
| 197 | ".$filter.$sort;
|
|---|
| 198 | } else {
|
|---|
| 199 | $filter = strpos($filter,' AND') !== false ? substr_replace($filter,' WHERE',0,strlen(' AND')) : ''; //replace ONLY FIRST occurrence of a string within a string
|
|---|
| 200 | $default_status = '';
|
|---|
| 201 | if (defined('ORDER_STATUSES_DISPLAY_DEFAULT') && ORDER_STATUSES_DISPLAY_DEFAULT != '' && (!isset($_GET['status']) || $_GET['status'] == '')) {
|
|---|
| 202 | $default_status_array = explode(',', ORDER_STATUSES_DISPLAY_DEFAULT);
|
|---|
| 203 | $default_status = ((strpos($filter, 'WHERE') !== false) ? " AND " : " WHERE ")."o.orders_status IN ('".implode("', '", $default_status_array)."') ";
|
|---|
| 204 | }
|
|---|
| 205 | $orders_query_raw = "SELECT o.*
|
|---|
| 206 | FROM ".TABLE_ORDERS." o
|
|---|
| 207 | ".$filter.$default_status.$sort;
|
|---|
| 208 | }
|
|---|
| 209 | $orders_split = new splitPageResults($_GET['page'], $page_max_display_results, $orders_query_raw, $orders_query_numrows);
|
|---|
| 210 | $orders_query = xtc_db_query($orders_query_raw);
|
|---|
| 211 | while ($orders = xtc_db_fetch_array($orders_query)) {
|
|---|
| 212 | if ((!xtc_not_null($oID) || (isset($oID) && $oID == $orders['orders_id'])) && !isset($oInfo)) {
|
|---|
| 213 | $oInfo = new objectInfo($orders);
|
|---|
| 214 | }
|
|---|
| 215 | if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) {
|
|---|
| 216 | $tr_attributes = 'class="dataTableRowSelected" onmouseover="this.style.cursor=\'pointer\'" onclick="document.location.href=\''.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=edit').'\'"';
|
|---|
| 217 | } else {
|
|---|
| 218 | $tr_attributes = 'class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'pointer\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\''.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID')).'oID='.$orders['orders_id']).'\'"';
|
|---|
| 219 | }
|
|---|
| 220 | $orders_link = xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders['orders_id'] . '&action=edit');
|
|---|
| 221 | $orders_image_preview = xtc_image(DIR_WS_ICONS . 'icon_edit.gif', ICON_EDIT);
|
|---|
| 222 | $orders['customers_name'] = (isset($orders['customers_company']) && $orders['customers_company'] != '') ? $orders['customers_company'] : $orders['customers_name'];
|
|---|
| 223 | if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id) ) {
|
|---|
| 224 | $orders_action_image = xtc_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ICON_EDIT);
|
|---|
| 225 | } else {
|
|---|
| 226 | $orders_action_image = '<a href="' . xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '">' . xtc_image(DIR_WS_IMAGES . 'icon_arrow_grey.gif', IMAGE_ICON_INFO) . '</a>';
|
|---|
| 227 | }
|
|---|
| 228 | ?>
|
|---|
| 229 | <tr <?php echo $tr_attributes;?>>
|
|---|
| 230 | <td class="dataTableContent" <?php
|
|---|
| 231 | /* magnalister v1.0.0 */
|
|---|
| 232 | if (function_exists('magnaExecute')) echo magnaExecute('magnaRenderOrderPlatformIcon', array('oID' => $orders['orders_id']), array('order_details.php'));
|
|---|
| 233 | /* END magnalister */
|
|---|
| 234 | ?>><?php echo $orders['customers_name']; ?></td>
|
|---|
| 235 | <td class="dataTableContent" align="right"><?php echo $orders['orders_id']; ?></td>
|
|---|
| 236 | <?php if (defined('MODULE_INVOICE_NUMBER_STATUS') && MODULE_INVOICE_NUMBER_STATUS == 'True') { ?>
|
|---|
| 237 | <td class="dataTableContent" align="right"><?php echo $orders['ibn_billnr']; ?></td>
|
|---|
| 238 | <?php } ?>
|
|---|
| 239 | <td class="dataTableContent" align="right"><?php echo $orders['delivery_country']; ?> </td>
|
|---|
| 240 | <td class="dataTableContent" align="right"><?php echo format_price(get_order_total($orders['orders_id']), 1, $orders['currency'], 0, 0); ?></td>
|
|---|
| 241 | <td class="dataTableContent" align="center"><?php echo xtc_datetime_short($orders['date_purchased']); ?></td>
|
|---|
| 242 | <td class="dataTableContent" align="center"><?php echo payment::payment_title($orders['payment_method']); ?></td>
|
|---|
| 243 | <td class="dataTableContent" align="right"><?php if($orders['orders_status']!='0') { echo $orders_status_array[$orders['orders_status']]; }else{ echo '<span class="col-red">'.TEXT_VALIDATING.'</span>';}?></td>
|
|---|
| 244 | <?php if (AFTERBUY_ACTIVATED=='true') { ?>
|
|---|
| 245 | <td class="dataTableContent" align="right"><?php echo ($orders['afterbuy_success'] == 1) ? $orders['afterbuy_id'] : 'TRANSMISSION_ERROR'; ?></td>
|
|---|
| 246 | <?php } ?>
|
|---|
| 247 | <td class="dataTableContent" align="right"><?php echo '<a href="' . $orders_link . '">' . $orders_image_preview . '</a> '.$orders_action_image; ?> </td>
|
|---|
| 248 | </tr>
|
|---|
| 249 | <?php
|
|---|
| 250 | }
|
|---|
| 251 | ?>
|
|---|
| 252 | </table>
|
|---|
| 253 |
|
|---|
| 254 | <div class="smallText pdg2 flt-l"><?php echo $orders_split->display_count($orders_query_numrows, $page_max_display_results, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_ORDERS); ?></div>
|
|---|
| 255 | <div class="smallText pdg2 flt-r"><?php echo $orders_split->display_links($orders_query_numrows, $page_max_display_results, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], xtc_get_all_get_params(array('page', 'oID', 'action'))); ?></div>
|
|---|
| 256 | <?php echo draw_input_per_page($PHP_SELF,$cfg_max_display_results_key,$page_max_display_results); ?>
|
|---|
| 257 | <!-- EOC ORDERS LISTING -->
|
|---|
| 258 | </td>
|
|---|
| 259 | <?php
|
|---|
| 260 | $heading = array ();
|
|---|
| 261 | $contents = array ();
|
|---|
| 262 | switch ($action) {
|
|---|
| 263 | case 'storno' :
|
|---|
| 264 | $heading[] = array ('text' => '<b>'.TEXT_INFO_HEADING_REVERSE_ORDER.'</b>');
|
|---|
| 265 | $contents = array ('form' => xtc_draw_form('orders', FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=stornoconfirm'));
|
|---|
| 266 | $contents[] = array ('text' => TEXT_INFO_REVERSE_INTRO.'<br /><br /><b>'.$oInfo->customers_name.'</b><br /><b>'.TABLE_HEADING_ORDERS_ID.'</b>: '.$oInfo->orders_id);
|
|---|
| 267 | $contents[] = array ('text' => HEADING_TITLE_STATUS . '<br />' . xtc_draw_pull_down_menu('status_storno', array_merge(array(array('id' => '0', 'text' => TEXT_VALIDATING)), $orders_statuses), $oInfo->orders_status));
|
|---|
| 268 | $contents[] = array ('text' => xtc_draw_checkbox_field('restock').' '.TEXT_INFO_RESTOCK_PRODUCT_QUANTITY);
|
|---|
| 269 | $contents[] = array ('align' => 'center', 'text' => '<br /><input type="submit" class="button" value="'. BUTTON_REVERSE .'"><a class="button" href="'.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id).'">' . BUTTON_CANCEL . '</a>');
|
|---|
| 270 | break;
|
|---|
| 271 | case 'delete' :
|
|---|
| 272 | $heading[] = array ('text' => '<b>'.TEXT_INFO_HEADING_DELETE_ORDER.'</b>');
|
|---|
| 273 | $contents = array ('form' => xtc_draw_form('orders', FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=deleteconfirm'));
|
|---|
| 274 | $contents[] = array ('text' => TEXT_INFO_DELETE_INTRO.'<br /><br /><b>'.$oInfo->customers_name.'</b><br /><b>'.TABLE_HEADING_ORDERS_ID.'</b>: '.$oInfo->orders_id);
|
|---|
| 275 | $contents[] = array ('text' => '<br />'.xtc_draw_checkbox_field('restock').' '.TEXT_INFO_RESTOCK_PRODUCT_QUANTITY);
|
|---|
| 276 | $contents[] = array ('align' => 'center', 'text' => '<br /><input type="submit" class="button" value="'. BUTTON_DELETE .'"><a class="button" href="'.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id).'">' . BUTTON_CANCEL . '</a>');
|
|---|
| 277 | break;
|
|---|
| 278 | default :
|
|---|
| 279 | if (isset($oInfo) && is_object($oInfo)) {
|
|---|
| 280 | $heading[] = array ('text' => '<b>['.$oInfo->orders_id.'] '.xtc_datetime_short($oInfo->date_purchased).'</b>');
|
|---|
| 281 | $contents[] = array ('align' => 'center', 'text' => '<a class="button" href="'.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=edit').'">'.BUTTON_EDIT.'</a>
|
|---|
| 282 | <a class="button" href="'.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=delete').'">'.BUTTON_DELETE.'</a>
|
|---|
| 283 | <a class="button" href="'.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=storno').'">'.BUTTON_REVERSE.'</a>');
|
|---|
| 284 | if (AFTERBUY_ACTIVATED == 'true') {
|
|---|
| 285 | $contents[] = array ('align' => 'center', 'text' => '<a class="button" href="'.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=custom&subaction=afterbuy_send').'">'.BUTTON_AFTERBUY_SEND.'</a>');
|
|---|
| 286 | }
|
|---|
| 287 | $contents[] = array ('text' => '<br />'.TEXT_DATE_ORDER_CREATED.' '.xtc_date_short($oInfo->date_purchased));
|
|---|
| 288 | if (xtc_not_null($oInfo->last_modified)) {
|
|---|
| 289 | $contents[] = array ('text' => TEXT_DATE_ORDER_LAST_MODIFIED.' '.xtc_date_short($oInfo->last_modified));
|
|---|
| 290 | }
|
|---|
| 291 | if ($oInfo->payment_method != '') {
|
|---|
| 292 | $contents[] = array ('text' => '<br />'.TEXT_INFO_PAYMENT_METHOD.' '.payment::payment_title($oInfo->payment_method, $oInfo->orders_id).' ('.$oInfo->payment_method.')');
|
|---|
| 293 | }
|
|---|
| 294 | if ($oInfo->shipping_class != '') {
|
|---|
| 295 | $contents[] = array ('text' => (($oInfo->shipping_method == '') ? '<br/>' : '').TEXT_INFO_SHIPPING_METHOD.' '.shipping::shipping_title($oInfo->shipping_class, $oInfo->shipping_method));
|
|---|
| 296 | }
|
|---|
| 297 | $order = new order($oInfo->orders_id);
|
|---|
| 298 | $contents[] = array ('text' => '<br />'.sizeof($order->products).' '.TEXT_PRODUCTS);
|
|---|
| 299 | for ($i = 0; $i < sizeof($order->products); $i ++) {
|
|---|
| 300 | $contents[] = array ('text' => $order->products[$i]['qty'].' x '.$order->products[$i]['name']);
|
|---|
| 301 | if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0) {
|
|---|
| 302 | for ($j = 0; $j < sizeof($order->products[$i]['attributes']); $j ++) {
|
|---|
| 303 | $contents[] = array ('text' => '<small> <i> - '.$order->products[$i]['attributes'][$j]['option'].': '.$order->products[$i]['attributes'][$j]['value'].'</i></small></nobr>');
|
|---|
| 304 | }
|
|---|
| 305 | }
|
|---|
| 306 | }
|
|---|
| 307 | if ($order->info['comments']<>'') {
|
|---|
| 308 | $contents[] = array ('text' => '<br><strong>'.TABLE_HEADING_COMMENTS.':</strong><br>'.$order->info['comments']);
|
|---|
| 309 | }
|
|---|
| 310 | }
|
|---|
| 311 | break;
|
|---|
| 312 | }
|
|---|
| 313 | // display right box
|
|---|
| 314 | if ((xtc_not_null($heading)) && (xtc_not_null($contents))) {
|
|---|
| 315 | echo ' <td class="boxRight">'."\n";
|
|---|
| 316 | $box = new box;
|
|---|
| 317 | echo $box->infoBox($heading, $contents);
|
|---|
| 318 | echo ' </td>'."\n";
|
|---|
| 319 | }
|
|---|
| 320 | ?>
|
|---|
| 321 | </tr>
|
|---|
| 322 | </table>
|
|---|