Example #1
0
 protected function saveOrderInfo()
 {
     //save order info
     AImporter::table('orderinfo');
     AImporter::helper('date');
     $this->orderinfo['params']['start'] = DateHelper::createFromFormatYmd($this->orderinfo['params']['start']);
     $this->orderinfo['params']['end'] = DateHelper::createFromFormatYmd($this->orderinfo['params']['end']);
     $orderinfo = $this->orderinfo;
     $orderinfo['order_id'] = $this->table->id;
     $orderinfo['params'] = json_encode($this->orderinfo['params']);
     $orderinfo['start'] = $this->orderinfo['params']['start'];
     $TableOrderinfo = new TableOrderInfo($this->_db);
     return $TableOrderinfo->save($orderinfo);
 }
Example #2
0
 function postSaveHook($model, $validData)
 {
     //save orderinfo
     if ($validData['id']) {
         AImporter::helper('date');
         AImporter::table('orderinfo');
         $orderinfo = $this->input->get('orderinfo', array(), 'array');
         $orderinfo['params']['start'] = DateHelper::createFromFormatYmd($orderinfo['params']['start']);
         $orderinfo['params']['end'] = DateHelper::createFromFormatYmd($orderinfo['params']['end']);
         $orderinfo['start'] = $orderinfo['params']['start'];
         $orderinfo['params'] = json_encode($orderinfo['params']);
         // 			debug($orderinfo);die;
         $db = JFactory::getDbo();
         $table = new TableOrderInfo($db);
         $table->load(array('order_id' => $validData['id']));
         return $table->save($orderinfo);
     }
     return true;
 }
Example #3
0
 protected function saveOrderInfo()
 {
     //save order info
     if (empty($this->tour->id) || empty($this->rate->id)) {
         $this->writeLog('Empty tour or rate');
         return false;
     }
     AImporter::table('orderinfo');
     $orderinfo = array('type' => 'TOUR', 'route_id' => $this->tour->id, 'order_id' => $this->table->id, 'start' => $this->rate->date, 'pickup' => $this->cart->tour->start_time, 'return_pickup' => $this->tour->return_time, 'adult' => $this->cart->filter['adult'], 'child' => $this->cart->filter['child'], 'infant' => $this->cart->filter['infant']);
     $TableOrderinfo = new TableOrderInfo($this->_db);
     return $TableOrderinfo->save($orderinfo);
 }
 protected function saveOrderInfo()
 {
     //save order info
     if (empty($this->trips['depart'])) {
         $this->writeLog('Empty depart trips or rate');
         return false;
     }
     AImporter::table('orderinfo');
     foreach ($this->trips as $key => $trip) {
         $orderinfo_params = new stdClass();
         $orderinfo_params->flight_number = $this->cart->flight_number[$key];
         $orderinfo_params->type = $key;
         $orderinfo_params->is_airport_shuttle = $this->cart->is_airport_shuttle;
         $orderinfo = array('type' => 'TRANSPORT', 'route_id' => $trip->id, 'order_id' => $this->table->id, 'start' => $trip->date, 'destfrom' => $trip->from->id, 'destto' => $trip->to->id, 'flight_time' => $this->cart->flight_time[$key], 'pickup' => $trip->start, 'adult' => $this->cart->filter['adult'], 'child' => $this->cart->filter['child'], 'infant' => $this->cart->filter['infant'], 'transport_type' => $this->cart->filter['type'], 'address' => !empty($this->cart->filter['pad_from']) ? $this->cart->filter['pad_from'] : $this->cart->filter['pad_to'], 'params' => json_encode($orderinfo_params));
         $TableOrderinfo = new TableOrderInfo($this->_db);
         if ($TableOrderinfo->save($orderinfo)) {
             $this->orderinfo[] = $TableOrderinfo;
         }
     }
     return $this->orderinfo;
 }