/**
  * save a record (and redirect to main page)
  * @return void
  */
 function save()
 {
     $model = $this->getModel('manageroomdiscounts');
     $post = JRequest::get('post');
     if (!isset($post['hotel_id'])) {
         $post['hotel_id'] = 0;
     }
     $post['discount_room_ids'] = implode(',', $post['discount_room_ids']);
     $post['offer_ids'] = implode(',', $post['offer_ids']);
     $post['excursion_ids'] = implode(',', $post['excursion_ids']);
     if (JHotelUtil::checkIndexKey('#__hotelreservation_discounts', array('hotel_id' => $post['hotel_id'], 'discount_name' => $post['discount_name']), 'discount_id', $post['discount_id'])) {
         $msg = '';
         JError::raiseWarning(500, JText::_('LNG_DISCOUNT_PERIOD_INTERSECT', true));
         $this->setRedirect('index.php?option=' . getBookingExtName() . '&controller=manageroomdiscounts&view=manageroomdiscounts&task=add&hotel_id=' . $post['hotel_id'], '');
     } else {
         if ($model->store($post)) {
             $msg = JText::_('LNG_DISCOUNT_SAVED', true);
             $this->setRedirect('index.php?option=' . getBookingExtName() . '&controller=manageroomdiscounts&view=manageroomdiscounts&hotel_id=' . $post['hotel_id'], $msg);
         } else {
             $msg = "";
             JError::raiseWarning(500, JText::_('LNG_ERROR_SAVING_DISCOUNT', true));
             $this->setRedirect('index.php?option=' . getBookingExtName() . '&controller=manageroomdiscounts&view=manageroomdiscounts&hotel_id=' . $post['hotel_id'], '');
         }
     }
     // Check the table in so it can be edited.... we are done with it anyway
 }
Example #2
0
 function display($tpl = null)
 {
     JToolBarHelper::title('J-Hotel Reservation' . JText::_('LNG_ABOUT', true), 'generic.png');
     // JRequest::setVar( 'hidemainmenu', 1 );
     JToolBarHelper::custom('jhotelreservation.back', JHotelUtil::getDashBoardIcon(), 'home', 'Back', false, false);
     parent::display($tpl);
 }
Example #3
0
 function display($tpl = null)
 {
     $this->hotels = $this->get("Hotels");
     $this->appSettings = JHotelUtil::getInstance()->getApplicationSettings();
     if ($this->appSettings->is_enable_reservation == 0) {
         JHotelUtil::getInstance()->showUnavailable();
     }
     //if a single hotel redirect to hotel description
     if (count($this->hotels) == 1 && ENABLE_SINGLE_HOTEL == 1) {
         $hotelLink = JHotelUtil::getHotelLink($this->hotels[0]);
         $app = JFactory::getApplication();
         $app->redirect($hotelLink);
     }
     JRequest::setVar('showFilter', 1);
     $voucher = JRequest::getVar('voucher');
     $this->voucher = $voucher;
     $pagination = $this->get('Pagination');
     $this->pagination = $pagination;
     $orderBy = JRequest::getVar('orderBy');
     $this->orderBy = $orderBy;
     $session = JFactory::getSession();
     $this->userData = $_SESSION['userData'];
     //dmp($this->userData);
     $this->searchFilter = $this->get('SearchFilter');
     parent::display($tpl);
 }
Example #4
0
 function display($tpl = null)
 {
     if (JRequest::getString('task') != 'edit' && JRequest::getString('task') != 'add') {
         JToolBarHelper::title('J-HotelReservation : ' . JText::_('LNG_MANAGE_TAXES', true), 'generic.png');
         JRequest::setVar('hidemainmenu', 1);
         $hotel_id = $this->get('HotelId');
         if ($hotel_id > 0) {
             JToolBarHelper::addNew('managetaxes.edit');
             JToolBarHelper::editList('managetaxes.edit');
             JToolBarHelper::deleteList('', 'managetaxes.delete', JText::_('LNG_DELETE', true));
             JToolBarHelper::custom('managetaxes.back', JHotelUtil::getDashBoardIcon(), 'home', JText::_('LNG_HOTEL_DASHBOARD', true), false, false);
         }
         $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->tax_id > 0 ? JText::_("LNG_EDIT", true) : JText::_("LNG_ADD_NEW", true)) . ' ' . JText::_('LNG_TAX', true), 'generic.png');
         JRequest::setVar('hidemainmenu', 1);
         JToolBarHelper::cancel('managetaxes.back');
         JToolBarHelper::save('managetaxes.save');
     }
     parent::display($tpl);
 }
