Ejemplo n.º 1
0
 public function setTrips()
 {
     $this->trips = array();
     $this->trips['depart'] = $this->getTrip($this->depart_route_id);
     if (!$this->trips['depart']) {
         $this->error_code = 1;
         return false;
     }
     $this->trips['depart']->from = AirportHelper::getItem($this->cart->filter['destfrom']);
     $this->trips['depart']->to = AirportHelper::getItem($this->cart->filter['destto']);
     $this->trips['depart']->start = $this->cart->start_time;
     $this->trips['depart']->date = $this->cart->start;
     //roundtrip
     if ($this->cart->filter['roundtrip']) {
         $this->trips['return'] = $this->getTrip($this->return_route_id);
         if (!$this->trips['return']) {
             $this->error_code = 2;
             return false;
         }
         $this->trips['return']->from = AirportHelper::getItem($this->cart->filter['destto']);
         $this->trips['return']->to = AirportHelper::getItem($this->cart->filter['destfrom']);
         $this->trips['return']->start = $this->cart->return_time;
         $this->trips['return']->date = $this->cart->end;
     }
     return true;
 }
Ejemplo n.º 2
0
 public function display($tpl = null)
 {
     $model = new BookProModelCustomers();
     $this->setModel($model, true);
     $agent_group = (int) JComponentHelper::getParams('com_bookpro')->get('agent_usergroup');
     $this->state = $this->get('State');
     $this->state->set('filter.group_id', $agent_group);
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     //get airport
     $this->airports = AirportHelper::getItems();
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $this->addToolbar();
     parent::display($tpl);
 }
Ejemplo n.º 3
0
 public static function treerecurse($id, $indent, $list, &$children, $maxlevel = 9999, $level = 0, $type = 1)
 {
     if (@$children[$id] && $level <= $maxlevel) {
         foreach ($children[$id] as $v) {
             $id = $v->value;
             if ($type) {
                 $pre = '<sup>|_</sup>&#160;';
                 $spacer = '.&#160;&#160;&#160;&#160;&#160;&#160;';
             } else {
                 $pre = '- ';
                 $spacer = '&#160;&#160;';
             }
             if ($v->parent_id == 0) {
                 $txt = $v->text;
             } else {
                 $txt = $pre . $v->text;
             }
             $pt = $v->parent_id;
             $list[$id] = $v;
             $list[$id]->treename = "{$indent}{$txt}";
             $list[$id]->children = count(@$children[$id]);
             $list = AirportHelper::TreeRecurse($id, $indent . $spacer, $list, $children, $maxlevel, $level + 1, $type);
         }
     }
     return $list;
 }
<?php

AImporter::helper('math', 'airport');
$total_pass = $this->cart->filter['adult'] + $this->cart->filter['child'];
$from = AirportHelper::getItem($this->cart->filter['destfrom']);
$to = AirportHelper::getItem($this->cart->filter['destto']);
?>
<h2 class="block_head">
	<span><?php 
echo JText::_('COM_BOOKPRO_TRANSPORT_BOOKING_DETAIL');
?>
 </span>
</h2>
<legend style="font-weight: bold;font-size:120%">
	<?php 
echo JText::_('COM_BOOKPRO_TRANSPORT_TYPE') . ': ' . TransportHelper::getTransprortType($this->cart->filter['type']);
?>
</legend>

<div class="row-fluid"><strong>
<?php 
echo JText::_('COM_BOOKPRO_PASSENGERS') . ': ' . $this->cart->filter['adult'];
if ($this->cart->filter['child'] > 0) {
    echo ',&nbsp;';
    echo JText::sprintf('COM_BOOKPRO_CHILDREN_TXT', $this->cart->filter['child']);
}
if ($this->cart->filter['infant'] > 0) {
    echo ',&nbsp;';
    echo JText::sprintf('COM_BOOKPRO_INFANT_TXT', $this->cart->filter['infant']);
}
?>
Ejemplo n.º 5
0
 private function getComplexTransport($order)
 {
     AImporter::helper('airport');
     $object = new JObject();
     $object->order = $order;
     $db = JFactory::getDBO();
     $query = $db->getQuery(true);
     // get Customer and Country name
     $query->select('customer.*, country.country_name AS country_name');
     $query->from('#__bookpro_customer AS customer');
     $query->leftJoin('#__bookpro_country AS country ON country.id = customer.country_id');
     $query->where('customer.id = ' . (int) $order->user_id);
     $db->setQuery($query);
     $object->customer = $db->loadObject();
     //get order info
     $query->clear();
     $query->select('orderinfo.*');
     $query->from('#__bookpro_orderinfo AS orderinfo');
     $query->where('orderinfo.order_id = ' . (int) $order->id);
     $db->setQuery($query);
     $object->orderinfo = $db->loadObjectList();
     //get route
     AImporter::model('transport');
     $model = new BookProModelTransport();
     foreach ($object->orderinfo as $orderinfo) {
         $orderinfo->trip = $model->getItem($orderinfo->route_id);
         $orderinfo->trip->from = AirportHelper::getItem($orderinfo->destfrom);
         $orderinfo->trip->to = AirportHelper::getItem($orderinfo->destto);
     }
     $object->addons = $this->getAddon($order->id);
     //passenger
     $query->clear();
     $query->select('passenger.*, country.country_name AS country');
     $query->from('#__bookpro_passenger AS passenger');
     $query->leftJoin('#__bookpro_country AS country ON country.id = passenger.country_id');
     $query->where('passenger.order_id = ' . (int) $order->id);
     $db->setQuery($query);
     $object->passengers = $db->loadObjectList();
     return $object;
 }
Ejemplo n.º 6
0
 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;
 }