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


PHP JHotelUtil::checkIndexKey方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: save

 /**
  * save a record (and redirect to main page)
  * @return void
  */
 function save()
 {
     $model = $this->getModel('paymentsettings');
     $post = JRequest::get('post');
     if (JHotelUtil::checkIndexKey('#__hotelreservation_paymentsettings', array('hotel_id' => $post['hotel_id'], 'payment_type_id' => $post['payment_type_id']), 'payment_id', $post['payment_id'])) {
         $msg = JText::_('LNG_PAYMENT_NAME_EXISTENT', true);
         JError::raiseWarning(500, $msg);
         $this->setRedirect('index.php?option=' . getBookingExtName() . '&controller=paymentsettings&view=paymentsettings&task=add&hotel_id=' . $post['hotel_id']);
     } else {
         if ($model->store($post)) {
             $msg = JText::_('LNG_PAYMENT_SAVED', true);
             $this->setRedirect('index.php?option=' . getBookingExtName() . '&controller=paymentsettings&view=paymentsettings&hotel_id=' . $post['hotel_id'], $msg);
         } else {
             $msg = JText::_('LNG_ERROR_SAVING_PAYMENT', true);
             //JError::raiseWarning( 500, $msg);
             $this->setRedirect('index.php?option=' . getBookingExtName() . '&controller=paymentsettings&view=paymentsettings&hotel_id=' . $post['hotel_id']);
         }
     }
     // Check the table in so it can be edited.... we are done with it anyway
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:24,代码来源:paymentsettings.php

示例6: save

 /**
  * save a record (and redirect to main page)
  * @return void
  */
 function save()
 {
     $model = $this->getModel('manageairlines');
     $post = JRequest::get('post');
     $post['airline_description'] = JRequest::getVar('airline_description', '', 'post', 'string', JREQUEST_ALLOWRAW);
     if (JHotelUtil::checkIndexKey('#__hotelreservation_airlines', array('hotel_id' => $post['hotel_id'], 'airline_name' => $post['airline_name']), 'airline_id', $post['airline_id'])) {
         $msg = JText::_('LNG_AIRLINE_NAME_EXISTENT', true);
         JError::raiseWarning(500, $msg);
         $this->setRedirect('index.php?option=' . getBookingExtName() . '&controller=manageairlines&view=manageairlines&task=add&hotel_id=' . $post['hotel_id'], $msg);
     } else {
         if ($model->store($post)) {
             $msg = JText::_('LNG_AIRLINE_SAVED', true);
             $this->setRedirect('index.php?option=' . getBookingExtName() . '&controller=manageairlines&view=manageairlines&hotel_id=' . $post['hotel_id'], $msg);
         } else {
             $msg = "";
             JError::raiseWarning(500, JText::_('LNG_ERROR_SAVING_AIRLINE', true));
             $this->setRedirect('index.php?option=' . getBookingExtName() . '&controller=manageairlines&view=manageairlines&hotel_id=' . $post['hotel_id'], $msg);
         }
     }
     // Check the table in so it can be edited.... we are done with it anyway
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:25,代码来源:manageairlines.php

示例7: save

 /**
  * save a record (and redirect to main page)
  * @return void
  */
 function save()
 {
     $model = $this->getModel('managecurrencies');
     $post = JRequest::get('post');
     $post["currency_symbol"] = JRequest::getVar('currency_symbol', '', 'post', 'string', JREQUEST_ALLOWRAW);
     if (JHotelUtil::checkIndexKey('#__hotelreservation_currencies', array('description' => $post['description']), 'currency_id', $post['currency_id'])) {
         $msg = '';
         JError::raiseWarning(500, JText::_('LNG_CURRENCY_NAME_EXISTENT', true));
         $this->setRedirect('index.php?option=' . getBookingExtName() . '&controller=managecurrencies&view=managecurrencies&task=add', $msg);
     } else {
         if ($model->store($post)) {
             $msg = JText::_('LNG_CURRENCY_SAVED', true);
             $this->setRedirect('index.php?option=' . getBookingExtName() . '&controller=managecurrencies&view=managecurrencies', $msg);
         } else {
             $msg = '';
             JError::raiseWarning(500, JText::_('LNG_ERROR_SAVING_CURRENCY', true));
             $this->setRedirect('index.php?option=' . getBookingExtName() . '&controller=managecurrencies&view=managecurrencies', $msg);
         }
     }
     $this->setRedirect('index.php?option=' . getBookingExtName() . '&controller=managecurrencies&view=managecurrencies', $msg);
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:25,代码来源:managecurrencies.php

示例8: save


//.........这里部分代码省略.........
     if (count($room_intervals_numbers['nrs']) > 0) {
         $c = count($room_intervals_numbers['nrs']);
         for ($i = 0; $i < $c; $i++) {
             if ($room_intervals_numbers['nrs'][$i] > $room_intervals_numbers['nre'][$i]) {
                 continue;
             }
             for ($d = $room_intervals_numbers['nrs'][$i]; $d <= $room_intervals_numbers['nre'][$i]; $d++) {
                 $numbers[] = $d;
                 if ($room_intervals_numbers['is_ignore_duplicate'][$i] == 0) {
                     $numbers_2_check[] = $d;
                 }
                 $datai[$d] = $room_intervals_numbers['datai'][$i];
             }
         }
     }
     $daysWeek = array("", "LNG_MON", "LNG_TUE", "LNG_WED", "LNG_THU", "LNG_FRI", "LNG_SAT", "LNG_SUN");
     foreach ($room_prices as $keyPret => $valuesDays) {
         foreach ($valuesDays as $day) {
             $post["room_price_{$day}"] = $keyPret;
             unset($daysWeek[$day]);
         }
     }
     // dmp($numbers_2_check);
     // exit;
     // dmp($room_intervals_numbers['nrs']);
     // dmp($room_intervals_numbers['nre']);
     $post['option_ids'] = $option_ids;
     $post['pictures'] = $pictures;
     $post['room_prices'] = $room_prices;
     $post['room_intervals_numbers'] = $room_intervals_numbers;
     $post['numbers'] = $numbers;
     $post['numbers_2_check'] = $numbers_2_check;
     $post['datai'] = $datai;
     $post['room_order'] = $this->getLastRoom($post);
     if (JHotelUtil::checkIndexKey('#__hotelreservation_rooms', array('room_name' => $post['room_name'], 'hotel_id' => $post['hotel_id']), 'room_id', $post['room_id'])) {
         $msg = '';
         JError::raiseWarning(500, JText::_('LNG_ROOM_NAME_EXISTENT', true));
         //$this->setRedirect( 'index.php?option='.getBookingExtName().'&controller=managerooms&view=managerooms', $msg );
     } else {
         if ($post['type_price'] == 0 && (!is_numeric($post["room_price_1"]) || $post["room_price_1"] == 0 || (!is_numeric($post["room_price_2"]) || $post["room_price_2"] == 0) || (!is_numeric($post["room_price_3"]) || $post["room_price_3"] == 0) || (!is_numeric($post["room_price_4"]) || $post["room_price_4"] == 0) || (!is_numeric($post["room_price_5"]) || $post["room_price_5"] == 0) || (!is_numeric($post["room_price_6"]) || $post["room_price_6"] == 0) || (!is_numeric($post["room_price_7"]) || $post["room_price_7"] == 0))) {
             JError::raiseWarning(500, JText::_('LNG_ERROR_PRICE_DAY_BY_DAY', true));
         } else {
             if ($post['type_price'] == 1 && (!is_numeric($post["room_price"]) || $post["room_price"] == 0)) {
                 JError::raiseWarning(500, JText::_('LNG_ERROR_PRICE_SAME_EVERY_DAY', true));
             } else {
                 if ($post['type_price'] == 2 && (!is_numeric($post["room_price_midweek"]) || $post["room_price_midweek"] == 0 || (!is_numeric($post["room_price_weekend"]) || $post["room_price_weekend"] == 0))) {
                     JError::raiseWarning(500, JText::_('LNG_ERROR_PRICE_MIDDWEEK_WEEKEND', true));
                 } else {
                     if (!$model->validNumbers($post['room_intervals_numbers'], $msg)) {
                         JError::raiseWarning(500, $msg);
                         //$this->setRedirect( 'index.php?option='.getBookingExtName().'&controller=managerooms&view=managerooms&task=add&is_error_save=1&room_id[]='.$post['room_id'], '');
                     } else {
                         if (count($post['numbers']) != $post['number_of_rooms']) {
                             $msg = '';
                             JError::raiseWarning(500, JText::_('LNG_ERROR_COUNT_NR_ROOM_VS_NUMBERS', true));
                             //$this->setRedirect( 'index.php?option='.getBookingExtName().'&controller=managerooms&view=managerooms', '' );
                         } else {
                             if ($model->checkDuplicateNumbers($post['numbers'], $msg)) {
                                 JError::raiseWarning(500, $msg);
                                 //$this->setRedirect( 'index.php?option='.getBookingExtName().'&controller=managerooms&view=managerooms', '' );
                             } else {
                                 if (JHotelUtil::checkIndexKey('#__hotelreservation_rooms', array('hotel_id' => $post['hotel_id'], 'room_name' => $post['room_name']), 'room_id', $post['room_id'])) {
                                     $msg = '';
                                     JError::raiseWarning(500, JText::_('LNG_ROOM_NAME_EXISTENT', true));
                                     // $this->setRedirect( 'index.php?option='.getBookingExtName().'&controller=managerooms&view=managerooms&hotel_id='.$post['hotel_id'], $msg );
                                 } else {
                                     if (!$model->checkNumbers($post['hotel_id'], $post['room_id'], $post['numbers_2_check'], $msg)) {
                                         JError::raiseWarning(500, $msg);
                                         //$this->setRedirect( 'index.php?option='.getBookingExtName().'&controller=managerooms&view=managerooms', '' );
                                     } else {
                                         if ($post['room_id'] != "" && !$model->checkNumbersUnAssigned2Reservation($post['hotel_id'], $post['room_id'], $post['numbers'], $msg)) {
                                             JError::raiseWarning(500, $msg);
                                             //$this->setRedirect( 'index.php?option='.getBookingExtName().'&controller=managerooms&view=managerooms', '' );
                                         } else {
                                             if ($model->store($post)) {
                                                 $app = JFactory::getApplication();
                                                 $app->enqueueMessage(JText::_('LNG_ROOM_SAVED', true));
                                                 $post["room_id"] = $model->_room_id;
                                                 $this->saveRoomDescriptions($post);
                                                 if (JRequest::getVar('task') == 'apply') {
                                                     $this->setRedirect('index.php?option=' . getBookingExtName() . '&controller=managerooms&view=managerooms&task=edit&hotel_id=' . $post['hotel_id'] . '&room_id[]=' . $model->_room_id, $msg);
                                                 } else {
                                                     $this->setRedirect('index.php?option=' . getBookingExtName() . '&controller=managerooms&view=managerooms&hotel_id=' . $post['hotel_id'], $msg);
                                                 }
                                             } else {
                                                 $msg = "";
                                                 JError::raiseWarning(500, JText::_('LNG_ERROR_SAVING_ROOM', true));
                                                 //$this->setRedirect( 'index.php?option='.getBookingExtName().'&controller=managerooms&view=managerooms&hotel_id='.$post['hotel_id'], '' );
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:101,代码来源:managerooms.php


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