<?php

defined('_JEXEC') or die('Restricted access');
AImporter::model('addons');
AImporter::helper('bookpro');
$params = json_decode($this->tour->tour->params);
$model = new BookProModeladdons();
$addons = $model->getDataByIds($params->addon);
?>
<script type="text/javascript">

jQuery(document).ready(function($){	
    jQuery(".addonClick").click(function(){
           	var addon= new Array();
           	  $('.addonClick').each(function(){
           			if(jQuery(this).is(':checked')){
           				addon.push(jQuery(this).val());
	           		}
	          });
	          
     		  jQuery.ajax({
  				type : "POST",
  				 url: 'index.php?option=com_bookpro&controller=tour&task=ajaxcaculateaddon', 
  				data : {  					
  					addon:	addon,
  				},
				beforeSend : function() {
					$("#cart_total").html('...');
				},			  				
  				success : function(result) {	
  					$("#cart_total").html(result);	
		</div>
		<div id="collapse-addon" class="accordion-body collapse in">
	     	 <div class="accordion-inner row-fluid">
		     	 <div class="form-inline span6" style="margin: 0 10px 0 0;" >
					<legend><span><?php 
echo $this->trips['depart']->from->title . ' &#10137; ' . $this->trips['depart']->to->title;
?>
</span></legend>
		     	 	<?php 
if (count($service_depart) > 0) {
    ?>
								<?php 
    foreach ($service_depart as $key => $sv) {
        if (!empty($sv)) {
            $text = 'COM_BOOKPRO_TRANSPORT_SERVICE_' . strtoupper($key);
            $addons = $model->getDataByIds($sv);
            ?>
										<h4><span><?php 
            echo JText::_($text);
            ?>
</span></h4>
										<?php 
            foreach ($addons as $ad) {
                ?>
											<div class="control-group">
												<label class="control-label">
													<input type="checkbox" name="depart_addon[]" value="<?php 
                echo $ad->id;
                ?>
" class="addonClick"/>
													<?php 
Esempio n. 3
0
	  				<div class="span5">
	  				  <?php 
    $layout = new JLayoutFile('calendar', $basePath = JPATH_ROOT . '/components/com_bookpro/layouts');
    $html = $layout->render($this->tour);
    echo $html;
    ?>
					</div>
					<div class="span7">
							<span id="tourpackagefordate">
							</span>	
							
								<?php 
    AImporter::model('addons');
    $model = new BookProModeladdons();
    if ($this->tour->addon) {
        $addons = $model->getDataByIds($this->tour->addon);
    }
    $html_addon = null;
    if (count($addons) > 0) {
        foreach ($addons as $key => $addon) {
            $checked = $addon->params ? json_decode($addon->params)->type : null;
            if ($checked == 1) {
                $html_addon .= "<li>" . $addon->title . '-' . JText::sprintf('COM_BOOKPRO_PRICE_TXT', CurrencyHelper::displayPrice($addon->price, 0)) . "</li>";
            }
        }
    }
    if (count($html_addon) > 0) {
        ?>
										<div>
										<label><?php 
        echo JText::_('COM_BOOKPRO_COMPULSORY_FEE');