function display($tpl = null)
 {
     $vehicles = $this->cart->type == 1 ? $this->trips['depart']->private_vehicle : $this->trips['depart']->share_vehicle;
     if (!empty($vehicles)) {
         $vehicles = explode(';', $vehicles);
         $this->vehicles = VehicleHelper::getItems($vehicles);
     } else {
         $this->vehicles = false;
     }
     $this->config = JComponentHelper::getParams('com_bookpro');
     parent::display($tpl);
 }
<?php

/**
 * @package 	Bookpro
 * @author 		Ngo Van Quan
 * @link 		http://joombooking.com
 * @copyright 	Copyright (C) 2011 - 2012 Ngo Van Quan
 * @license 	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 * @version 	$Id: default.php 81 2012-08-11 01:16:36Z quannv $
 **/
defined('_JEXEC') or die('Restricted access');
AImporter::helper('vehicle');
$vehicle_list = VehicleHelper::getItems();
$private = explode(';', $displayData->private_vehicle);
$share = explode(';', $displayData->share_vehicle);
?>
<div class="row-fluid">
	<div class="span6">
		<h2><?php 
echo Jtext::_('COM_BOOKPRO_PRIVATE');
?>
</h2>
		<?php 
foreach ($vehicle_list as $li) {
    ?>
			<label class="help-inline clearfix">
				<input type="checkbox" name="vehicle[private][]" value="<?php 
    echo $li->id;
    ?>
" <?php 
    echo in_array($li->id, $private) ? 'checked' : '';
 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();
 }
<?php

/**
 * @package 	Bookpro
 * @author 		Ngo Van Quan
 * @link 		http://joombooking.com
 * @copyright 	Copyright (C) 2011 - 2012 Ngo Van Quan
 * @license 	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 * @version 	$Id: default.php 81 2012-08-11 01:16:36Z quannv $
 **/
defined('_JEXEC') or die('Restricted access');
AImporter::helper('vehicle', 'math');
$parking_price = json_decode($displayData);
$list_type = VehicleHelper::getTypeList();
?>
<div class="row-fluid">
	<table>
		<?php 
foreach ($list_type as $li) {
    $price = MathHelper::filterArrayObject($parking_price, 'type', $li->id);
    ?>
			<tr>
				<td><?php 
    echo $li->title;
    ?>
</td>
				<td>
					<input type="text" class="input-mini" name="parking[price][]" value="<?php 
    echo $price->price;
    ?>
"/>