示例#1
0
 public function Lists()
 {
     include 'Include/LevelArray.php';
     $MysqlWhere = ' where 1';
     $Page = intval($this->_GET['Page']);
     $Page = $Page ? $Page : 1;
     $AgentPriceModule = new AgentPriceModule();
     $ListsNum = $AgentPriceModule->GetListsNum($MysqlWhere);
     $Rscount = $ListsNum['Num'];
     $PageSize = 10;
     if ($Rscount) {
         $Data['RecordCount'] = $Rscount;
         $Data['PageSize'] = $PageSize ? $PageSize : $Data['RecordCount'];
         $Data['PageCount'] = ceil($Data['RecordCount'] / $PageSize);
         $Data['Page'] = min($Page, $Data['PageCount']);
         $Offset = ($Page - 1) * $Data['PageSize'];
         if ($Page > $Data['PageCount']) {
             $Page = $Data['PageCount'];
         }
         $Data['Data'] = $AgentPriceModule->GetLists($MysqlWhere, $Offset, $Data['PageSize']);
         $ProjectModule = new ProjectModule();
         foreach ($Data['Data'] as $Key => $Value) {
             $ProjectInfo = $ProjectModule->GetOneInfoByKeyID($Value['ProjectID']);
             $Data['Data'][$Key]['ProjectName'] = $ProjectInfo['ProjectName'];
             $Data['Data'][$Key]['LevelName'] = GetNameByID($Value['LevelID']);
         }
         MultiPage($Data, 10);
         $this->Data = $Data;
     }
 }
示例#2
0
 public function Edit()
 {
     if ($this->_POST) {
         //提交修改
         $AgentID = _intval($this->_POST['AgentID']);
         $Data['PassWord'] = trim($this->_POST['PassWord']);
         if ($Data['PassWord'] != '') {
             $Data['PassWord'] = md5($Data['PassWord']);
         } else {
             unset($Data['PassWord']);
         }
         $Data['EnterpriseName'] = trim($this->_POST['EnterpriseName']);
         $Data['ContactName'] = trim($this->_POST['ContactName']);
         $Data['ContactTel'] = trim($this->_POST['ContactTel']);
         $Data['ContactEmail'] = trim($this->_POST['ContactEmail']);
         $Data['ContactAddress'] = trim($this->_POST['ContactAddress']);
         $Data['Remarks'] = trim($this->_POST['Remarks']);
         $Data['FengXinAgentPriceID'] = trim($this->_POST['FengXinAgentPriceID']);
         $Data['GBaoPenAgentPriceID'] = trim($this->_POST['GBaoPenAgentPriceID']);
         $Page = _intval($this->_POST['Page']);
         if ($Data['EnterpriseName'] == '' || $Data['ContactName'] == '' || $Data['ContactTel'] == '') {
             $this->__Message('信息填写不完整!');
         }
         $AgentModule = new AgentModule();
         if ($AgentModule->UpdateArrayByKeyID($Data, $AgentID)) {
             $this->__Message('修改代理商成功!', UrlRewriteSimple($this->MyModule, 'Lists', true) . '&Page=' . $Page, '继续操作');
         } else {
             $this->__Message('修改代理商失败,请再一次尝试!');
         }
     }
     if ($this->_GET) {
         //获取用户信息
         $this->AgentID = _intval($this->_GET['AgentID']);
         $this->Page = _intval($this->_GET['Page']);
         $AgentModule = new AgentModule();
         $AgentInfo = $AgentModule->GetOneInfoByKeyID($this->AgentID);
         $this->AgentInfo = $AgentInfo;
         include 'Include/LevelArray.php';
         $AgentPriceModule = new AgentPriceModule();
         //风信代理
         $LevelArray = $AgentPriceModule->GetLists('where ProjectID=7');
         $this->LevelArray = $LevelArray;
         //G宝盆代理
         $GBaoPenLevelArray = $AgentPriceModule->GetLists('where ProjectID=1');
         $this->GBaoPenLevelArray = $GBaoPenLevelArray;
     }
 }