• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CHttpSession类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: runAction

 public function runAction($action, $data)
 {
     $this->id = $data;
     $s = new CHttpSession();
     $s->open();
     $storedData = $s[$this->id];
     $s->close();
     $this->model = $storedData['model'];
     if ($action == 'listitems') {
         $parent_id = null;
         if (isset($_GET['id'])) {
             $parent_id = $_GET['id'];
         }
         return $this->model->eyuiformeditordb_listitems($_GET['item_type'], $parent_id);
     }
     if ($action == 'newitem') {
         $parent_id = null;
         if (isset($_GET['id'])) {
             $parent_id = $_GET['id'];
         }
         return $this->model->eyuiformeditordb_newitem($_GET['item_type'], self::t("New Item"), $parent_id);
     }
     if ($action == 'deleteitem') {
         if ($this->model->eyuiformeditordb_deleteitem($_GET['id'])) {
             return "OK";
         }
     }
     if ($action == 'updateitem') {
         $obj = CJSON::decode(trim(file_get_contents('php://input')));
         if ($this->model->eyuiformeditordb_updateitem($obj) == true) {
             return "OK";
         }
     }
 }
开发者ID:AndressJose,项目名称:bolsa-proyecto-integrado,代码行数:34,代码来源:EYuiFormEditor.php


示例2: actionScheduleBackupGeneratePdf

        public function actionScheduleBackupGeneratePdf() 
	{
           $session=new CHttpSession;
           $session->open();
		Yii::import('application.extensions.tcpdf.*');
		require_once('tcpdf/tcpdf.php');
		require_once('tcpdf/config/lang/eng.php');	
             if(isset($session['DatabaseBackupCron_records']))
               {
                $d=$_SESSION['DatabaseBackupCron_records'];
		 $model = array();

		if($d->data)
			$model[]=array_keys($d->data[0]->attributes);//headers: cols name
			else
			{
				$this->render('no_data_found',array('last_page'=>$_SERVER['HTTP_REFERER'],));
				exit;			
			}

		foreach ($d->data as $item) {
		    $model[] = $item->attributes;
		}
		//print_r($model);exit;
               }
              


		$html = $this->renderPartial('/databaseBackupCron/exportGridtoReport', array(
			'model'=>$model
		), true);
		$this->exporttopdf('Schedule Database Backup','ScheduleDatabaseBackup.pdf',$html);
		
	}
开发者ID:rinodung,项目名称:EduSec3.0.0,代码行数:34,代码来源:ExportToPDFExcelController.php


示例3: actionIndex

 /**
  * This is the default 'index' action that is invoked
  * when an action is not explicitly requested by users.
  */
 public function actionIndex()
 {
     //print_r($_GET);
     //die;
     if (isset($_GET['de'])) {
         $translator = self::translator();
         $translator->setLanguage('de');
     }
     if (isset($_GET['fr'])) {
         $translator = self::translator();
         $translator->setLanguage('fr');
     }
     /** @var $cs CClientScript */
     $cs = Yii::app()->clientScript;
     $cs->registerCssFile(Yii::app()->baseUrl . '/js/plugins/maximage/jquery.maximage.min.css');
     Yii::app()->clientScript->registerCoreScript('jquery.ui');
     Yii::app()->clientScript->registerCssFile(Yii::app()->clientScript->getCoreScriptUrl() . '/jui/css/base/jquery-ui.css');
     $cs->registerScriptFile(Yii::app()->baseUrl . '/js/plugins/maximage/jquery.maximage.min.js');
     $cs->registerScriptFile(Yii::app()->baseUrl . '/js/plugins/maximage/jquery.cycle.all.js');
     $cs->registerScriptFile(Yii::app()->baseUrl . '/js/plugins/jquery.easing.1.3.js');
     $cs->registerScriptFile(Yii::app()->baseUrl . '/js/catalog.min.js');
     $cs->registerScriptFile(Yii::app()->baseUrl . '/js/custom.js');
     $cs->registerCssFile(Yii::app()->baseUrl . '/js/plugins/to_ui_slider/css/ui.slider.extras.css');
     $cs->registerScriptFile(Yii::app()->baseUrl . '/js/plugins/to_ui_slider/js/selectToUISlider.jQuery.js');
     if (isset($_POST['VariationID'])) {
         $session = new CHttpSession();
         $session->open();
         $aOrderVariations = $session['orderVariations'];
         $aOrderVariations[$_POST['VariationID']] = $_POST['VariationID'];
         $session['orderVariations'] = $aOrderVariations;
         echo json_encode(array('counter' => count($aOrderVariations), 'message' => 'success'));
         exit;
     }
     $this->render('index', array('categories' => Category::model()->getCategoriesTree()));
 }
