Пример #1
0
 function display($tpl = null)
 {
     $this->config = JBFactory::getConfig();
     $input = JFactory::getApplication()->input;
     AImporter::model('tour');
     $cart = JModelLegacy::getInstance('TourCart', 'bookpro');
     $cart->load();
     $cart->clear();
     $model = new BookProModelTour();
     $id = $input->getInt('id');
     $this->tour = $model->getComplexItem($id);
     $this->itineraries = TourHelper::buildItinerary($id);
     //$this->packages	= $packages;
     $date = TourHelper::getDateFirstInPackagerateFromTourid($this->tour->id);
     $this->date = JFactory::getDate($date)->format(DateHelper::getConvertDateFormat('P'));
     $this->tour->rdate = $this->date;
     $dispatcher = JDispatcher::getInstance();
     //$this->_prepareDocument();
     //		$dispatcher		= JDispatcher::getInstance();
     //		$this->event 	= new stdClass();
     //		JPluginHelper::importPlugin('bookpro');
     //		$results 		= $dispatcher->trigger('onBookproProductAfterTitle', array ($this->tour));
     //		$this->event->afterDisplayTitle=isset($results[0])?$results[0]:null;
     parent::display($tpl);
 }
Пример #2
0
 function display($tpl = null)
 {
     $document = JFactory::getDocument();
     $document->addScript(JUri::base() . 'components/com_bookpro/assets/js/pncalendar.js');
     $tour_id = JFactory::getApplication()->input->get('tour_id');
     $model = new BookProModelTour();
     $this->tour = $model->getObjectFullById($tour_id);
     parent::display($tpl);
 }
Пример #3
0
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $input = $app->input;
     $this->tour_id = $input->get('tour_id', 0);
     $this->date = $input->get('date', null);
     $model = new BookProModelTourRate();
     $this->rates = $model->getRateTour($this->tour_id, $this->date);
     $tour_model = new BookProModelTour();
     $this->tour = $tour_model->getItem($this->tour_id);
     parent::display($tpl);
 }
Пример #4
0
 function display($tpl = null)
 {
     $this->state = $this->get('State');
     AImporter::model('tour');
     $tourModel = new BookProModelTour();
     $tour = $tourModel->getItem($this->state->get('filter.obj_id'));
     $this->title = 'Room';
     $this->text = $tour->title;
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->addToolbar();
     parent::display($tpl);
 }
Пример #5
0
 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $this->depart = $app->getUserStateFromRequest('booking.depart', 'depart', '');
     $input = JFactory::getApplication()->input;
     $this->tour_id = $input->get('id', '', 'int');
     $tourModel = new BookProModelTour();
     $this->tour = $tourModel->getItem($this->tour_id);
     $this->document = JFactory::getDocument();
     $user = JFactory::getUser();
     $this->document->setTitle(JText::_('COM_BOOKPRO_REGISTER_VIEW'));
     $rowFields = TourHelper::getCustomfieldsByInquiry();
     $form = new RADForm($rowFields, null, '');
     $this->fields = $form->getFields();
     parent::display($tpl);
 }
Пример #6
0
 /**
  * Prepare to display page.
  * 
  * @param string $tpl name of used template
  */
 function display($tpl = null)
 {
     $mainframe =& JFactory::getApplication();
     /* @var $mainframe JApplication */
     $document =& JFactory::getDocument();
     /* @var $document JDocument */
     $document->setTitle(JText::_('List of roomrates'));
     $model = new BookProModelRoomRateLogs();
     $this->lists = array();
     $this->lists['limit'] = ARequest::getUserStateFromRequest('limit', $mainframe->getCfg('list_limit'), 'int');
     $this->lists['limitstart'] = ARequest::getUserStateFromRequest('limitstart', 0, 'int');
     $this->lists['order'] = ARequest::getUserStateFromRequest('filter_order', 'id', 'cmd');
     $this->lists['order_Dir'] = ARequest::getUserStateFromRequest('filter_order_Dir', 'DESC', 'word');
     //$this->lists['hotel_id'] = ARequest::getUserStateFromRequest('hotel_id', '', 'int');
     $model->init($this->lists);
     $this->pagination =& $model->getPagination();
     $this->items =& $model->getData();
     if (count($this->items) > 0) {
         for ($i = 0; $i < count($this->items); $i++) {
             $item =& $this->items[$i];
             $modelRoom = new BookProModelTour();
             $modelRoom->setId($item->tour_id);
             $room = $modelRoom->getObject();
             if ($room) {
                 $item->tour_id = $room->room_type;
             }
             $startdate = '';
             if ($item->startdate != '0000-00-00 00:00:00') {
                 $startdate = JFactory::getDate($item->startdate)->format('d F Y');
             }
             $item->startdate = $startdate;
             $enddate = '';
             if ($item->enddate != '0000-00-00 00:00:00') {
                 $enddate = JFactory::getDate($item->enddate)->format('d F Y');
             }
             $item->enddate = $enddate;
         }
     }
     $this->params =& JComponentHelper::getParams(OPTION);
     $this->selectable = JRequest::getCmd('task') == 'element';
     parent::display($tpl);
 }
Пример #7
0
 private function getComplextour($order)
 {
     $object = new JObject();
     $db = JFactory::getDbo();
     // get Customer and Country name
     $query = $db->getQuery(true);
     $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);
     $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);
     $orderinfo = $db->loadObjectList();
     //get tour info
     AImporter::model('tour');
     $model = new BookProModelTour();
     $tour = $model->getItem($orderinfo[0]->route_id);
     $tour->start = $orderinfo[0]->start;
     //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);
     $passengers = $db->loadObjectList();
     $object->order = $order;
     $object->customer = $customer;
     $object->orderinfo = $orderinfo;
     $object->tour = $tour;
     $object->passengers = $passengers;
     $object->addons = $this->getAddon($order->id);
     return $object;
 }
Пример #8
0
				<?php 
if ($date) {
    ?>
	
				 	<?php 
    echo JText::sprintf('COM_BOOKPRO_DATE_SPRINTF', JFactory::getDate($date)->format('d-m-Y'));
    ?>
<br />
				<?php 
}
?>

				<?php 
if ($tour_id) {
    AImporter::model('tour');
    $tourModel = new BookProModelTour();
    $tour = $tourModel->getItem($tour_id);
    ?>
	
				 	<?php 
    echo JText::_('COM_BOOKPRO_TOUR') . ':' . $tour->title;
    ?>
<br />
				<?php 
}
?>

				<?php 
if ($search) {
    ?>
	
Пример #9
0
 static function getTourAddon($tour_id)
 {
     AImporter::model('tour');
     $model = new BookProModelTour();
     $exComplex = $model->getComplexItem($tour_id);
     $return = null;
     if (isset($exComplex->addons)) {
         $items = $exComplex->addons;
         $iti_sum = array();
         $dest_ids = array();
         if (count($items) > 0) {
             for ($i = 0; $i < count($items); $i++) {
                 $iti_sum[] = '<span class="label">' . $items[$i]->title . '</span>';
             }
         }
         $return = implode('&nbsp;', $iti_sum);
     }
     return $return;
 }