/**
  * Display the view
  */
 public function display($tpl = null)
 {
     $lang = JFactory::getLanguage();
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->roomTypes = $this->get('RoomTypesOptions');
     $this->reservationStatuses = JHotelReservationHelper::getReservationStatuses();
     $this->paymentStatuses = JHotelReservationHelper::getPaymentStatuses();
     $hotels = $this->get('Hotels');
     $this->hotels = checkHotels(JFactory::getUser()->id, $hotels);
     //var_dump($this->hotels);
     // Check for errors.
     $layout = JRequest::getVar("layout");
     if (isset($layout)) {
         $tpl = $layout;
     }
     $this->setLayout('default');
     JHotelReservationHelper::addSubmenu('reservations');
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $this->addToolbar();
     parent::display($tpl);
 }
 function display($tpl = null)
 {
     if (JRequest::getString('task') != 'edit' && JRequest::getString('task') != 'add') {
         JToolBarHelper::title('J-HotelReservation :' . JText::_('LNG_MANAGE_ROOM_DISCOUNTS', true), 'generic.png');
         // JRequest::setVar( 'hidemainmenu', 1 );
         JHotelReservationHelper::addSubmenu('roomdiscounts');
         $hotel_id = $this->get('HotelId');
         if ($hotel_id > 0) {
             JToolBarHelper::addNew('manageroomdiscounts.edit');
             JToolBarHelper::editList('manageroomdiscounts.edit');
             JToolBarHelper::deleteList('', 'manageroomdiscounts.delete', JText::_('LNG_DELETE', true));
         }
         JToolBarHelper::custom('hotels.back', JHotelUtil::getDashBoardIcon(), 'home', JText::_('LNG_HOTEL_DASHBOARD', true), false, false);
         // dmp($hotel_id);
         $this->hotel_id = $hotel_id;
         $items = $this->get('Datas');
         $this->items = $items;
         $hotels = $this->get('Hotels');
         $hotels = checkHotels(JFactory::getUser()->id, $hotels);
         $this->hotels = $hotels;
     } else {
         $item = $this->get('Data');
         $this->item = $item;
         $hotel_id = $this->get('HotelId');
         $this->hotel_id = $hotel_id;
         $hotel = $this->get('Hotel');
         $this->hotel = $hotel;
         JToolBarHelper::title('J-Hotel Reservation : ' . ($item->discount_id > 0 ? JText::_('LNG_EDIT', true) : JText::_('LNG_ADD_NEW', true)) . ' ' . JText::_('LNG_DISCOUNT', true), 'generic.png');
         JRequest::setVar('hidemainmenu', 1);
         JToolBarHelper::cancel('manageroomdiscounts.cancel');
         JToolBarHelper::save('manageroomdiscounts.save');
         $tpl = "edit";
     }
     parent::display($tpl);
 }
 function display($tpl = null)
 {
     JHotelReservationHelper::addSubmenu('reports');
     $this->setToolbar();
     $function = $this->getLayout();
     if (method_exists($this, $function)) {
         $tpl = $this->{$function}();
     }
     $this->setLayout('default');
     parent::display($tpl);
 }
 function display($tpl = null)
 {
     $this->items = $this->get('Items');
     $this->items = checkHotels(JFactory::getUser()->id, $this->items);
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     JHotelReservationHelper::addSubmenu('hotels');
     $this->statuses = JHotelReservationHelper::getStatuses();
     $this->accomodationTypes = $this->get('AccommodationTypes');
     $this->addToolbar(count($this->items));
     parent::display($tpl);
 }
 function addToolbar()
 {
     $canDo = JHotelReservationHelper::getActions();
     JToolBarHelper::title(JText::_('LNG_APPLICATION_SETTINGS', true), 'generic.png');
     if ($canDo->get('core.create')) {
         JToolBarHelper::apply('applicationsettings.apply');
         JToolBarHelper::save('applicationsettings.save');
     }
     JToolBarHelper::cancel('applicationsettings.cancel');
     if ($canDo->get('core.admin')) {
         JToolbarHelper::preferences('com_jhotelreservation');
     }
     JHotelReservationHelper::addSubmenu('applicationsettings');
 }
 /**
  * Display the view
  */
 public function display($tpl = null)
 {
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->statuses = JHotelReservationHelper::getStatuses();
     JHotelReservationHelper::addSubmenu('paymentprocessors');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $this->addToolbar();
     parent::display($tpl);
 }
 function display($tpl = null)
 {
     if (JRequest::getString('task') == 'save' && JRequest::getString('is_save_ok') == 0) {
         if (JRequest::getString('offer_id') == 0) {
             JRequest::setVar('task', 'add');
         } else {
             JRequest::setVar('task', 'edit');
         }
     }
     if (JRequest::getString('task') != 'edit' && JRequest::getString('task') != 'add') {
         JToolBarHelper::title('J-Hotel Reservation : ' . JText::_('LNG_MANAGE_OFFERS', true), 'generic.png');
         // JRequest::setVar( 'hidemainmenu', 1 );
         $hotel_id =& $this->get('HotelId');
         JHotelReservationHelper::addSubmenu('offers');
         if ($hotel_id > 0) {
             JToolBarHelper::addNew('manageoffers.edit');
             JToolBarHelper::editList('manageoffers.edit');
             JToolBarHelper::deleteList('', 'manageoffers.delete', JText::_('LNG_DELETE', true));
         }
         JToolBarHelper::custom('back', JUtil::getDashBoardIcon(), 'home', JText::_('LNG_HOTEL_DASHBOARD', true), false, false);
         $this->hotel_id = $hotel_id;
         $items =& $this->get('Datas');
         // dbg($items);
         $this->items = $items;
         $hotels =& $this->get('Hotels');
         $hotels = checkHotels(JFactory::getUser()->id, $hotels);
         $this->hotels = $hotels;
     } else {
         $item =& $this->get('Data');
         $this->item = $item;
         $this->extraOptions = $this->get('ExtraOptions');
         $hotel_id =& $this->get('HotelId');
         $this->hotel_id = $hotel_id;
         if (JRequest::getString('is_error_save') == '1') {
             //exit;
         }
         JToolBarHelper::title('J-Hotel Reservation : ' . JText::_($item->offer_id > 0 ? "LNG_EDIT" : "LNG_ADD_NEW", true) . ' ' . JText::_('LNG_OFFER', true), 'generic.png');
         JRequest::setVar('hidemainmenu', 1);
         JToolBarHelper::apply('manageoffers.apply');
         JToolBarHelper::save('manageoffers.save');
         JToolBarHelper::custom('manageoffers.saveAsNew', 'save.png', 'save.png', 'Duplicate', false, false);
         JToolBarHelper::cancel('manageoffers.cancel');
         $this->includeFunctions();
     }
     parent::display($tpl);
 }
 protected function addToolbar()
 {
     $canDo = JHotelReservationHelper::getActions();
     JToolBarHelper::title(JText::_('LNG_MANAGE_OFFERS', true), 'generic.png');
     if ($canDo->get('core.create')) {
         JToolBarHelper::addNew('offer.edit');
         JToolBarHelper::editList('offer.edit');
     }
     JToolBarHelper::divider();
     JToolBarHelper::publish('offers.state', 'JTOOLBAR_PUBLISH', true);
     JToolBarHelper::unpublish('offers.state', 'JTOOLBAR_UNPUBLISH', true);
     if ($canDo->get('core.delete')) {
         JToolBarHelper::deleteList('', 'offers.delete', JText::_('LNG_DELETE', true));
     }
     JToolBarHelper::custom('hotels.back', JHotelUtil::getDashBoardIcon(), 'home', JText::_('LNG_HOTEL_DASHBOARD', true), false, false);
     JToolBarHelper::divider();
     JHotelReservationHelper::addSubmenu('offers');
 }
 function display($tpl = null)
 {
     $hotels = $this->get('Hotels');
     $this->hotel_id = JRequest::getVar('hotel_id');
     if ($this->hotel_id > 0) {
         $this->hotelInfo = $this->get('Hotel');
     }
     JHotelReservationHelper::addSubmenu('reviews');
     $hotels = checkHotels(JFactory::getUser()->id, $hotels);
     $this->hotels = $hotels;
     $this->items = $this->get('HotelReviews');
     JToolBarHelper::title('J-HotelReservation :' . JText::_('LNG_MANAGE_HOTEL_RATINGS', true), 'generic.png');
     if (!JRequest::getVar('layout') == 'ratingsmenu') {
         JToolBarHelper::custom('managehotelratings.menuhotelratings', JHotelUtil::getDashBoardIcon(), 'home', 'Back', false, false);
         $this->addToolbar();
     } else {
         JToolBarHelper::custom('managehotelratings.back', JHotelUtil::getDashBoardIcon(), 'home', 'Back', false, false);
     }
     parent::display($tpl);
 }
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     $canDo = JHotelReservationHelper::getActions();
     JToolBarHelper::title(JText::_('LNG_MANAGE_EXCURSIONS', true), 'menumgr.png');
     if ($canDo->get('core.create')) {
         JToolBarHelper::addNew('excursion.add');
         JToolBarHelper::editList('excursion.edit');
     }
     JToolBarHelper::divider();
     JToolBarHelper::publish('excursions.publish', 'JTOOLBAR_PUBLISH', true);
     JToolBarHelper::unpublish('excursions.unpublish', 'JTOOLBAR_UNPUBLISH', true);
     if ($canDo->get('core.delete')) {
         JToolBarHelper::deleteList('', 'excursions.delete', 'JTOOLBAR_DELETE');
     }
     JToolBarHelper::custom('hotels.back', JHotelUtil::getDashboardIcon(), 'home', JText::_('LNG_HOTEL_DASHBOARD', true), false, false);
     JToolBarHelper::divider();
     if ($canDo->get('core.admin')) {
         JToolbarHelper::preferences('com_jhotelreservation');
     }
     JToolBarHelper::help('JHELP_EXCURSION_MANAGER');
     JHotelReservationHelper::addSubmenu('excursions');
 }
 /**
  * Display the view
  */
 public function display($tpl = null)
 {
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $layout = JRequest::getVar("layout", null);
     if (isset($layout)) {
         $tpl = $layout;
     }
     JHotelReservationHelper::addSubmenu('extraoptions');
     $hotels = $this->get('Hotels');
     $this->hotels = checkHotels(JFactory::getUser()->id, $hotels);
     $this->statuses = JHotelReservationHelper::getStatuses();
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $this->hoteltranslationsModel = new JHotelReservationModelhoteltranslations();
     $this->addToolbar();
     parent::display($tpl);
 }
 /**
  * Display the view
  */
 public function display($tpl = null)
 {
     $lang = JFactory::getLanguage();
     $this->rooms = $this->get('Items');
     $this->state = $this->get('State');
     $this->roomTypes = $this->get('RoomTypesOptions');
     //set hotels
     $hotels = $this->get('Hotels');
     $this->hotels = checkHotels(JFactory::getUser()->id, $hotels);
     JHotelReservationHelper::addSubmenu('reports');
     if (PROFESSIONAL_VERSION == 1) {
         $this->types = array("simple" => "Simple Report", "advanced" => "Advanced Report");
     } else {
         $this->types = array("simple" => "Simple Report");
     }
     if (checkUserAccess(JFactory::getUser()->id, "special_offers_report") && PROFESSIONAL_VERSION == 1) {
         $this->types["offers"] = "Offers Report";
     }
     switch ($this->state->get('filter.type')) {
         case "simple":
             $this->availabilityReport = $this->get('AvailabilityReport');
             break;
         case "advanced":
             $this->availabilityReport = $this->get('DetailedAvailabilityReport');
             break;
         case "offers":
             $this->offerReport = $this->get('OfferReport');
             break;
         default:
             $this->availabilityReport = $this->get('AvailabilityReport');
             break;
     }
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     parent::display($tpl);
     $this->addToolbar();
 }
 function display($tpl = null)
 {
     if (JRequest::getString('task') != 'edit' && JRequest::getString('task') != 'add') {
         JToolBarHelper::title('J-Hotel Reservation : ' . JText::_('LNG_MANAGE_EMAILS_TEMPLATES', true), 'generic.png');
         $hotel_id = $this->get('HotelId');
         JHotelReservationHelper::addSubmenu('emailtemplates');
         if ($hotel_id > 0) {
             JToolBarHelper::addNew('manageemails.edit');
             JToolBarHelper::editList('manageemails.edit');
             JToolBarHelper::deleteList('', 'manageemails.delete', JText::_('LNG_DELETE', true));
         }
         JToolBarHelper::custom('manageemailsdefault.show', JHotelUtil::getEmailDefaultIcon(), 'home', JText::_('LNG_MANAGE_EMAILS_DEFAULT'), false, false);
         JToolBarHelper::custom('manageemails.back', JHotelUtil::getDashBoardIcon(), 'home', JText::_('LNG_HOTEL_DASHBOARD', true), false, false);
         $this->hotel_id = $hotel_id;
         $items = $this->get('Datas');
         $this->items = $items;
         $this->hoteltranslationsModel = new JHotelReservationModelhoteltranslations();
         $hotels = $this->get('Hotels');
         $hotels = checkHotels(JFactory::getUser()->id, $hotels);
         $this->hotels = $hotels;
     } else {
         $item = $this->get('Data');
         $this->item = $item;
         $hotel_id = $this->get('HotelId');
         $this->hotel_id = $hotel_id;
         $hotel = $this->get('Hotel');
         $this->hotel = $hotel;
         $hoteltranslationsModel = new JHotelReservationModelhoteltranslations();
         $this->translations = $hoteltranslationsModel->getAllTranslations(EMAIL_TEMPLATE_TRANSLATION, $this->item->email_id);
         JToolBarHelper::title('J-Hotel Reservation : ' . ($item->email_id > 0 ? JText::_('LNG_EDIT', true) : JText::_('LNG_ADD_NEW', true)) . ' ' . JText::_('LNG_EMAIL', true), 'generic.png');
         JRequest::setVar('hidemainmenu', 1);
         JToolBarHelper::apply('manageemails.apply');
         JToolBarHelper::save('manageemails.save');
         JToolBarHelper::cancel('manageemails.cancel');
     }
     parent::display($tpl);
 }