public function getType()
 {
     AImporter::helper('transport');
     $type = TransportHelper::getType();
     $options = array();
     $options[] = JHTML::_('select.option', '', JText::_('COM_BOOKPRO_TYPE'), 'value', 'text');
     $options = array_merge($options, $type);
     return JHTML::_('select.genericlist', $options, 'filter_type', ' class="inputbox" ', 'value', 'text', $this->state->get('filter.type'), 'filter_type');
 }
 /**
  * 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);
 }
 function getFullDepartAirport($type)
 {
     //get country
     $countries = $this->getCountry();
     //get parent destination
     $parents = $this->getParentDest();
     //get destination
     $result = array();
     foreach ($countries as $c) {
         $result[$c->country_name] = array();
         foreach ($parents as $pr) {
             if ($pr->country_id == $c->id) {
                 $result[$c->country_name][$pr->title] = $this->getDepartDestByParent($pr->id, $type);
             }
         }
         $result[$c->country_name] = TransportHelper::removeEmptyArray($result[$c->country_name]);
     }
     return $result;
 }
 static function getTransportList()
 {
     if (!self::$transportList) {
         AImporter::model('transportdayoff');
         $model = new BookproModelTransportdayoff();
         self::$transportList = $model->getTransports();
     }
     return self::$transportList;
 }
Example #5
0
    echo $this->dest_list[$item->destfrom]->title;
    ?>
</td>
		<td><?php 
    echo $this->dest_list[$item->destto]->title;
    ?>
</td>
		<td><?php 
    echo JFactory::getDate($item->start)->format($php_format);
    ?>
</td>
		<td><?php 
    echo DateHelper::formatHours($item->pickup);
    ?>
</td>							
		<td><?php 
    echo $item->order_number;
    ?>
</td>
		<td><?php 
    echo TransportHelper::getTransprortType($item->transport_type);
    ?>
</td>
	</tr>
<?php 
}
?>
	</tbody>
</table>
<?php 
//die;
    public function draw($events)
    {
        $this_day_events = 0;
        if (is_array($events)) {
            if (isset($events[$this->cell_year][$this->cell_month][$this->cell_day])) {
                $this_day_events = count($events[$this->cell_year][$this->cell_month][$this->cell_day]);
            }
        } else {
            $events = array();
        }
        $transports = TransportHelper::getTransportList();
        ?>

<span class="pn_cal_cell_ev_counter"
<?php 
        if ($this_day_events <= 0) {
            ?>
 style="display: none;"
<?php 
        }
        ?>
><?php 
        echo $this_day_events;
        ?>
 </span>
<div data-year="<?php 
        echo $this->cell_year;
        ?>
"
	data-month="<?php 
        echo $this->cell_month;
        ?>
"
	data-day="<?php 
        echo $this->cell_day;
        ?>
"
	data-week-day-num="<?php 
        echo $this->get_week_day_num();
        ?>
"
	class="<?php 
        if ($this->in_current_month) {
            ?>
pn_this_month<?php 
        } else {
            ?>
other_month<?php 
        }
        ?>
">
	<?php 
        echo $this->cell_day;
        ?>
	<?php 
        $dd = new JDate();
        $dd->setDate($this->cell_year, $this->cell_month, $this->cell_day);
        $date = $dd->format('Y-m-d');
        $view = 'transportdayoff';
        ?>
	<?php 
        if ($this->rate) {
            $params = json_decode($this->rate->params);
            ?>
		
		<a target="_blank"
		href="<?php 
            echo JUri::base();
            ?>
index.php?option=com_bookpro&view=<?php 
            echo $view;
            ?>
&layout=edit&id=<?php 
            echo $this->rate->id;
            ?>
">
		<i class="icon-edit" style="color: white;"></i> </a>
		<input class="checkboxCell" type="checkbox"  value="<?php 
            echo $this->rate->id;
            ?>
" name="cid[]" id="cb<?php 
            echo $this->rate->id;
            ?>
">
		<?php 
            foreach ($params as $i => $rate) {
                ?>
			<small><?php 
                echo $transports[$i]->code;
                ?>
</small>
		<?php 
            }
            ?>
		<?php 
        } else {
            ?>
			<center>
				<a target="_blank" class="mgpopup"
					href="<?php 
            echo JUri::base();
            ?>
index.php?option=com_bookpro&view=<?php 
            echo $view;
            ?>
&layout=edit&date=<?php 
            echo $dd->format('Y-m-d');
            ?>
">
					<i class="icon-plus-2"></i>
				</a>
			</center>
		<?php 
        }
        ?>
		
</div>


		<?php 
        $transports = null;
    }
<?php

//	debug($displayData);
$params = json_decode($displayData->orderinfo->params);
?>

<div>
	<legend style="font-weight: bold;font-size:120%">
		<?php 
echo JText::_('COM_BOOKPRO_TRANSPORT_TYPE') . ': ' . TransportHelper::getTransprortType($displayData->orderinfo[0]->transport_type);
?>
	</legend>
	<table class="table" >	
	<tr>
		<?php 
foreach ($displayData->orderinfo as $orderinfo) {
    $params = json_decode($orderinfo->params);
    ?>
		<td width="50%" style="border:none;">
			<table>
				<tr>
					<td colspan="2" style="border:none;"><div style="width:100%;margin:0;text-align:left"><strong><?php 
    echo JText::sprintf('COM_BOOKPRO_TRANSPORT_DEPART_ON_TXT', JFactory::getDate($orderinfo->start)->format('l, F j Y'));
    ?>
</strong></div></td>
				</tr>
				
				<tr>
					<td  class="tdtitleorder"><?php 
    echo JText::_('COM_BOOKPRO_PICKUP');
    ?>
Example #8
0
defined('_JEXEC') or die('Restricted access');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$config = JComponentHelper::getParams('com_bookpro');
$date_format_m = DateHelper::getConvertDateFormat('M');
$params = json_decode($this->orderComplex->orderinfo[0]->params);
//debug($this->transport);
?>
<form action="<?php 
echo JRoute::_('index.php?option=com_bookpro&layout=edit&id=' . (int) $this->item->id);
?>
" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">
<legend><?php 
echo JText::_('COM_BOOKPRO_TRANSPORT_TYPE') . ': ' . TransportHelper::getTransprortType($this->orderComplex->orderinfo[0]->transport_type);
?>
</legend>
	<div class="row-fluid">
		<div class="span6 form-horizontal">
			<?php 
foreach ($this->orderComplex->orderinfo as $orderinfo) {
    ?>
				<legend><?php 
    echo JFactory::getDate($orderinfo->start)->format(DateHelper::getConvertDateFormat()) . ' - ' . $orderinfo->trip->from->title . ' - ' . $orderinfo->trip->to->title;
    ?>
</legend>
			<?php 
}
?>
			
<?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']);
}
?>
Example #10
0
 public function showBookForm()
 {
     AImporter::helper('vehicle', 'transport');
     $cart = $this->getCart();
     $this->checkCart($cart);
     $input = JFactory::getApplication()->input;
     $vehicle_id = $input->getInt('vehicle_id');
     $vehicle = VehicleHelper::getItem($vehicle_id);
     $total_pass = $cart->filter['adult'] + $cart->filter['child'];
     $price_vehicle = TransportHelper::caculateVehiclePrice($vehicle, $cart->trips['depart']->distance, $total_pass);
     $cart->price_vehicle = $price_vehicle['total'];
     $rate = json_decode($cart->trips['depart']->rate_params);
     //$cart->price_vehicle = TransportHelper::caculatePriceWithRate($cart->price_vehicle,$cart->filter['type'],$cart->start,$cart->start_time,$rate);
     $cart->price_vehicle_return = 0;
     //caculate parking price
     $cart->price_parking = TransportHelper::caculateParking($vehicle, $cart->trips['depart']);
     //$cart->price_parking = TransportHelper::caculatePriceWithRate($cart->price_parking,$cart->filter['type'],$cart->start,$cart->start_time,$rate);
     $cart->price_parking_return = 0;
     if ($cart->filter['roundtrip']) {
         $rate = json_decode($cart->trips['return']->rate_params);
         $price_vehicle_return = TransportHelper::caculateVehiclePrice($vehicle, $cart->trips['return']->distance, $total_pass);
         $cart->price_vehicle_return = $price_vehicle_return['total'];
         //$cart->price_vehicle_return = TransportHelper::caculatePriceWithRate($cart->price_vehicle_return,$cart->filter['type'],$cart->end,$cart->return_time,$rate);
         $cart->price_parking_return = TransportHelper::caculateParking($vehicle, $cart->trips['return']);
         //$cart->price_parking_return = TransportHelper::caculatePriceWithRate($cart->price_parking_return,$cart->filter['type'],$cart->end,$cart->return_time,$rate);
     }
     $vehicle_param = (object) array('id' => $vehicle->id, 'title' => $vehicle->title, 'seat' => $vehicle->seat, 'price' => $vehicle->price, 'qty' => $price_vehicle['qty'], 'image' => $vehicle->image);
     $cart->vehicle = $vehicle_param;
     $total = $cart->price_transport + $cart->price_transport_return + $cart->price_vehicle + $cart->price_vehicle_return + $cart->price_parking + $cart->price_parking_return;
     $cart->subtotal = $total - ($cart->price_parking + $cart->price_parking_return);
     $cart->total = $total + $total * $cart->tax / 100;
     $cart->saveToSession();
     $view = $this->getView('transportconfirm', 'html', 'BookProView');
     $view->assign('cart', $cart);
     $view->assign('trips', $cart->trips);
     $view->display();
 }
Example #11
0
    ?>
				<div class="well well-small row-fluid">	
					<label class="text-error"><?php 
    echo JText::_('COM_BOOKPRO_TRANSPORT_EMPTY_VEHICLE_WARN');
    ?>
</label>
				</div>
				<?php 
} else {
    ?>
					<?php 
    foreach ($this->vehicles as $vehicle) {
        $price_vehicle = TransportHelper::caculateVehiclePrice($vehicle, $this->trips['depart']->distance, $total_pass);
        $price = $price_vehicle['total'];
        if ($this->cart->roundtrip) {
            $price_vehicle_return = TransportHelper::caculateVehiclePrice($vehicle, $this->trips['return']->distance, $total_pass);
            $price += $price_vehicle_return['total'];
        }
        $price += $price * $this->cart->tax / 100;
        $total = $this->cart->total + $price;
        ?>
					
					<div class="well well-small row-fluid">	
						<div class="span3">
							<img class="thumbnail" src="<?php 
        echo JUri::root() . "/" . $vehicle->image;
        ?>
" alt="<?php 
        echo JText::_('COM_BOOKPRO_IMAGE');
        ?>
">
if ($cart->filter['roundtrip']) {
    $trips['return']->pickup = $cart->return_time;
    $trips['return']->dropoff = TransportHelper::Timeadd($cart->return_time, $trips['return']->duration);
    $trips['return']->flight_time = $cart->return_flight_time;
    $trips['return']->flight_number = $cart->return_flight_number;
}
?>
<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($type);
?>
</legend>

<div class="row-fluid"><strong>
<?php 
echo JText::_('COM_BOOKPRO_PASSENGERS') . ': ' . $cart->filter['adult'];
if ($cart->filter['child'] > 0) {
    echo ',&nbsp;';
    echo JText::sprintf('COM_BOOKPRO_CHILDREN_TXT', $cart->filter['child']);
}
if ($cart->filter['infant'] > 0) {
    echo ',&nbsp;';
    echo JText::sprintf('COM_BOOKPRO_INFANT_TXT', $cart->filter['infant']);
}
?>