开发者ID:Kostiantin,项目名称:floors,代码行数:39,代码来源:SiteController.php


示例4: getDevice

 public function getDevice()
 {
     $device = new CHttpSession();
     $device->open();
     $type = $device['device-type'];
     return $type;
 }
开发者ID:jankichaudhari,项目名称:yii-site,代码行数:7,代码来源:Device.php


示例5: doCallback

 /**
  * doCallback 
  * 		you must process a calilback response comming from host auth provider.
  *
  *	you pass remote data to your local system using:
  *		$this->setData($anydata);
  *		$this->setLastError('error message');
  *
  * @access public
  * @return bool boolean result true if login is correct.
  */
 public function doCallback()
 {
     if (isset($_REQUEST['error'])) {
         if ($_REQUEST['error'] == 'access_denied') {
             $this->setLastError($_REQUEST['error_description']);
             return false;
         }
     }
     $s = new CHttpSession();
     $s->open();
     if (isset($s['state'])) {
         if ($s['state'] === $_REQUEST['state']) {
             $ac = $this->_getAccessToken($_REQUEST['code']);
             $this->setData($this->_requestUser($ac));
             $s->close();
             return true;
         } else {
             $this->setLastError('CRSF validation failed.');
             $s->close();
             return false;
         }
     } else {
         $this->setLastError('invalid state argument.');
         $s->close();
         return false;
     }
 }
开发者ID:seph-krueger,项目名称:handyman,代码行数:38,代码来源:Facebook.php


示例6: actionGeneratePdf

 public function actionGeneratePdf()
 {
     $session = new CHttpSession();
     $session->open();
     Yii::import('application.modules.admin.extensions.giiplus.bootstrap.*');
     require_once 'tcpdf/tcpdf.php';
     require_once 'tcpdf/config/lang/eng.php';
     if (isset($session['IguProductCategory_records'])) {
         $model = $session['IguProductCategory_records'];
     } else {
         $model = IguProductCategory::model()->findAll();
     }
     $html = $this->renderPartial('expenseGridtoReport', array('model' => $model), true);
     //die($html);
     $pdf = new TCPDF();
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor(Yii::app()->name);
     $pdf->SetTitle('IguProductCategory Report');
     $pdf->SetSubject('IguProductCategory Report');
     //$pdf->SetKeywords('example, text, report');
     $pdf->SetHeaderData('', 0, "Report", '');
     $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, "Example Report by " . Yii::app()->name, "");
     $pdf->setHeaderFont(array('helvetica', '', 8));
     $pdf->setFooterFont(array('helvetica', '', 6));
     $pdf->SetMargins(15, 18, 15);
     $pdf->SetHeaderMargin(5);
     $pdf->SetFooterMargin(10);
     $pdf->SetAutoPageBreak(TRUE, 0);
     $pdf->SetFont('dejavusans', '', 7);
     $pdf->AddPage();
     $pdf->writeHTML($html, true, false, true, false, '');
     $pdf->LastPage();
     $pdf->Output("IguProductCategory_002.pdf", "I");
 }
开发者ID:cntabana,项目名称:inyungu,代码行数:34,代码来源:IguProductCategoryController.php


示例7: actionLogOut

 public function actionLogOut()
 {
     $session = new CHttpSession();
     $session->open();
     $session->remove('usuarioSesion');
     $this->redirect('login.php');
 }
开发者ID:JLuisJ7,项目名称:sysfip,代码行数:7,代码来源:LoginController.php


示例8: renderContent

 protected function renderContent()
 {
     yii::beginProfile('loc');
     $session = new CHttpSession();
     $session->open();
     $newCountry = $this->newCountry ? $this->newCountry : ($session['top-country'] ? $session['top-country'] : $this->defaultCountry);
     $session['top-country'] = $newCountry;
     $newCity = $this->newCity ? $this->newCity : ($session['top-city'] ? $session['top-city'] : $this->defaultCity);
     $session['top-location'] = $newCity;
     if ($newCountry == "international") {
         $country = 'international';
         $city = GeoCityApi::getCityByName($newCity);
         if ($city) {
             $cities = GeoCityApi::getTopPrioritiesInternational($city->id);
         } else {
             $cities = GeoCityApi::getTopPrioritiesInternational();
         }
     } else {
         $country = GeoCountryApi::getCountryByName($newCountry);
         $city = GeoCityApi::getCityByName($newCity);
         if ($country && $city) {
             $cities = GeoCityApi::getTopPrioritiesByCountry($country->id, $city->id);
         } elseif ($country) {
             $cities = GeoCityApi::getTopPrioritiesByCountry($country->id);
         }
     }
     if ($country && $cities) {
         $this->render('topLocation', array('city' => $city, 'country' => $country, 'current' => $this->current, 'cities' => $cities));
     }
     yii::endProfile('loc');
 }
