function display($tpl = null) { $this->input = JFactory::getApplication()->input; $order_number = $this->input->getString('order_number'); $email = $this->input->getString('email'); if ($order_number) { $orderModel = new BookProModelOrder(); $order = $orderModel->getByOrderNumber($order_number); $order_id = $order->id; $model = new BookProModelOrder(); $this->orderComplex = $model->getComplexItem($order_id); if ($this->orderComplex->customer->email == $email) { $this->config = JBFactory::getConfig(); $this->order = $this->orderComplex->order; $this->customer = $this->orderComplex->customer; $this->orderinfo = $this->orderComplex->orderinfo; $this->passengers = $this->orderComplex->passengers; $this->tour = $this->orderComplex->tour; } else { JFactory::getApplication()->enqueueMessage(JText::_('COM_BOOKPRO_WRONG_ORDER_NUMBER_OR_EMAIL_WARN')); $this->setLayout('check'); } } else { $this->setLayout('check'); } parent::display($tpl); }
function display($tpl = null) { $this->order_id = JFactory::$application->input->getInt('order_id'); $orderModel = new BookProModelOrder(); $this->orderComplex = $orderModel->getComplexItem($this->order_id); $this->order = $this->orderComplex->order; $this->customer = $this->orderComplex->customer; $this->orderinfo = $this->orderComplex->orderinfo; $this->passengers = $this->orderComplex->passengers; $this->tour = $this->orderComplex->tour; $doc = JFactory::getDocument(); $doc->setTitle("Payment Step"); $dispatcher = JDispatcher::getInstance(); require_once JPATH_SITE . '/administrator/components/com_bookpro/helpers/plugin.php'; $payment_plugins = PluginHelper::getPluginsWithEvent('onBookproGetPaymentPlugins'); $plugins = array(); if ($payment_plugins) { foreach ($payment_plugins as $plugin) { $results = $dispatcher->trigger("onBookproGetPaymentOptions", array($plugin->element, $this->order)); if (in_array(true, $results, true)) { $plugins[] = $plugin; } } } if (count($plugins) == 1) { $plugins[0]->checked = true; ob_start(); $this->getPaymentForm($plugins[0]->element); $html = json_decode(ob_get_contents()); ob_end_clean(); $this->assign('payment_form_div', $html->msg); } $this->assign('plugins', $plugins); parent::display($tpl); }
function display($tpl = null) { $input = JFactory::getApplication()->input; $order_number = $input->getString('order'); $db = JFactory::getDbo(); $this->order = new TableOrders($db); $this->order->load(array('order_number' => $order_number)); $model = new BookProModelOrder(); $this->orderComplex = $model->getComplexItem($this->order->id); if ($this->orderComplex->customer->email != $input->getString('email')) { JFactory::getApplication()->enqueueMessage('COM_BOOKPRO_WRONG_ORDER_NUMBER_OR_EMAIL_WARN'); return; } parent::display($tpl); }
/** * display method of Transportreport view * @return void */ public function display($tpl = null) { // get the Data $this->form = $this->get('Form'); $this->item = $this->get('Item'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } $model = new BookProModelOrder(); $this->orderComplex = $model->getComplexItem($this->item->order_id); //$this->transport = TransportHelper::getTransportDetail($this->item->route_id); $this->addon = TransportHelper::getAddonDetails($this->item->order_id); // Set the toolbar $this->addToolBar(); // Display the template parent::display($tpl); }
public function display($tpl = null) { $this->item = $this->get('Item'); $this->form = $this->get('Form'); $this->order = $this->item; if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } //get orderComplex $orderModel = new BookProModelOrder(); $this->orderComplex = $orderModel->getComplexItem($this->order->id); // get Customer $this->customer = $this->orderComplex->customer; //get Passengers $this->passengers = $this->orderComplex->passengers; if (empty($this->passengers)) { $app = JFactory::getApplication(); $app->enqueueMessage(JText::_('COM_BOOKPRO_ORDER_NO_PASSENGER'), 'error'); $app->redirect(JRoute::_('index.php?option=com_bookpro&view=agentorders')); } parent::display($tpl); }
static function getAddon($order_id) { AImporter::model('order'); $model = new BookProModelOrder(); return $model->getAddon($order_id); }
function detail() { $order_id = JRequest::getInt('order_id'); if (!class_exists('BookProModelOrder')) { AImporter::model('order'); } $model = new BookProModelOrder(); $orderComplex = $model->getComplexItem($order_id); $view =& $this->getView('orderdetail', 'html', 'BookProView'); $view->assign('orderComplex', $orderComplex); $view->display(); return; }
</th> <th><?php echo JText::_("COM_BOOKPRO_ORDER_TATUS"); ?> </th> <th><?php echo JText::_("COM_BOOKPRO_ORDER_CREATED_DATE"); ?> </th> </tr> </thead> <tbody> <?php if (count($orders) > 0) { foreach ($orders as $subject) { $orderinfoModel = new BookProModelOrder(); $orderComplex = $orderinfoModel->getComplexItem($subject->id); ?> <tr> <td><a href="<?php echo JUri::root() . 'index.php?option=com_bookpro&controller=order&task=detail&order_id=' . $subject->id; ?> " target="_blank"> <?php echo $subject->order_number; ?> </a> <br /> <label class="label"> <?php if (isset($orderComplex->hotel)) { ?>
function exportpdf() { AImporter::helper('pdf', 'order'); $id = JFactory::getApplication()->input->get('order_id'); $model = new BookProModelOrder(); $orderComplex = $model->getComplexItem($id); $ticket_view = $this->getView('orderdetail', 'html', 'BookProView'); if ($id) { $model = new BookProModelOrder(); $orderComplex = $model->getComplexItem($id); $orderComplex->exporttype = "pdf"; $ticket_view->orderComplex = $orderComplex; ob_start(); $ticket_view->display(); $pdf = ob_get_contents(); ob_clean(); PrintPdfHelper::printTicket($pdf, $orderComplex->order); } else { JFactory::getApplication()->enqueueMessage(JText::_('COM_BOOKPRO_CAN_NO_FIND_THE_ORDER_FOR_PRINTING')); $this->setRedirect(JURI::base() . 'index.php?option=com_bookpro&controller=order&task=detail&order_id=' . $order_id); } }
<?php JToolBarHelper::custom('order.sendpaymentmail', 'mail', 'icon over', JText::_('Send payment mail'), false, false); AImporter::model('order'); AImporter::helper('js'); JsHelper::addDatePickerLib(); $model = new BookProModelOrder(); $this->orderComplex = $model->getComplexItem($this->item->id); $this->orderinfo = $this->orderComplex->orderinfo; $service_options = array((object) array('value' => 'TOUR', 'title' => JText::_('COM_BOOKPRO_CUSTOMIZE_TOUR')), (object) array('value' => 'EXECUTIVE_CAR', 'title' => JText::_('COM_BOOKPRO_CUSTOMIZE_EXECUTIVE_CAR')), (object) array('value' => 'LIMO', 'title' => JText::_('COM_BOOKPRO_CUSTOMIZE_LIMO')), (object) array('value' => 'OTHER', 'title' => JText::_('COM_BOOKPRO_CUSTOMIZE_OTHER'))); $php_format = DateHelper::getConvertDateFormat(); $params = json_decode($this->orderinfo[0]->params); ?> <div class="form-horizontal"> <div class="control-group"> <label class="control-label"><?php echo JText::_('COM_BOOKPRO_SERVICE_TYPE'); ?> </label> <div class="controls"> <?php echo JHTML::_('select.genericlist', $service_options, 'orderinfo[type]', 'required class="inputbox required" ', 'value', 'title', $this->orderinfo[0]->type, 'orderinfo_type'); ?> </div> </div> <div class="control-group"> <label class="control-label"><?php echo JText::_('COM_BOOKPRO_DATE_DEPART'); ?> </label>
public function changeOrderStatus($order_id) { $orderModel = new BookProModelOrder(); $applicationModel = new BookProModelApplication(); $customerModel = new BookProModelCustomer(); $order = $orderModel->getItem($order_id); $customer = $customerModel->getItem($order->user_id); $this->app = $applicationModel->getItemByCode($order->type); $msg = 'COM_BOOKPRO_ORDER_STATUS_' . $order->order_status . '_EMAIL_BODY'; $body_customer = JText::_($msg); $body_customer = $this->fillCustomer($body_customer, $customer); $body_customer = $this->fillOrder($body_customer, $order); BookProHelper::sendMail($this->app->email_send_from, $this->app->email_send_from_name, $customer->email, JText::_('COM_BOOKPRO_ORDER_STATUS_CHANGE_EMAIL_SUB'), $body_customer, true); }
function postpayment() { $app = JFactory::getApplication(); $plugin = $app->input->getString('method'); $pluginsms = $app->input->get('methodsms', 'product_sms', 'string'); $dispatcher = JDispatcher::getInstance(); JPluginHelper::importPlugin('bookpro'); $values = new JObject(); $results = $dispatcher->trigger("onBookproPostPayment", array($plugin, $values)); /// Send email if ($results) { AImporter::model('order'); $model = new BookProModelOrder(); $orderComplex = $model->getComplexItem($results[0]->id); //$smsresult=$dispatcher->trigger('onBookproSendSms',array($results[0])); if (!$results[0]->sendemail) { //$this->sendMail($results[0]->id); $url = JUri::root() . 'index.php?option=com_bookpro&controller=payment&task=urlsendmail&order_id=' . $results[0]->id; $response = BookProHelper::pingUrl($url); } } if ($app->input->getString('message') == 'cancelled') { $app->enqueseMessage(JText::_('COM_BOOKPRO_YOUR_BOOKING_HAS_BEEN_CANCELLED')); return; } if ($results[0]->order_status == 'CONFIRMED') { AImporter::classes('customer'); $user = new BookproCustomer(); $user->saveSunpassPoint($results[0]); $app->redirect('index.php?option=com_bookpro&view=postpayment&order=' . $results[0]->order_number . '&email=' . $orderComplex->customer->email); } else { $app->enqueseMessage(JText::_('COM_BOOKPRO_YOUR_BOOKING_HAS_NOT_BEEN_CONFIRMED')); } return; }