当前位置: 首页>>代码示例>>PHP>>正文


PHP JHotelUtil类代码示例

本文整理汇总了PHP中JHotelUtil的典型用法代码示例。如果您正苦于以下问题:PHP JHotelUtil类的具体用法?PHP JHotelUtil怎么用?PHP JHotelUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了JHotelUtil类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: save

 /**
  * 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
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:30,代码来源:manageroomdiscounts.php

示例2: display

 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);
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:7,代码来源:view.html.php

示例3: display

 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);
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:26,代码来源:view.html.php

示例4: save

 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
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:34,代码来源:manageemailsdefault.php

示例5: saveHotel

 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;
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:57,代码来源:hotel.php

示例6: addToolbar

 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);
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:9,代码来源:view.html.php

示例7: includeFunctions

 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');
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:9,代码来源:view.html.php

示例8: changeSearch

 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);
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:11,代码来源:hotel.php

示例9: back

 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);
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:13,代码来源:guestdetails.php

示例10: getReservationDetails

 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;
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:13,代码来源:guestdetails.php

示例11: saveHotel

 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;
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:49,代码来源:hotel(original).php

示例12: __construct

 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();
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:15,代码来源:excursionslisting.php

示例13: getReservationDetails

 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;
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:16,代码来源:hotelratings.php


注:本文中的JHotelUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。