开发者ID:romeo14,项目名称:wallfeet,代码行数:31,代码来源:TopLocation.php


示例9: checkUserAdmin

 public function checkUserAdmin($accessRole_id = '')
 {
     $session = new CHttpSession();
     $session->open();
     $user_id = $session['uid'];
     //        App::pr($user_id,2);
     $user_rid = $session['rid'];
     if (!empty($user_id)) {
         if (!empty($accessRole_id)) {
             //            App::pr($accessRole_id,2);
             $record = UserMaster::model()->find("u_id = {$user_id} AND ur_id IN({$accessRole_id})");
             //            App::pr($record,2);
             if (!empty($record)) {
                 return true;
             } else {
                 return false;
             }
         } else {
             $record = UserMaster::model()->findByPk($user_id);
             if (!empty($record)) {
                 return true;
             } else {
                 return false;
             }
         }
     } else {
         return FALSE;
     }
 }
开发者ID:nitinprajapati1404,项目名称:YiiGeneralAdmin,代码行数:29,代码来源:Controller.php


示例10: loadModel

 /**
  * @param $id
  * @param $criteria
  * @return CActiveRecord
  * @throws CHttpException
  */
 public function loadModel($id, $criteria = false)
 {
     if (!$id) {
         throw new CHttpException(404, 'Property not found');
     }
     $criteria = $criteria ?: new CDbCriteria();
     $previewSession = new CHttpSession();
     $previewSession->open();
     $previewString = isset($previewSession['preview']) && $previewSession['preview'] ? $previewSession['preview'] : null;
     $previewString = isset($_GET['preview']) && $_GET['preview'] ? $_GET['preview'] : $previewString;
     if (Yii::app()->user->isGuest) {
         $criteria->scopes = ['notUnderTheRadar'];
         if ($previewString) {
             $criteria->compare('emailLinkString', $previewString);
         } else {
             $criteria->scopes = ['publicAvailable', 'notUnderTheRadar'];
         }
     }
     $model = Deal::model()->findByPk($id, $criteria);
     if (!$model) {
         throw new CHttpException(404, 'Property not found');
     } else {
         $previewSession['preview'] = $previewString;
         $previewSession->close();
     }
     return $model;
 }
开发者ID:jankichaudhari,项目名称:yii-site,代码行数:33,代码来源:PropertyController.php


