public function postProcess() { if (Tools::isSubmit('submitPrint')) { if (!Validate::isDate(Tools::getValue('date_from'))) { $this->_errors[] = $this->l('Invalid from date'); } if (!Validate::isDate(Tools::getValue('date_to'))) { $this->_errors[] = $this->l('Invalid end date'); } if (!sizeof($this->_errors)) { $orderSlips = OrderSlip::getSlipsIdByDate(Tools::getValue('date_from'), Tools::getValue('date_to')); if (count($orderSlips)) { Tools::redirectAdmin('pdf.php?slips&date_from=' . urlencode(Tools::getValue('date_from')) . '&date_to=' . urlencode(Tools::getValue('date_to')) . '&token=' . $this->token); } $this->_errors[] = $this->l('No order slips found for this period'); } } return parent::postProcess(); }
public function postProcess() { if (Tools::getValue('submitAddorder_slip')) { if (!Validate::isDate(Tools::getValue('date_from'))) { $this->errors[] = $this->l('Invalid "From" date'); } if (!Validate::isDate(Tools::getValue('date_to'))) { $this->errors[] = $this->l('Invalid "To" date'); } if (!count($this->errors)) { $order_slips = OrderSlip::getSlipsIdByDate(Tools::getValue('date_from'), Tools::getValue('date_to')); if (count($order_slips)) { Tools::redirectAdmin($this->context->link->getAdminLink('AdminPdf') . '&submitAction=generateOrderSlipsPDF&date_from=' . urlencode(Tools::getValue('date_from')) . '&date_to=' . urlencode(Tools::getValue('date_to'))); } $this->errors[] = $this->l('No order slips were found for this period.'); } } else { return parent::postProcess(); } }
function generateOrderSlipsPDF() { $orderSlips = OrderSlip::getSlipsIdByDate($_GET['date_from'], $_GET['date_to']); if (!count($orderSlips)) { die(Tools::displayError('No order slips found')); } PDF::multipleOrderSlips($orderSlips); }
public function processGenerateOrderSlipsPDF() { $id_order_slips_list = OrderSlip::getSlipsIdByDate(Tools::getValue('date_from'), Tools::getValue('date_to')); if (!count($id_order_slips_list)) { die(Tools::displayError('No order slips were found.')); } $order_slips = array(); foreach ($id_order_slips_list as $id_order_slips) { $order_slips[] = new OrderSlip((int) $id_order_slips); } $this->generatePDF($order_slips, PDF::TEMPLATE_ORDER_SLIP); }
public function processGenerateOrderSlipsPDF() { $id_order_slips_list = OrderSlip::getSlipsIdByDate(Tools::getValue('date_from'), Tools::getValue('date_to')); if (!count($id_order_slips_list)) { die($this->trans('No order slips were found.', array(), 'Admin.OrdersCustomers.Notification')); } $order_slips = array(); foreach ($id_order_slips_list as $id_order_slips) { $order_slips[] = new OrderSlip((int) $id_order_slips); } $this->generatePDF($order_slips, PDF::TEMPLATE_ORDER_SLIP); }