function display($tpl = null) { $this->state = $this->get('State'); $from_date = $this->state->get('filter.from_date'); if (empty($from_date)) { $this->state->set('filter.from_date', JHtml::date('now', 'Y-m-d')); } $to_date = $this->state->get('filter.to_date'); if (empty($to_date)) { $this->state->set('filter.to_date', JHtml::date('now', 'Y-m-d')); } $order_status = $this->state->get('filter.order_status'); $this->state->set('filter.order_status', 'CONFIRMED'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $model = new BookProModelTransports(); $this->airport = $model->getGroupAirportList(); $this->dest_list = $model->dest_list; $this->route_list = $model->getRouteList(); $this->total_order = $this->get('TotalBooking'); $this->total_pass = $this->get('Total'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } // 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'); $model = new BookProModelTransports(); $this->dest = $model->getGroupAirportList(); if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } $this->addToolbar(); parent::display($tpl); }
function display($tpl = null) { /* @var $mainframe JApplication */ $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->state = $this->get('State'); $models = new BookProModelTransports(); $this->dest = $models->getGroupAirportList(); $model = $this->getModel(); $this->stops = $model->getStop($this->item->id); // debug($this->dest); $this->addToolbar(); parent::display($tpl); }
protected function saveOrderInfoStop() { AImporter::model('transports'); AImporter::table('orderinfostop'); $model_transport = new BookProModelTransports(); foreach ($this->orderinfo as $orderinfo) { $stop_dest_list = $model_transport->getStopBetween($orderinfo->route_id, $orderinfo->destfrom, $orderinfo->destto); $ordering = 0; foreach ($stop_dest_list as $stop) { $table = new TableOrderInfoStop($this->_db); $data = array('ordering' => $ordering, 'orderinfo_id' => $orderinfo->id, 'dest' => $stop); if (!$table->save($data)) { die('save order info stop error'); } $ordering++; } } return true; }
private function getTrip($cart, $roundtrip = false, $filter_date = false) { AImporter::helper('airport', 'parameter', 'math'); $price_list = AParameter::getPrice(); $rate = MathHelper::filterArrayObject($price_list->dayoff, 'date', JFactory::getDate($cart->start)->format('Y-m-d')); $trips = array(); if (!$rate) { $model = new BookProModelTransports(); $state = $model->getState(); $state->set('filter.state', 1); $state->set('filter.type', $cart->filter['type']); //depart $state->set('filter.destfrom', $cart->filter['destfrom']); $state->set('filter.destto', $cart->filter['destto']); $state->set('filter.depart_date', $cart->start); $trips['depart'] = $model->getItems(); foreach ($trips['depart'] as &$result) { $result->date = $cart->start; $result->start = $cart->start_time; $result->from = AirportHelper::getItem($result->from_dest); $result->to = AirportHelper::getItem($result->to_dest); } } if ($cart->filter['roundtrip']) { //find dayoff $rate = MathHelper::filterArrayObject($price_list->dayoff, 'date', JFactory::getDate($cart->end)->format('Y-m-d')); if (!$rate) { $model = new BookProModelTransports(); $state = $model->getState(); $state->set('filter.state', 1); $state->set('filter.type', $cart->filter['type']); $state->set('filter.destfrom', $cart->filter['destto']); $state->set('filter.destto', $cart->filter['destfrom']); $state->set('filter.depart_date', $cart->end); $trips['return'] = $model->getItems(); foreach ($trips['return'] as &$return) { $return->date = $cart->end; $return->start = $cart->return_time; $return->from = AirportHelper::getItem($return->from_dest); $return->to = AirportHelper::getItem($return->to_dest); } } } return $trips; }