示例11: run

 public function run()
 {
     $session = new CHttpSession();
     $session->open();
     $surSess = Yii::app()->session->get("favorites");
     if (!Yii::app()->user->isGuest) {
         Yii::import('mod.users.models.UserFavorites');
         $modelClass = $this->model;
         $currentModule = Yii::app()->controller->module->id;
         echo Html::openTag('div', array('id' => 'fav' . $this->model->id, 'class' => 'favorite'));
         $modelc = UserFavorites::model()->findAll(array('condition' => '`t`.`user_id`=:userid', 'params' => array(':userid' => Yii::app()->user->getId())));
         if (count($modelc) < Yii::app()->settings->get('users', 'favorite_limit')) {
             if (isset($modelClass)) {
                 $model = UserFavorites::model()->find(array('condition' => '`t`.`user_id`=:userid AND `t`.`model_class`=:model_class AND `t`.`object_id`=:id', 'params' => array(':userid' => Yii::app()->user->getId(), ':model_class' => $modelClass->getModelName(), ':id' => $modelClass->id)));
                 if ($this->view && !isset($model)) {
                     //
                     $view = "add";
                     $params = array('model' => $this->model, 'mod' => $currentModule);
                 } else {
                     $view = "remove";
                     $params = array('favorite_id' => $model->id, 'model' => $this->model, 'object_id' => $this->model->id, 'mod' => $currentModule);
                 }
             }
         }
         $this->render($view, $params);
         echo Html::closeTag('div');
     }
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:28,代码来源:FavoritesWidget.php


示例12: flushUploadDir

 public function flushUploadDir()
 {
     $session = new CHttpSession();
     $session->open();
     $folder = $_SERVER['DOCUMENT_ROOT'] . '/upload/tmp/' . $session->SessionID;
     Y::recursiveRemDir($folder);
 }
开发者ID:ASDAFF,项目名称:RosYama.2,代码行数:7,代码来源:Controller.php


示例13: actionSeenOffer

 public function actionSeenOffer()
 {
     $session = new CHttpSession();
     $session->open();
     $session['seenBackout'] = 1;
     echo "<russia>Have nice day</russia>";
     exit;
 }
开发者ID:jwerd,项目名称:coupon,代码行数:8,代码来源:SiteController.php


示例14: actionIndex

 /**
  * This is the default 'index' action that is invoked
  * when an action is not explicitly requested by users.
  */
 public function actionIndex()
 {
     // renders the view file 'protected/views/site/index.php'
     // using the default layout 'protected/views/layouts/main.php'
     $session = new CHttpSession();
     $session->open();
     $this->render('index', array('username' => $session["fullname"]));
 }
开发者ID:nitinprajapati1404,项目名称:YiiGeneralAdmin,代码行数:12,代码来源:HomeController.php


示例15: preFilter

 protected function preFilter($filterChain)
 {
     /** @var CHttpSession */
     self::$session = Yii::app()->session;
     if (self::$session->get('appointmentBuilder')) {
         self::$current = self::$session->get('appointmentBuilder');
     }
     return parent::preFilter($filterChain);
 }
开发者ID:jankichaudhari,项目名称:yii-site,代码行数:9,代码来源:AppointmentBuilder.php


示例16: actionIndex

 public function actionIndex()
 {
     $session = new CHttpSession();
     $session->open();
     $user = $session['login'];
     $session->closeSession(true);
     $sql = Yii::app()->db->createCommand("SELECT User.Num_bank_cart, Credit.Type_credit, Credit.Sum_credit, Credit.Proc_stavka, Credit.Srok, Credit.Type_credit, Calendar.Month_pay, Credit.Num_credit, Credit.Type_platezh, Credit.Oforml_credit_date, Calendar.Pay_sum, Calendar.P_sum, Calendar.P_proc, Calendar.Less_sum\nFROM (User INNER JOIN Credit ON User.id_user = Credit.id_user) INNER JOIN Calendar ON Credit.id_credit = Calendar.id_credit WHERE Num_bank_cart = {$user} ")->queryAll();
     echo $this->render('index', array('variable' => $sql));
 }
开发者ID:vladumanskyi,项目名称:diplom_Yii,代码行数:9,代码来源:testUserController.php


示例17: getFromMemory

 public function getFromMemory()
 {
     $session = new CHttpSession();
     $session->open();
     $this->date_from = $session[$this->session_name] ? $session[$this->session_name]['date_from'] : '';
     $this->date_to = $session[$this->session_name] ? $session[$this->session_name]['date_to'] : '';
     $this->time_from = $session[$this->session_name] ? $session[$this->session_name]['time_from'] : '00:00';
     $this->time_to = $session[$this->session_name] ? $session[$this->session_name]['time_to'] : '23:59';
 }
开发者ID:anton-itscript,项目名称:WM-Web,代码行数:9,代码来源:XmlLogForm.php


示例18: actionPost

 public function actionPost()
 {
     $session = new CHttpSession();
     $session->open();
     $text = $_POST['text'];
     $fp = fopen("log.html", 'a');
     fwrite($fp, "<div class='msgln'>(" . date("g:i A") . ") <b>" . $session['chatuser'] . "</b>: " . stripslashes(htmlspecialchars($text)) . "<br></div>");
     fclose($fp);
 }
开发者ID:abhikalotra,项目名称:Samples1,代码行数:9,代码来源:ChatController.php


示例19: login

 /**
  * Logs in the user using the given username and password in the model.
  * @return boolean whether login is successful
  */
 public function login()
 {
     $session = new CHttpSession();
     $session->open();
     $session['chatuser'] = $this->username;
     $fp = fopen("log.html", 'a');
     fwrite($fp, "<div class='msgln'><i>User " . $session['chatuser'] . " has join the chat session.</i><br></div>");
     fclose($fp);
     return true;
 }
开发者ID:abhikalotra,项目名称:Samples1,代码行数:14,代码来源:ChatLoginForm.php


示例20: filterEnforcelogin

 public function filterEnforcelogin($filterChain)
 {
     $session = new CHttpSession();
     $session->open();
     $userSesion = $session->get('usuarioSesion');
     if (empty($userSesion)) {
         $this->redirect("login.php");
     }
     $filterChain->run();
 }
开发者ID:JLuisJ7,项目名称:sysfip,代码行数:10,代码来源:SiteController.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CI类代码示例发布时间:2022-05-23
下一篇:
PHP CHttpRequest类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap