Пример #1
0
 function display($tpl = null)
 {
     //Add bootstrap
     JHtml::_('bootstrap.tooltip');
     JHtml::_('behavior.multiselect');
     JHtml::_('formbehavior.chosen', 'select');
     $mainframe = JFactory::getApplication();
     $document = JFactory::getDocument();
     $this->user = JBFactory::getAccount();
     //debug($this->customer); die;
     $document->setTitle('My page');
     //$this->assignRef('cities', $this->getCitySelectBox($this->customer->city,$this->customer->country_id));
     $orderModel = new BookProModelOrders();
     $state = $orderModel->getState();
     $state->set('filter.user_id', (int) $this->user->id);
     //$state->set('filter.datefrom', $this->datefrom);
     //$state->set('filter.dateto', $this->dateto);
     //get order
     $this->pagination = $orderModel->getPagination();
     $this->orders = $orderModel->getItems();
     parent::display($tpl);
 }
Пример #2
0
<?php

$customer = JBFactory::getAccount();
AImporter::helper('tour', 'currency', 'date', 'paystatus', 'orderstatus');
AImporter::model('orders', 'order');
$model = new BookProModelOrders();
$state = $model->getState();
$state->set('filter.user_id', $customer->id);
$state->set('list.start', 0);
$state->set('list.limit', 100);
$orders = $model->getItems();
?>
<div class="row-fluid">
	<div class="well well-small form-inline">
		<div class="span6">
			<div class="pull-left lead">
			<?php 
echo JText::_('COM_BOOKPRO_LATEST_ORDER');
?>
			</div>
		</div>
	</div>

	<div class="well well-small">
		<div class="container-fluid" style="background-color: white;">
			<form name="tourOrder" action="index.php">
				<table class="table">
					<thead>
						<tr>
							<th><?php 
echo JText::_("COM_BOOKPRO_ORDER_NUMBER");
Пример #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);
 }
Пример #5
0
 function cancel_order()
 {
     $mainframe = JFactory::getApplication('site');
     $order_id = JRequest::getVar('order_id');
     if (!class_exists('BookProModelOrder')) {
         AImporter::model('orders');
     }
     $model = new BookProModelOrders();
     $model->setId($order_id);
     $order = $model->getObject();
     $order->order_status = 'CANCELLED';
     if (!$order->store()) {
         JError::raiseError(500, $row->getError());
     }
     $mainframe->redirect(JURI::root() . 'index.php?option=com_bookpro&view=mypage');
     return;
 }