$orderby = array(); $where = array(); $orderby = array(); $select = array(); if (strlen($this->get['q']) > 0) { $items = array(); $items[] = "orders_id='" . addslashes($this->get['q']) . "'"; $items[] = "customer_id LIKE '%" . addslashes($this->get['q']) . "%'"; $filter[] = '(' . implode(" or ", $items) . ')'; } if (!$this->masterShop) { $filter[] = 'o.page_uid=' . $this->showCatalogFromPage; } $select[] = 'o.*, osd.name as orders_status'; $orderby[] = 'o.orders_id desc'; $pageset = mslib_fe::getOrdersPageSet($filter, $offset, $this->get['limit'], $orderby, $having, $select, $where, $from); $resultset['orders'] = $pageset; $max_page = ceil($pageset['total_rows'] / $limit); if ($max_page > $global_max_page) { $global_max_page = $max_page; } if ($pageset['total_rows'] > $limit && $p + 1 < $max_page) { $have_paging = true; } if ($pageset['total_rows'] > 0) { $results_counter++; } } // orders search eof // invoices search if ($modules['invoices']) {
//$orderby[]='orders_id desc'; $select[] = 'o.*, osd.name as orders_status'; $orderby[] = 'o.orders_id desc'; if ($this->post['tx_multishop_pi1']['by_phone']) { $filter[] = 'o.by_phone=1'; } if ($this->post['tx_multishop_pi1']['is_proposal']) { $filter[] = 'o.is_proposal=1'; } else { $filter[] = 'o.is_proposal=0'; } if (isset($this->post['selected_orders'])) { $selected_orders = '(o.orders_id=' . implode(" or o.orders_id=", $this->post['selected_orders']) . ')'; $filter[] = $selected_orders; } $pageset = mslib_fe::getOrdersPageSet($filter, $offset, 500000, $orderby, $having, $select, $where, $from); $tmporders = $pageset['orders']; $filename = 'orders_listing_' . time() . '.xls'; $dir = $this->DOCUMENT_ROOT; $export_file = $dir . "uploads/tx_multishop/tmp/" . $filename; // Creating a workbook $phpexcel = new PHPExcel(); $phpexcel->getActiveSheet()->setTitle('orders listing'); $phpexcel->setActiveSheetIndex(0); $header_style['font'] = array('bold' => true); // write the header $sheet_header[] = $this->pi_getLL('orders_id'); $sheet_header[] = $this->pi_getLL('store'); $sheet_header[] = $this->pi_getLL('customer'); $sheet_header[] = $this->pi_getLL('order_date'); $sheet_header[] = $this->pi_getLL('amount');
if (!$this->masterShop) { $data_query['filter'][] = 'o.page_uid=' . $this->shop_pid; } $data_query['select'][] = 'o.*, osd.name as orders_status'; $order_by = 'o.billing_name'; $order = 'desc'; $order_link = 'a'; $data_query['order_by'][] = $order_by . ' ' . $order; // hook if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/admin_stats_user_agent.php']['statsUseragentQueryHookPreProc'])) { $params = array('data_query' => &$data_query); foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/admin_stats_user_agent.php']['statsUseragentQueryHookPreProc'] as $funcRef) { \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this); } } $pageset = mslib_fe::getOrdersPageSet($data_query['filter'], $offset, $this->post['limit'], $data_query['order_by'], $having, $data_query['select'], $data_query['where'], $data_query['from']); $tmporders = $pageset['orders']; if ($pageset['total_rows'] > 0) { require \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('multishop') . 'scripts/admin_pages/includes/user-agent_listing_table.php'; } else { $subpartArray = array(); $subpartArray['###LABEL_NO_RESULTS###'] = $this->pi_getLL('no_records_found') . '.'; $no_results = $this->cObj->substituteMarkerArrayCached($subparts['useragents_noresults'], array(), $subpartArray); } $subpartArray = array(); $subpartArray['###FORM_SEARCH_ACTION_URL###'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_stats_user_agent'); $subpartArray['###SHOP_PID###'] = $this->shop_pid; $subpartArray['###LABEL_KEYWORD###'] = ucfirst($this->pi_getLL('keyword')); $subpartArray['###VALUE_KEYWORD###'] = $this->post['skeyword'] ? $this->post['skeyword'] : ""; $subpartArray['###VALUE_SEARCH###'] = htmlspecialchars($this->pi_getLL('search')); $subpartArray['###LABEL_RESULTS_LIMIT_SELECTBOX###'] = $this->pi_getLL('limit_number_of_records_to');
case 'admin_home': break; case 'admin_edit_customer': if ($this->get['tx_multishop_pi1']['cid'] && is_numeric($this->get['tx_multishop_pi1']['cid'])) { $data_query['filter'][] = '(o.customer_id=' . $this->get['tx_multishop_pi1']['cid'] . ')'; } break; } // hook if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/includes/admin_home/ordersLatest.php']['ordersLatestHomeStatsQueryHookPreProc'])) { $params = array('data_query' => &$data_query); foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/includes/admin_home/ordersLatest.php']['ordersLatestHomeStatsQueryHookPreProc'] as $funcRef) { \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this); } } $pageset = mslib_fe::getOrdersPageSet($data_query['filter'], $offset, 20, $data_query['order_by'], $data_query['having'], $data_query['select'], $data_query['where'], $data_query['from']); $tmporders = $pageset['orders']; if ($pageset['total_rows'] > 0) { $data = array(); $data[] = array($this->pi_getLL('admin_label_order_number'), $this->pi_getLL('admin_label_amount'), $this->pi_getLL('date'), $this->pi_getLL('admin_paid'), $this->pi_getLL('admin_payment_method')); foreach ($tmporders as $order) { $edit_order_popup_width = 980; if ($this->ms['MODULES']['ADMIN_EDIT_ORDER_DISPLAY_ORDERS_PRODUCTS_STATUS'] > 0) { $edit_order_popup_width += 70; } if ($this->ms['MODULES']['ORDER_EDIT'] && !$order['is_locked']) { if ($edit_order_popup_width > 980) { $edit_order_popup_width += 155; } else { $edit_order_popup_width += 70; }
$markerArray['ADMIN_LABEL_BILLING_ADDRESS'] = $this->pi_getLL('admin_label_billing_address'); $markerArray['ADMIN_LABEL_DELIVERY_ADDRESS'] = $this->pi_getLL('admin_label_delivery_address'); // customers related orders listings $filter = array(); $from = array(); $having = array(); $match = array(); $orderby = array(); $where = array(); $select = array(); $select[] = 'o.*'; $filter[] = 'o.customer_id=' . $user['uid']; if (!$this->masterShop) { $filter[] = 'o.page_uid=' . $this->shop_pid; } $orders_pageset = mslib_fe::getOrdersPageSet($filter, 0, 10000, array('orders_id desc'), $having, $select, $where, $from); $order_listing = $this->pi_getLL('no_orders_found'); if ($orders_pageset['total_rows'] > 0) { $all_orders_status = mslib_fe::getAllOrderStatus($GLOBALS['TSFE']->sys_language_uid); $order_listing = '<div class="table-responsive"> <table id="product_import_table" class="table table-striped table-bordered no-mb msadmin_orders_listing"> <thead><tr> <th width="50" align="right" class="cellID">' . $this->pi_getLL('orders_id') . '</th> <th width="110" class="cellDate">' . $this->pi_getLL('order_date') . '</th> <th width="50" class="cellPrice">' . $this->pi_getLL('amount') . '</th> <th width="50" class="cell_shipping_method">' . $this->pi_getLL('shipping_method') . '</th> <th width="50" class="cell_payment_method">' . $this->pi_getLL('payment_method') . '</th> <th width="100" class="cell_status">' . $this->pi_getLL('order_status') . '</th> <th width="110" class="cellDate">' . $this->pi_getLL('modified_on', 'Modified on') . '</th> <th width="50" class="cellStatus">' . $this->pi_getLL('admin_paid') . '</th> </tr></thead><tbody>';