Example #5
0
 function display($tpl = null)
 {
     if (JRequest::getString('task') != 'edit' && JRequest::getString('task') != 'add') {
         JToolBarHelper::title('J-Hotel Reservation : ' . JText::_('LNG_MANAGE_AIRPORT_TRANSFER_TYPES', true), 'generic.png');
         //JRequest::setVar( 'hidemainmenu', 1 );
         $hotel_id = $this->get('HotelId');
         if ($hotel_id > 0) {
             JToolBarHelper::addNew('manageairporttransfertypes.edit');
             JToolBarHelper::editList('manageairporttransfertypes.edit');
             JToolBarHelper::deleteList('', 'manageairporttransfertypes.delete', JText::_('LNG_DELETE', true));
         }
         JToolBarHelper::custom('back', JHotelUtil::getDashBoardIcon(), 'home', 'Back', false, false);
         $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->airport_transfer_type_id > 0 ? JText::_('LNG_EDIT', true) : JText::_('LNG_ADD_NEW', true)) . ' ' . JText::_('LNG_AIRPORT_TRANSFER_TYPE', true), 'generic.png');
         JRequest::setVar('hidemainmenu', 1);
         JToolBarHelper::cancel('manageairporttransfertypes.cancel');
         JToolBarHelper::save('manageairporttransfertypes.save');
     }
     parent::display($tpl);
 }
 function save()
 {
     $model = $this->getModel('manageemailsdefault');
     $post = JRequest::get('post');
     $post['email_default_content'] = JRequest::getVar('email_default_content', '', 'post', 'string', JREQUEST_ALLOWRAW);
     $task = $this->getTask();
     if (JHotelUtil::checkIndexKey('#__hotelreservation_emails_default', array('email_default_name' => $post['email_default_name']), 'email_default_id', $post['email_default_id'])) {
         $msg = '';
         JError::raiseWarning(500, JText::_('LNG_EMAIL_NAME_EXISTENT', true));
         $this->setRedirect('index.php?option=' . getBookingExtName() . '&controller=manageemailsdefault&view=manageemailsdefault&task=add', '');
     } else {
         if ($model->store($post)) {
             $post["default_email_id"] = $model->_default_email_id;
             $model->saveEmailContent($post);
         } else {
             $msg = "";
             JError::raiseWarning(500, JText::_('LNG_ERROR_SAVING_EMAIL', true));
             $this->setRedirect('index.php?option=' . getBookingExtName() . '&controller=manageemailsdefault&view=manageemailsdefault', '');
         }
     }
     switch ($task) {
         case 'apply':
             // Set the row data in the session.
             $msg = JText::_('LNG_EMAIL_SAVED', true);
             $this->setRedirect('index.php?option=' . getBookingExtName() . '&task=manageemailsdefault.edit&email_default_id[]=' . $model->_default_email_id, $msg);
             break;
         default:
             $msg = JText::_('LNG_EMAIL_SAVED', true);
             // Redirect to the list screen.
             $this->setRedirect('index.php?option=' . getBookingExtName() . '&task=manageemailsdefault.show', $msg);
             break;
     }
     // Check the table in so it can be edited.... we are done with it anyway
 }
Example #7
0
 function saveHotel()
 {
     $model = $this->getModel('hotel');
     $post = JRequest::get('post');
     $post['hotel_description'] = JRequest::getVar('hotel_description', '', 'post', 'string', JREQUEST_ALLOWRAW);
     $post['hotel_selling_points'] = JRequest::getVar('hotel_selling_points', '', 'post', 'string', JREQUEST_ALLOWRAW);
     /*------------------------------------------------------------------------------------------------------------*/
     /*MICOD
     		En éste bloque estoy concatenando los rango de las edades para insertarla en tres (3) campos diferentes
     		en la tabla (kqzro_hotelreservation_hotel_informations) de la base de datos */
     $post["niños_libre_tarifas"] = $post["edad_libre_min"] . "|" . $post["edad_libre_max"] . "|" . $post["activ_desactiv_libre"];
     $post["niños_tarifa_ajustada"] = $post["edad_tarifa_min"] . "|" . $post["edad_tarifa_max"] . "|" . $post["valor_tarifa_ajustada"] . "|" . $post["porcent_tarifa_ajustada"] . "|" . $post["activ_desactiv_ajust"];
     $post["edad_tarifa_adult"] = $post["edad_tarifa_adult"] . "|" . $post["activ_desactiv_adult"];
     /*------------------------------------------------------------------------------------------------------------*/
     if (strlen($post['hotel_website']) > 1) {
         $post['hotel_website'] = str_replace("http://", "", $post['hotel_website']);
         $post['hotel_website'] = "http://" . $post['hotel_website'];
     }
     //save images
     $pictures = array();
     foreach ($post as $key => $value) {
         if (strpos($key, 'hotel_picture_info') !== false || strpos($key, 'hotel_picture_path') !== false || strpos($key, 'hotel_picture_enable') !== false) {
             foreach ($value as $k => $v) {
                 if (!isset($pictures[$k])) {
                     $pictures[$k] = array('hotel_picture_info' => '', 'hotel_picture_path' => '', 'hotel_picture_enable' => 1);
                 }
                 $pictures[$k][$key] = $v;
             }
         }
     }
     //dmp($pictures);
     //exit;
     $post['pictures'] = $pictures;
     //dmp($post);
     //exit;
     $reservation_cost_val = $post['reservation_cost_val'];
     $reservation_cost_proc = $post['reservation_cost_proc'];
     $post['hotel_name'] = mysql_escape_string($post['hotel_name']);
     // save hotel description for each language
     if (JHotelUtil::checkIndexKey('#__hotelreservation_hotels', array('hotel_name' => $post['hotel_name']), 'hotel_id', $post['hotel_id'])) {
         $msg = JText::_('LNG_HOTEL_NAME_EXISTENT', true);
         JError::raiseWarning(500, $msg);
         //$this->setRedirect( 'index.php?option='.getBookingExtName().'&task=hotel.edit&hotel_id='.$post['hotel_id'], '' );
     } else {
         if ($model->store($post)) {
             $post["hotel_id"] = $model->_hotel_id;
             JRequest::setVar('hotel_id', $model->_hotel_id);
             $this->saveHotelDescriptions($post);
             $msg = JText::_('LNG_HOTEL_SAVED', true);
         } else {
             $msg = "";
             JError::raiseWarning(500, JText::_('LNG_ERROR_SAVING_HOTEL', true));
             $this->setRedirect('index.php?option=' . getBookingExtName() . '&controller=hotels&view=hotels&task=edit&hotel_id=' . $post['hotel_id'], '');
         }
     }
     return $msg;
 }
Example #8
0
 function addToolbar()
 {
     JToolBarHelper::title('J-HotelReservation :' . JText::_('LNG_MANAGE_RATING_QUESTIONS', true), 'generic.png');
     JToolBarHelper::addNew('managehotelratings.editratingquestion', 'New');
     JToolBarHelper::editList('managehotelratings.editratingquestion', 'Edit');
     JToolBarHelper::deleteList('', 'managehotelratings.deleteratingquestions', JText::_('LNG_DELETE', true));
     JToolBarHelper::custom('managehotelratings.menuhotelratings', JHotelUtil::getDashBoardIcon(), 'home', JText::_('LNG_BACK', true), false, false);
     JToolBarHelper::custom('managehotelratings.back', JHotelUtil::getDashBoardIcon(), 'home', JText::_('LNG_HOTEL_DASHBOARD', true), false, false);
 }
Example #9
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     $canDo = JHotelReservationHelper::getActions();
     JToolBarHelper::title(JText::_('LNG_AVAILABILITY_SECTION', true), 'menumgr.png');
     JToolBarHelper::apply('availability.saveHotelAvailability');
     JToolBarHelper::custom('hotels.back', JHotelUtil::getDashboardIcon(), 'home', JText::_('LNG_HOTEL_DASHBOARD', true), false, false);
     JToolBarHelper::divider();
     JToolBarHelper::help('JHELP_ROOM_MANAGER');
 }
Example #10
0
 function includeFunctions()
 {
     $doc = JFactory::getDocument();
     $doc->addStyleSheet('components/' . getBookingExtName() . '/assets/js/validation/css/validationEngine.jquery.css');
     $tag = JHotelUtil::getJoomlaLanguage();
     $doc->addScript('components/' . getBookingExtName() . '/assets/js/validation/js/languages/jquery.validationEngine-' . $tag . '.js');
     $doc->addScript('components/' . getBookingExtName() . '/assets/js/validation/js/jquery.validationEngine.js');
     $doc->addScript('components/' . getBookingExtName() . '/assets/js/jquery.selectlist.js');
 }
Example #11
0
 function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('LNG_COM_JHOTEL_RESERVATION', true), 'generic.png');
     $this->includeCharts();
     if (JRequest::getVar('task') == "menu_airport_transfer") {
         JToolBarHelper::title(JText::_('LNG_AIRPORT_TRANSFER', true), 'generic.png');
         JToolBarHelper::custom('back', JHotelUtil::getDashBoardIcon(), 'home', JText::_('LNG_HOTEL_DASHBOARD', true), false, false);
     }
     parent::display($tpl);
 }
Example #12
0
 function display($tpl = null)
 {
     $this->extraOptions = $this->get("ExtraOptions");
     $this->state = $this->get('State');
     $this->userData = UserDataService::getUserData();
     $this->hotel = HotelService::getHotel($this->userData->hotelId);
     $this->appSettings = JHotelUtil::getInstance()->getApplicationSettings();
     //dmp($this->userData);
     parent::display($tpl);
 }
Example #13
0
 function changeSearch()
 {
     //$log = Logger::getInstance(JPATH_COMPONENT."/logs/site-log-".date("d-m-Y").'.log',1);
     //	$log->LogDebug("changeSearch");
     UserDataService::initializeUserData();
     $data = JRequest::get("post");
     UserDataService::initializeReservationData();
     $hotel = HotelService::getHotel($data["hotel_id"]);
     $link = JHotelUtil::getHotelLink($hotel);
     $this->setRedirect($link);
 }
Example #14
0
 /**
  * Add the page title and toolbar.
  *
  * @since   1.6
  */
 protected function addToolbar()
 {
     JToolBarHelper::title('J-HotelReservation : ' . JText::_('LNG_EXTRA_OPTION', true), 'generic.png');
     JToolbarHelper::addNew('extraoption.add');
     JToolBarHelper::custom('extraoptions.addDefault', 'new.png', 'new.png', JText::_('LNG_ADD_FROM_DEFAULT', true), false, false);
     JToolbarHelper::editList('extraoption.edit');
     JToolbarHelper::divider();
     JToolbarHelper::deleteList('', 'extraoptions.delete');
     JToolbarHelper::divider();
     JToolBarHelper::custom('extraoptions.back', JHotelUtil::getDashBoardIcon(), 'preview.png', JText::_('LNG_HOTEL_DASHBOARD', true), false, false);
     JToolbarHelper::help('JHELP_COMPANIES');
 }
Example #15
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     JToolBarHelper::title(JText::_('LNG_MANAGE_RESERVATIONS', true), 'menumgr.png');
     JToolBarHelper::addNew('reservation.add');
     JToolBarHelper::editList('reservation.edit');
     JToolBarHelper::deleteList('', 'reservations.delete', 'JTOOLBAR_DELETE');
     JToolBarHelper::custom('reservations.exportToCSV', JHotelUtil::getExportIcon(), 'home', JText::_('LNG_EXPORT_CSV'), false, false);
     //JToolBarHelper::custom('reservations.cancelFromCsv', 'cancel', 'cancel', JText::_('LNG_BATCH_CANCEL'), false, false );
     JToolBarHelper::custom('jhotelreservation.back', JHotelUtil::getDashBoardIcon(), 'home', JText::_('LNG_HOTEL_DASHBOARD', true), false, false);
     JToolBarHelper::divider();
     JToolBarHelper::help('JHELP_ROOM_MANAGER');
 }
 function back()
 {
     UserDataService::removeLastRoom();
     $userData = UserDataService::getUserData();
     if ($userData->hotelId > 0) {
         $hotel = HotelService::getHotel($userData->hotelId);
         $link = JHotelUtil::getHotelLink($hotel);
     } else {
         $link = JRoute::_('index.php?option=com_jhotelreservation&task=excursionslisting.searchExcursions', false);
         UserDataService::initializeExcursions();
     }
     $this->setRedirect($link);
 }
 function getReservationDetails()
 {
     $userData = UserDataService::getUserData();
     $reservationData = new stdClass();
     $reservationData->userData = $userData;
     $reservationData->appSettings = JHotelUtil::getInstance()->getApplicationSettings();
     $reservationData->hotel = HotelService::getHotel($userData->hotelId);
     $reservationService = new ReservationService();
     $reservationDetails = $reservationService->generateReservationSummary($reservationData);
     UserDataService::setReservationDetails($reservationDetails);
     $reservationDetails->reservationData = $reservationData;
     return $reservationDetails;
 }
Example #18
0
 function display($tpl = null)
 {
     $this->item = JHotelUtil::getApplicationSettings();
     $this->items = $this->get('Items');
     $this->currentVersion = $this->get('CurrentVersion');
     $this->expirationDate = $this->get('ExpirationDate');
     JToolBarHelper::title('J-Hotel Reservation ' . JText::_('LNG_UPDATES', true), 'generic.png');
     JToolbarHelper::custom('updates.saveOrder', 'save', 'save', 'LNG_SAVE_ORDER', true, false);
     JToolbarHelper::custom('updates.update', 'upload', 'upload', 'COM_INSTALLER_TOOLBAR_UPDATE', true, false);
     JToolbarHelper::custom('updates.find', 'refresh', 'refresh', 'COM_INSTALLER_TOOLBAR_FIND_UPDATES', false, false);
     JToolbarHelper::divider();
     JToolBarHelper::custom('jhotelreservation.back', JHotelUtil::getDashBoardIcon(), 'home', JText::_('LNG_HOTEL_DASHBOARD', true), false, false);
     parent::display($tpl);
 }
 function saveHotel()
 {
     $model = $this->getModel('hotel');
     $post = JRequest::get('post');
     $post['hotel_description'] = JRequest::getVar('hotel_description', '', 'post', 'string', JREQUEST_ALLOWRAW);
     $post['hotel_selling_points'] = JRequest::getVar('hotel_selling_points', '', 'post', 'string', JREQUEST_ALLOWRAW);
     if (strlen($post['hotel_website']) > 1) {
         $post['hotel_website'] = str_replace("http://", "", $post['hotel_website']);
         $post['hotel_website'] = "http://" . $post['hotel_website'];
     }
     //save images
     $pictures = array();
     foreach ($post as $key => $value) {
         if (strpos($key, 'hotel_picture_info') !== false || strpos($key, 'hotel_picture_path') !== false || strpos($key, 'hotel_picture_enable') !== false) {
             foreach ($value as $k => $v) {
                 if (!isset($pictures[$k])) {
                     $pictures[$k] = array('hotel_picture_info' => '', 'hotel_picture_path' => '', 'hotel_picture_enable' => 1);
                 }
                 $pictures[$k][$key] = $v;
             }
         }
     }
     //dmp($pictures);
     //exit;
     $post['pictures'] = $pictures;
     //dmp($post);
     //exit;
     $reservation_cost_val = $post['reservation_cost_val'];
     $reservation_cost_proc = $post['reservation_cost_proc'];
     $post['hotel_name'] = mysql_escape_string($post['hotel_name']);
     // save hotel description for each language
     if (JHotelUtil::checkIndexKey('#__hotelreservation_hotels', array('hotel_name' => $post['hotel_name']), 'hotel_id', $post['hotel_id'])) {
         $msg = JText::_('LNG_HOTEL_NAME_EXISTENT', true);
         JError::raiseWarning(500, $msg);
         //$this->setRedirect( 'index.php?option='.getBookingExtName().'&task=hotel.edit&hotel_id='.$post['hotel_id'], '' );
     } else {
         if ($model->store($post)) {
             $post["hotel_id"] = $model->_hotel_id;
             JRequest::setVar('hotel_id', $model->_hotel_id);
             $this->saveHotelDescriptions($post);
             $msg = JText::_('LNG_HOTEL_SAVED', true);
         } else {
             $msg = "";
             JError::raiseWarning(500, JText::_('LNG_ERROR_SAVING_HOTEL', true));
             $this->setRedirect('index.php?option=' . getBookingExtName() . '&controller=hotels&view=hotels&task=edit&hotel_id=' . $post['hotel_id'], '');
         }
     }
     return $msg;
 }
Example #20
0
 /**
  * Display the view
  */
 public function display($tpl = null)
 {
     //$this->form	= $this->get('Form');
     $this->items = $this->get('Items');
     $this->state = $this->get('State');
     $this->rate = $this->get('Rate');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $this->appSettings = JHotelUtil::getInstance()->getApplicationSettings();
     parent::display($tpl);
     $this->addToolbar();
 }
 function __construct()
 {
     $this->searchFilter = JRequest::getVar('searchkeyword');
     parent::__construct();
     $this->_total = 0;
     $mainframe = JFactory::getApplication();
     // Get pagination request variables
     $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
     $limitstart = JRequest::getVar('limitstart', 0, '', 'int');
     // In case limit has been changed, adjust it
     $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
     $this->setState('limit', $limit);
     $this->setState('limitstart', $limitstart);
     $this->appSettings = JHotelUtil::getApplicationSettings();
 }
Example #22
0
 function display($tpl = null)
 {
     $this->hotel = $this->get("Item");
     $this->state = $this->get('State');
     $this->offers = $this->get("Offers");
     $this->rooms = $this->get("Rooms");
     $this->appSettings = JHotelUtil::getInstance()->getApplicationSettings();
     if ($this->appSettings->is_enable_reservation == 0) {
         JHotelUtil::getInstance()->showUnavailable();
     }
     $this->userData = UserDataService::getUserData();
     $this->currencies = CurrencyService::getAllCurrencies();
     //dmp($this->userData);
     parent::display($tpl);
 }
 public function getReservationDetails()
 {
     $reservationDetails = null;
     $id = JRequest::getVar('confirmation_id');
     $reservationDetails->confirmation_id = $id;
     $table = $this->getTable('Confirmations', 'Table');
     $table->load($id);
     $hotelService = new HotelService();
     $hotel = $hotelService->getHotel($table->hotel_id);
     $reservationDetails->hotelDetails = $hotel->hotel_name . ", " . $hotel->hotel_address . ", " . $hotel->hotel_city . ", " . $hotel->country_name;
     $reservationDetails->arrivalDate = JHotelUtil::getDateGeneralFormat($table->start_date);
     $reservationDetails->returnDate = JHotelUtil::getDateGeneralFormat($table->end_date);
     $reservationDetails->bookingPerson = $table->first_name . ", " . $table->last_name;
     $reservationDetails->hotelId = $table->hotel_id;
     return $reservationDetails;
 }
Example #24
0
 function display($tpl = null)
 {
     $this->state = $this->get('State');
     $this->reservationDetails = $this->get("ReservationDetails");
     $this->paymentMethods = $this->get('paymentMethods');
     $this->guestTypes = JHotelReservationHelper::getGuestTypes();
     $this->userData = UserDataService::getUserData();
     $this->hotel = HotelService::getHotel($this->userData->hotelId);
     $this->appSettings = JHotelUtil::getInstance()->getApplicationSettings();
     $doc = JFactory::getDocument();
     $tag = JHotelUtil::getJoomlaLanguage();
     $doc->addStyleSheet('administrator/components/' . getBookingExtName() . '/assets/js/validation/css/validationEngine.jquery.css');
     $doc->addScript('administrator/components/' . getBookingExtName() . '/assets/js/validation/js/languages/jquery.validationEngine-' . $tag . '.js');
     $doc->addScript('administrator/components/' . getBookingExtName() . '/assets/js/validation/js/jquery.validationEngine.js');
     parent::display($tpl);
 }
Example #25
0
 /**
  * Display the view
  */
 public function display($tpl = null)
 {
     $lang = JFactory::getLanguage();
     $this->item = $this->get('Item');
     $this->state = $this->get('State');
     $this->appSettings = JHotelUtil::getInstance()->getApplicationSettings();
     $this->roomTypes = $this->get('RoomTypesOptions');
     $this->guestTypes = JHotelReservationHelper::getGuestTypes();
     $hotels = $this->get('Hotels');
     $this->hotels = checkHotels(JFactory::getUser()->id, $hotels);
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     parent::display($tpl);
     $this->addToolbar();
 }
Example #26
0
 function display($tpl = null)
 {
     $this->appSettings = JHotelUtil::getInstance()->getApplicationSettings();
     $this->userData = $_SESSION['userData'];
     //dmp($this->userData);
     $this->searchFilter = $this->get('SearchFilter');
     if (!$this->appSettings->enable_excursions) {
         $app = JFactory::getApplication();
         $app->enqueueMessage(JText::_("LNG_EXCURSIONS_COURSES_DISABLED"), 'warning');
     }
     // get the menu parameters for use
     $type = JRequest::getVar("excursion_type");
     if (method_exists($this, $type)) {
         $tpl = $this->{$type}();
     }
     $this->setLayout('default');
     parent::display($tpl);
 }
Example #27
0
 function includeFunctions()
 {
     $doc = JFactory::getDocument();
     $doc->addStyleSheet('components/' . getBookingExtName() . '/assets/js/validation/css/validationEngine.jquery.css');
     $doc->addStyleSheet('components/' . getBookingExtName() . '/assets/js/validation/css/template.css');
     $doc->addStyleSheet('components/' . getBookingExtName() . '/assets/js/datepicker/css/datepicker.css');
     $doc->addStyleSheet('components/' . getBookingExtName() . '/assets/js/datepicker/css/layout.css');
     $doc->addScript('components/' . getBookingExtName() . '/assets/js/jquery.selectlist.js');
     $doc->addScript('components/' . getBookingExtName() . '/assets/js/manageHotels.js');
     $doc->addScript('components/' . getBookingExtName() . '/assets/js/datepicker/js/eye.js');
     $doc->addScript('components/' . getBookingExtName() . '/assets/js/datepicker/js/datepicker.js');
     $doc->addScript('components/' . getBookingExtName() . '/assets/js/datepicker/js/utils.js');
     $doc->addScript('components/' . getBookingExtName() . '/assets/js/datepicker/js/layout.js');
     $doc->addScript('components/' . getBookingExtName() . '/assets/js/jquery.upload.js');
     $tag = JHotelUtil::getJoomlaLanguage();
     $doc->addScript('components/' . getBookingExtName() . '/assets/js/validation/js/languages/jquery.validationEngine-' . $tag . '.js');
     $doc->addScript('components/' . getBookingExtName() . '/assets/js/validation/js/jquery.validationEngine.js');
 }
Example #28
0
 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');
 }
Example #29
0
 function display($tpl = null)
 {
     $this->rooms = $this->get("AllRooms");
     $this->appSettings = JHotelUtil::getInstance()->getApplicationSettings();
     if ($this->appSettings->is_enable_reservation == 0) {
         JHotelUtil::getInstance()->showUnavailable();
     }
     JRequest::setVar('showFilter', 0);
     $voucher = JRequest::getVar('voucher');
     $this->voucher = $voucher;
     $pagination = $this->get('Pagination');
     $this->pagination = $pagination;
     $orderBy = JRequest::getVar('orderBy');
     $this->orderBy = $orderBy;
     $session = JFactory::getSession();
     $this->userData = $_SESSION['userData'];
     $this->searchFilter = $this->get('SearchFilter');
     parent::display($tpl);
 }
Example #30
0
 function addToolbar($nrHotels)
 {
     $canDo = JHotelReservationHelper::getActions();
     JToolBarHelper::title('J-HotelReservation : ' . JText::_('LNG_MANAGE_HOTELS', true), 'generic.png');
     JRequest::setVar('hidemainmenu', 0);
     if ($canDo->get('core.create') && (ENABLE_SINGLE_HOTEL != 1 || $nrHotels == 0)) {
         JToolBarHelper::addNew('hotel.edit');
     }
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('hotel.edit');
     }
     if ($canDo->get('core.delete')) {
         JToolBarHelper::deleteList('', 'hotels.delete', JText::_('LNG_DELETE', true));
     }
     JToolBarHelper::divider();
     JToolBarHelper::custom('hotels.back', JHotelUtil::getDashBoardIcon(), 'home', JText::_('LNG_HOTEL_DASHBOARD', true), false, false);
     if ($canDo->get('core.admin')) {
         JToolbarHelper::preferences('com_jhotelreservation');
     }
 }