Example #1
0
 public function init()
 {
     $this->companyId = Yii::app()->request->getParam('cid', 0);
     $this->seatNum = Yii::app()->request->getParam('code');
     if (!$this->companyId) {
         $mac = Yii::app()->request->getParam('wuyimenusysosyoyhmac', 0);
         $companyWifi = CompanyWifi::model()->find('macid=:macId', array(':macId' => $mac));
         $this->companyId = $companyWifi ? $companyWifi->company_id : 0;
     }
 }
Example #2
0
 public function init()
 {
     session_start();
     $this->companyId = isset($_SESSION['companyId']) ? $_SESSION['companyId'] : 0;
     if (!$this->companyId) {
         $mac = Yii::app()->request->getParam('wuyimenusysosyoyhmac', 0);
         $companyWifi = CompanyWifi::model()->find('macid=:macId', array(':macId' => $mac));
         $this->companyId = $companyWifi ? $companyWifi->company_id : 0;
         $_SESSION['companyId'] = $this->companyId;
     }
 }
Example #3
0
 public function init()
 {
     session_start();
     $moMac = Yii::app()->request->getParam('momac', 0);
     if ($moMac) {
         $_SESSION['momac'] = $moMac;
     }
     $mac = Yii::app()->request->getParam('wuyimenusysosyoyhmac', 0);
     $padId = Yii::app()->request->getParam('padid', 0);
     if ($padId) {
         $companyId = Yii::app()->request->getParam('companyid', 0);
         $padId = Yii::app()->request->getParam('padid', 0);
         $padType = Yii::app()->request->getParam('padtype', 0);
         $this->companyId = $companyId;
         $_SESSION['companyId'] = $this->companyId;
         $this->isPad = 1;
         $this->padId = $padId;
         if ($padType == "1") {
             Yii::app()->language = 'jp';
             Yii::app()->theme = 'pad';
         } else {
             if ($padType == "2") {
                 Yii::app()->language = 'zh_cn';
                 Yii::app()->theme = 'pad_cn';
             } else {
                 if ($padType == "3") {
                     Yii::app()->language = 'zh_cn';
                     Yii::app()->theme = 'pad_cn_h';
                 }
             }
         }
     }
     if ($mac) {
         $companyWifi = CompanyWifi::model()->find('macid=:macId', array(':macId' => $mac));
         $this->companyId = $companyWifi ? $companyWifi->dpid : 0;
         $_SESSION['companyId'] = $this->companyId;
     }
     if (!$this->companyId) {
         $this->companyId = isset($_SESSION['companyId']) ? $_SESSION['companyId'] : 0;
     }
     $checkCode = Yii::app()->request->getParam('checkcode', 0);
     if ($checkCode) {
         $siteNo = SiteNo::model()->find('dpid=:companyId and code=:code', array(':companyId' => $this->companyId, ':code' => $checkCode));
         $_SESSION['siteNoId'] = $siteNo['lid'];
     }
     if (!$this->siteNoId) {
         $this->siteNoId = isset($_SESSION['siteNoId']) ? $_SESSION['siteNoId'] : 1;
     }
     $this->moMac = isset($_SESSION['momac']) ? $_SESSION['momac'] : 0;
 }
 public function actionDelete()
 {
     $companyId = Helper::getCompanyId(Yii::app()->request->getParam('companyId'));
     $ids = Yii::app()->request->getPost('ids');
     Until::isUpdateValid($ids, $this->companyId, $this);
     if (!empty($ids)) {
         foreach ($ids as $id) {
             $model = CompanyWifi::model()->find('lid=:id and dpid=:companyId', array(':id' => $id, ':companyId' => $companyId));
             if ($model) {
                 $model->update_at = date('Y-m-d H:i:s');
                 $model->delete();
             }
         }
         $this->redirect(array('companyWifi/index', 'companyId' => $companyId));
     } else {
         Yii::app()->user->setFlash('error', yii::t('app', '请选择要删除的项目'));
         $this->redirect(array('companyWifi/index', 'companyId' => $companyId));
     }
 }