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


PHP JSession::destroy方法代码示例

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


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

示例1: step4

 function step4()
 {
     global $option, $mainframe;
     $mainframe->setPageTitle(JTEXT::_("THANK YOU"));
     $currentSession = JSession::getInstance('none', array());
     $currentSession->set('multi_post_book', '0');
     //echo $currentSession->get('multi_post', 'err');
     if ($currentSession->get('multi_post', 'err') == 'err') {
         $link = 'index.php?option=com_hotel';
         echo "<script> \r\n\t\t\twindow.location = 'index.php?option=com_vnffhotel'; </script>\n";
         echo JTEXT::_("INVALID SESSION");
         return;
     }
     $model =& $this->getModel();
     $currentSession = JSession::getInstance('none', array());
     //get controller
     $controller = new VnffhotelController();
     $customer = $model->getCustomer($currentSession->get('customer_id', ''));
     //echo $customer->first_Name;
     $item_count = $currentSession->get('item_count', '0');
     $days_count = $currentSession->get('days_count', '0');
     $total_amount = $currentSession->get('total_amount', '0');
     for ($i = 0; $i < $item_count; $i++) {
         $prices[$i] = $model->getPriceById($currentSession->get('price_id_' . $i, ''));
         //echo $prices[$i]->hotel_Name;
         $quantities[$i] = $currentSession->get('quantity_' . $i, '');
         //echo $quantities[$i];
         $sub_totals[$i] = $currentSession->get('subtotal_' . $i, '');
         //echo $quantities[$i];
     }
     $checkin_date = $currentSession->get('checkin_date', '');
     $checkout_date = $currentSession->get('checkout_date', '');
     $booking_requests = $currentSession->get('booking_requests', '');
     $book =& JTable::getInstance('books', 'Table');
     if (!$book->bind(JRequest::get('post'))) {
         echo "<script> alert('" . $book->getError() . "'); \r\n\t\t\t\t\t\t   window.history.go(-1); </script>\n";
         exit;
     }
     $checkin_date_r = explode('/', $checkin_date);
     $checkout_date_r = explode('/', $checkout_date);
     $book->from_Date = date('Y-m-d H:i:s', mktime(0, 0, 0, $checkin_date_r[1], $checkin_date_r[0], $checkin_date_r[2]));
     $book->des_Date = date('Y-m-d H:i:s', mktime(0, 0, 0, $checkout_date_r[1], $checkout_date_r[0], $checkout_date_r[2]));
     //echo $book->from_Date . $book->des_Date;
     $book->customer_ID = $customer->customer_ID;
     $book->status = "no";
     $book->book_Requests = $booking_requests;
     if ($currentSession->get('multi_post_book', '0') == '0') {
         if (!$book->store()) {
             echo $book->getError();
             echo "<script> alert('" . $book->getError() . "'); \r\n\t\t\t\t\t  window.history.go(-1); </script>\n";
             exit;
         }
         for ($i = 0; $i < $item_count; $i++) {
             $book_details =& JTable::getInstance('bookdetails', 'Table');
             if (!$book_details->bind(JRequest::get('post'))) {
                 echo "<script> alert('" . $book_details->getError() . "'); \r\n\t\t\t\t\t\t\t   window.history.go(-1); </script>\n";
                 exit;
             }
             $book_details->book_ID = $book->book_ID;
             $book_details->price_ID = $currentSession->get('price_id_' . $i, '');
             $book_details->quantity = $quantities[$i];
             if (!$book_details->store()) {
                 echo $book_details->getError();
                 echo "<script> alert('" . $book_details->getError() . "'); \r\n\t\t\t\t\t  \twindow.history.go(-1); </script>\n";
                 exit;
             }
         }
         //$currentSession->set('customer_id', $row->customer_ID);
         $currentSession->set('multi_post_book', '1');
     }
     JSession::destroy();
     //echo "hehehehe";
     $this->assignRef('controller', $controller);
     parent::display("step4");
 }
开发者ID:vCodeTech,项目名称:ivivu,代码行数:75,代码来源:view.html.php


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