Пример #1
0
 /**
  *  Displays the list view
  * @param string $tpl
  */
 public function display($tpl = null)
 {
     $tour_model = new BookProModelTours();
     $this->state = $this->get('State');
     $input = JFactory::getApplication()->input;
     $this->tours = $tour_model->getItemByIds();
     $tour_id = $this->state->get('filter.tour_id');
     if (empty($tour_id)) {
         $this->state->set('filter.tour_id', $this->tours[0]->id);
     }
     $from_date = $this->state->get('filter.from_date');
     if (empty($from_date)) {
         $this->state->set('filter.from_date', JHtml::date('now', 'Y-m-d'));
     }
     $to_date = $this->state->get('filter.to_date');
     if (empty($to_date)) {
         $this->state->set('filter.to_date', JHtml::date('now', 'Y-m-d'));
     }
     $this->state->set('filter.order_status', 'CONFIRMED');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->total_order = $this->get('TotalBooking');
     $this->total_pass = $this->get('Total');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $this->addToolbar();
     parent::display($tpl);
 }
Пример #2
0
 static function getListTour($params)
 {
     $xheight = $params->get('iheight', 200);
     $xwidth = $params->get('iwidth', 200);
     require_once JPATH_ROOT . '/administrator/components/com_bookpro/models/tours.php';
     $source = $params->get('source', 'latest');
     $model = new BookProModelTours();
     $state = $model->getState();
     $state->set('filter.days', $params->get('duration', null));
     $state->set('filter.cat_id', $params->get('cat_id', null));
     $state->set('filter.dest_id', $params->get('dest_id', null));
     $state->set('filter.featured', $params->get('featured', null));
     $state->set('list.limit', $params->get('count', null));
     $state->set('list.start', 0);
     $state->set('filter.state', 1);
     $data = $model->getItems();
     $config = JComponentHelper::getParams('com_bookpro');
     $itemId = $params->get('Itemid');
     foreach ($data as $i => $row) {
         $data[$i]->text = $data[$i]->description;
         $data[$i]->title = $row->title;
         $data[$i]->link = JRoute::_('index.php?option=com_bookpro&view=tour&id=' . $data[$i]->id . '&Itemid=' . $itemId);
         if ($data[$i]->img_path) {
             $thumb = AImage::thumb($data[$i]->img_path, $xwidth, $xheight);
         } else {
             $ipath = 'components/com_bookpro/assets/images/no_image.jpg';
             $thumb = AImage::thumb($ipath, $xwidth, $xheight);
         }
         $data[$i]->image_html = '<img src="' . $thumb . '">';
     }
     return $data;
 }
Пример #3
0
 public function display($tpl = null)
 {
     if (!$this->is_admin) {
         $model = new BookproModelpassengers();
         $this->setModel($model, true);
     }
     $this->state = $this->get('State');
     $tour_model = new BookProModelTours();
     $this->tours = $tour_model->getItemByIds();
     $tour_id = $this->state->get('filter.tour_id');
     if (empty($tour_id)) {
         $this->state->set('filter.tour_id', $this->tours[0]->id);
     }
     $from_date = $this->state->get('filter.from_date');
     if (empty($from_date)) {
         $this->state->set('filter.from_date', JHtml::date('now', 'Y-m-d'));
     }
     $to_date = $this->state->get('filter.to_date');
     if (empty($to_date)) {
         $this->state->set('filter.to_date', JHtml::date('now', 'Y-m-d'));
     }
     $this->state->set('filter.order_status', 'CONFIRMED');
     $this->state->set('list.limit', null);
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->total_order = $this->get('TotalBooking');
     $this->total_pass = $this->get('Total');
     $this->agent = JBFactory::getAccount();
     $this->authorise = $this->agent->authorise;
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     JHtml::_('formbehavior.chosen', 'select');
     parent::display($tpl);
 }
Пример #4
0
			<legend><?php 
    echo $this->title;
    ?>
</legend>
<?php 
}
?>

<div class="row-fluid">
    <?php 
$i = 0;
foreach ($this->destinations as $dest) {
    $link = JRoute::_('index.php?option=com_bookpro&view=tours&dest_id=' . $dest->id . '&Itemid=' . $this->tour_itemid);
    //$ipath = BookProHelper::getIPath($dest->image);
    $thumb = AImage::thumb($dest->image, $this->width, $this->height);
    $model = new BookProModelTours();
    $state = $model->getState();
    $state->set('list.start', 0);
    $state->set('list.limit', 0);
    $state->set('filter.state', 1);
    $state->set('filter.dest_id', $dest->id);
    $numberTours = count($model->getItems());
    if ($i == 0) {
        echo '<div class="row-fluid">';
    }
    ?>
    <div class="span<?php 
    echo 12 / $this->products_per_row;
    ?>
">
        <div class="content_hotels_products">