Example #1
0
 public function Edit()
 {
     if ($this->_POST) {
         //提交修改
         $CustomersID = _intval($this->_POST['CustomersID']);
         $Data['CompanyName'] = trim($this->_POST['CompanyName']);
         $Data['DomainName'] = trim($this->_POST['DomainName']);
         $Data['CustomersName'] = trim($this->_POST['CustomersName']);
         $Data['Area'] = trim($this->_POST['Area']);
         $Data['Tel'] = trim($this->_POST['Tel']);
         $Data['Fax'] = trim($this->_POST['Fax']);
         $Data['Email'] = trim($this->_POST['Email']);
         $Data['Address'] = trim($this->_POST['Address']);
         $Data['ServiceName'] = trim($this->_POST['ServiceName']);
         $Data['UserGroupID'] = trim($this->_POST['UserGroupID']);
         $Data['Remark'] = addslashes($this->_POST['Remark']);
         $Data['UpdateTime'] = date("Y-m-d H:i:s");
         $Page = _intval($this->_POST['Page']);
         if ($Data['CompanyName'] == '' || $Data['CustomersName'] == '' || $Data['Tel'] == '') {
             $this->__Message('信息填写不完整!');
         }
         $CustomersModule = new CustomersModule();
         if ($CustomersModule->UpdateArrayByKeyID($Data, $CustomersID)) {
             $this->__Message('修改客户成功!', UrlRewriteSimple('Customers', 'Lists', true) . '&Page=' . $Page, '继续操作');
         } else {
             $this->__Message('修改客户失败,请再一次尝试!');
         }
     }
     if ($this->_GET) {
         //获取用户信息
         $CustomersID = _intval($this->_GET['CustomersID']);
         $CustomersModule = new CustomersModule();
         $CustomersInfo = $CustomersModule->GetOneInfoByKeyID($CustomersID);
         $this->CustomersInfo = $CustomersInfo;
         //获取管理组信息
         $UsersModule = new UsersModule();
         $UserGroups = $UsersModule->GetAllUserGroups();
         $this->UserGroups = $UserGroups;
     }
 }