/**
  * Print passenger manifest to pdf
  */
 function exportpdf()
 {
     AImporter::model('passengers');
     $app = JFactory::getApplication();
     $input = $app->input;
     AImporter::helper('pdf', 'date');
     $model = new BookproModelpassengers(array('ignore_request' => 0));
     if ($app->isAdmin()) {
         $ticket_view = $this->getView('passengers', 'html', 'BookProView');
     } else {
         $ticket_view = $this->getView('AgentPassengers', 'html', 'BookProView');
         $ticket_view->is_admin = 1;
     }
     $ticket_view->setModel($model, true);
     $ticket_view->setLayout('report');
     ob_start();
     $ticket_view->display();
     $pdf = ob_get_contents();
     ob_end_clean();
     $order = new JObject();
     $order->name = 'Tour_report' . '_export_time_' . JHtml::date('now', 'Y-m-d-H-i-s');
     $order->fontsize = 7;
     PrintPdfHelper::printTicket($pdf, $order, 'P');
     return;
 }
 function exportPDF()
 {
     $app = JFactory::getApplication();
     $input = $app->input;
     AImporter::helper('pdf', 'date');
     AImporter::model('transportreports');
     $model = new BookproModelTransportReports();
     $depart_date = DateHelper::createFromFormatYmd($input->get('filter_depart_date'));
     $state = $model->getState();
     $state->set('list.limit', NULL);
     $state->set('list.start', 0);
     $state->set('list.ordering', 'pickup');
     $state->set('list.direction', 'ASC');
     if ($app->isAdmin()) {
         $ticket_view = $this->getView('Transportreports', 'html', 'BookProView');
     } else {
         $ticket_view = $this->getView('AgentTransportreports', 'html', 'BookProView');
         $ticket_view->is_admin = 1;
     }
     $ticket_view->setModel($model, true);
     $ticket_view->setLayout('report');
     ob_start();
     $ticket_view->display();
     $pdf = ob_get_contents();
     ob_end_clean();
     //get flight name
     $order = new JObject();
     $order->name = "transport_report" . $input->get('filter_depart_date') . '_' . JHtml::_('date', 'now', 'YmdHis');
     $order->fontsize = 9;
     PrintPdfHelper::printTicket($pdf, $order, 'P');
     return;
 }
示例#3
0
 function exportmonthpdf()
 {
     $datefrom = JFactory::$application->input->get('datefrom');
     $dateto = JFactory::$application->input->get('dateto');
     AImporter::helper('pdf', 'order');
     AImporter::model('customer');
     $customerModel = new BookProModelCustomer();
     $customer = $customerModel->getItemByUser();
     $user_id = $customer->id;
     AImporter::model('orders');
     $model = new BookProModelOrders();
     $state = $model->getState();
     $state->set('list.start', 0);
     $state->set('list.limit', 0);
     $state->set('filter.datefrom', $datefrom);
     $state->set('filter.dateto', $dateto);
     $state->set('filter.user_id', $user_id);
     $orders = $model->getItems();
     $object = new JObject();
     $object->orders = $orders;
     $object->customer = $customer;
     $object->order_number = time();
     $object->date = JText::sprintf('COM_BOOKPRO_BILL_FROM_TO', $datefrom, $dateto);
     $ticket_view = $this->getView('ordersagent', 'html', 'BookProView');
     if ($user_id) {
         $ticket_view->ordersComplex = $object;
         ob_start();
         $ticket_view->display();
         $pdf = ob_get_contents();
         ob_clean();
         PrintPdfHelper::printTicket($pdf, $object);
     } else {
         JFactory::getApplication()->enqueueMessage(JText::_('COM_BOOKPRO_CAN_NO_FIND_ORDERS_FOR_PRINTING'));
         $this->setRedirect(JURI::base() . 'controller=order&task=ordersdetailmonth');
     }
 }
示例#4
0
 function exportmonthpdf()
 {
     $datefrom = JFactory::$application->input->get('datefrom');
     $dateto = JFactory::$application->input->get('dateto');
     $id = JFactory::$application->input->get('id');
     AImporter::helper('pdf', 'order');
     AImporter::model('customer');
     $customerModel = new BookProModelCustomer();
     $customer = $customerModel->getItem($id);
     $user_id = $customer->id;
     AImporter::model('orders');
     $model = new BookProModelOrders();
     $state = $model->getState();
     $state->set('list.start', 0);
     $state->set('list.limit', 0);
     $state->set('filter.datefrom', $datefrom);
     $state->set('filter.dateto', $dateto);
     $state->set('filter.user_id', $user_id);
     $orders = $model->getItems();
     $object = new JObject();
     $object->orders = $orders;
     $object->customer = $customer;
     $object->order_number = time();
     $object->date = JText::sprintf('COM_BOOKPRO_BILL_FROM_TO', $datefrom, $dateto);
     $ticket_view = $this->getView('ordersagent', 'html', 'BookProView');
     $ticket_view->ordersComplex = $object;
     ob_start();
     $ticket_view->display();
     $pdf = ob_get_contents();
     ob_clean();
     PrintPdfHelper::printTicket($pdf, $object);
 }