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


PHP CHttpSession类代码示例

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


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


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