Ejemplo n.º 1
0
 /**
  * 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);
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
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');
 }
Ejemplo n.º 4
0
 function addToolbar($item)
 {
     $canDo = JHotelReservationHelper::getActions();
     JRequest::setVar('hidemainmenu', 1);
     if ($canDo->get('core.create') && ($item->hotel_state == 0 || isSuperUser(JFactory::getUser()->id))) {
         JToolBarHelper::apply('hotel.apply');
         JToolBarHelper::save('hotel.save');
     }
     JToolBarHelper::cancel('hotel.cancel');
 }
Ejemplo n.º 5
0
 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);
 }
Ejemplo n.º 6
0
 protected function addToolbar()
 {
     $canDo = JHotelReservationHelper::getActions();
     JRequest::setVar('hidemainmenu', 1);
     if ($this->item->state == 0 || isSuperUser(JFactory::getUser()->id)) {
         if ($canDo->get('core.create')) {
             JToolBarHelper::apply('offer.apply');
             JToolBarHelper::save('offer.save');
             JToolBarHelper::custom('offer.saveAsNew', 'save.png', 'save.png', 'Duplicate', false, false);
         }
     }
     JToolBarHelper::cancel('offer.cancel');
 }
Ejemplo n.º 7
0
 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');
 }
Ejemplo n.º 8
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);
 }
Ejemplo n.º 9
0
 /**
  * Add the page title and toolbar.
  *
  * @since   1.6
  */
 protected function addToolbar()
 {
     $canDo = JHotelReservationHelper::getActions();
     $user = JFactory::getUser();
     $input = JFactory::getApplication()->input;
     $input->set('hidemainmenu', true);
     $user = JFactory::getUser();
     $isNew = $this->item->id == 0;
     JToolbarHelper::title(JText::_($isNew ? 'LNG_NEW_PAYMENT_PROCESSOR' : 'LNG_EDIT_PAYMENT_PROCESSOR', true), 'menu.png');
     if ($canDo->get('core.edit')) {
         JToolbarHelper::apply('paymentprocessor.apply');
         JToolbarHelper::save('paymentprocessor.save');
     }
     JToolbarHelper::cancel('paymentprocessor.cancel', 'JTOOLBAR_CLOSE');
     JToolbarHelper::divider();
     JToolbarHelper::help('JHELP_JHOTELRESERVATION_PAYMENT_PROCESSOR_EDIT');
 }
Ejemplo n.º 10
0
 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);
 }
Ejemplo n.º 11
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();
 }
Ejemplo n.º 12
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');
 }
Ejemplo n.º 13
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     $canDo = JHotelReservationHelper::getActions();
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $isNew = $this->item->id == 0;
     JToolBarHelper::title(JText::_('LNG_EXCURSION', true) . " : " . (!$isNew ? JText::_('LNG_EDIT', true) : JText::_('LNG_ADD_NEW', true)), 'menu.png');
     if ($canDo->get('core.create')) {
         JToolBarHelper::apply('excursion.apply');
         JToolBarHelper::save('excursion.save');
         JToolBarHelper::save2new('excursion.save2new');
     }
     if (!$isNew) {
         JToolBarHelper::custom('excursion.editrateprices', 'stats', 'stats', 'JTOOLBAR_EDIT_RATE_DETAILS', false);
     }
     JToolBarHelper::cancel('excursion.cancel');
     JToolBarHelper::divider();
     JToolBarHelper::help('JHELP_EXCURSION_EDIT');
 }
Ejemplo n.º 14
0
 function display($tpl = null)
 {
     $this->state = $this->get('State');
     $this->countries = $this->get('Countries');
     $this->guestTypes = JHotelReservationHelper::getGuestTypes();
     $this->userData = UserDataService::getUserData();
     $this->hotel = HotelService::getHotel($this->userData->hotelId);
     $this->appSettings = JHotelUtil::getInstance()->getApplicationSettings();
     if ($this->appSettings->save_all_guests_data) {
         UserDataService::prepareGuestDetails();
     }
     $hotelId = JRequest::getVar("hotel_id");
     $reservedItems = JRequest::getVar("reservedItems");
     if (!empty($reservedItems)) {
         UserDataService::updateRooms($hotelId, $reservedItems);
     }
     $this->reservationDetails = $this->get("ReservationDetails");
     $this->showDiscounts = true;
     parent::display($tpl);
 }
Ejemplo n.º 15
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');
     }
 }
Ejemplo n.º 16
0
 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);
 }
Ejemplo n.º 17
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     $canDo = JHotelReservationHelper::getActions();
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $isNew = $this->item->room_id == 0;
     JToolBarHelper::title(JText::_('LNG_ROOM', true) . " : " . (!$isNew ? JText::_('LNG_EDIT', true) : JText::_('LNG_ADD_NEW', true)), 'menu.png');
     if ($canDo->get('core.create')) {
         JToolBarHelper::apply('room.apply');
         JToolBarHelper::save('room.save');
         JToolBarHelper::save2new('room.save2new');
     }
     if (!$isNew) {
         JToolBarHelper::custom('room.editrateprices', 'edit', 'stats', 'JTOOLBAR_EDIT_RATE_DETAILS', false);
     }
     JToolBarHelper::cancel('room.cancel');
     JToolBarHelper::divider();
     JToolBarHelper::help('JHELP_ROOM_EDIT');
     $doc = JFactory::getDocument();
     $doc->addScript('components/' . getBookingExtName() . '/assets/js/jquery.upload.js');
 }
Ejemplo n.º 18
0
    function editReservation()
    {
        $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;
        }
        $doc = JFactory::getDocument();
        $doc->addScriptDeclaration('
			var baseUrl="' . (JURI::base() . '/administrator/index.php?option=' . getBookingExtName()) . '";
		');
        $doc->addScript('administrator/components/' . getBookingExtName() . '/assets/js/reservation.js');
        $tpl = 'editreservation';
        return $tpl;
    }
Ejemplo n.º 19
0
 /**
  * Add the page title and toolbar.
  *
  * @since   1.6
  */
 protected function addToolbar()
 {
     $canDo = JHotelReservationHelper::getActions();
     $user = JFactory::getUser();
     JToolBarHelper::title('J-HotelReservation : ' . JText::_('LNG_PAYMENT_PROCESSORS', true), 'generic.png');
     if ($canDo->get('core.create') || count($user->getAuthorisedCategories('com_jhotereservation', 'core.create')) > 0) {
         JToolbarHelper::addNew('paymentprocessor.add');
     }
     if ($canDo->get('core.edit')) {
         JToolbarHelper::editList('paymentprocessor.edit');
     }
     if ($canDo->get('core.delete')) {
         JToolbarHelper::divider();
         JToolbarHelper::deleteList('', 'paymentprocessors.delete');
     }
     if ($canDo->get('core.admin')) {
         JToolbarHelper::preferences('com_jhotelreservation');
     }
     JToolbarHelper::divider();
     JToolBarHelper::custom('paymentprocessors.back', JHotelUtil::getDashboardIcon(), 'preview.png', JText::_('LNG_HOTEL_DASHBOARD', true), false, false);
     JToolbarHelper::help('JHELP_COMPANIES');
 }
Ejemplo n.º 20
0
 /**
  * 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();
 }
Ejemplo n.º 21
0
 /**
  * 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);
 }
Ejemplo n.º 22
0
 /**
  * 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');
 }
Ejemplo n.º 23
0
 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);
 }
Ejemplo n.º 24
0
 public function exportToCSV()
 {
     $this->reservationStatuses = JHotelReservationHelper::getReservationStatuses();
     $this->paymentStatuses = JHotelReservationHelper::getPaymentStatuses();
     $this->populateState();
     $reservations = $this->getItems();
     $csv_output = "id;name;hotel;voucher;check in;check out;created at;adults;children;rooms;status;payment status" . "\n";
     foreach ($reservations as $item) {
         $reservationStatus = $this->reservationStatuses[$item->reservation_status];
         $paymentStatus = $this->paymentStatuses[$item->payment_status];
         $csv_output .= "{$item->confirmation_id};{$item->first_name} {$item->last_name};{$item->hotel_name};{$item->voucher};{$item->start_date};{$item->end_date};{$item->created};{$item->total_adults};{$item->total_children};{$item->rooms};{$reservationStatus};{$paymentStatus};";
         $csv_output .= "\n";
     }
     ob_clean();
     $fileName = "jhotel_reservations_listing";
     header("Content-type: application/vnd.ms-excel");
     header("Content-disposition: csv" . date("Y-m-d") . ".csv");
     header("Content-disposition: filename=" . $fileName . ".csv");
     print $csv_output;
 }