Ejemplo n.º 1
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;
     }
 }