Exemplo n.º 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;
     }
 }
Exemplo n.º 2
0
 public function UpdateCustomersInfo($PostInfo = array(), $CustomersID = '')
 {
     if ($CustomersID == 0) {
         return 0;
     }
     $this->__LoadModules('/modules/class.CustomersModule.php');
     $CustomersModule = new CustomersModule();
     $UpdateInfo['UpdateTime'] = date("Y-m-d H:i:s");
     $UpdateInfo['CustomersName'] = $PostInfo['cus_realName'];
     $UpdateInfo['CompanyName'] = $PostInfo['cus_company'];
     $UpdateInfo['DomainName'] = $PostInfo['cus_domain'];
     $UpdateInfo['Area'] = $PostInfo['cus_area'];
     $UpdateInfo['Tel'] = $PostInfo['cus_telphone'];
     $UpdateInfo['Fax'] = $PostInfo['cus_fax'];
     $UpdateInfo['Email'] = $PostInfo['cus_email'];
     $UpdateInfo['Address'] = $PostInfo['cus_address'];
     $UpdateInfo['ServiceName'] = $PostInfo['cus_customerService'];
     $UpdateInfo['UserGroupID'] = $this->UserGroupID;
     $UpdateInfo['Remark'] = $PostInfo['cus_remark'];
     if ($CustomersModule->UpdateArrayByKeyID($UpdateInfo, $CustomersID)) {
         return 1;
     } else {
         return 0;
     }
 }
Exemplo n.º 3
0
 public function EditCustomer()
 {
     if ($this->_POST) {
         $LogsFunction = new LogsFunction();
         $CustomersID = trim($this->_POST['CustomersID']);
         $Page = trim($this->_POST['Page']);
         $Data['CompanyName'] = trim($this->_POST['CompanyName']);
         $CustomersModule = new CustomersModule();
         $CompanyNumInfo = $CustomersModule->GetListsNum('where CompanyName=\'' . $Data['CompanyName'] . '\' and CustomersID!=' . $CustomersID);
         if ($CompanyNumInfo['Num'] > 0) {
             $LogsFunction->logsinfile('102', 2, $CustomersID);
             JsMessage('该公司名已经被使用!');
         }
         $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['Remark'] = addslashes($this->_POST['Remark']);
         $Data['UpdateTime'] = date("Y-m-d H:i:s");
         if ($CustomersModule->UpdateArrayByKeyID($Data, $CustomersID)) {
             $LogsFunction->logsinfile('102', 1, $CustomersID);
             JsMessage('修改客户成功!', UrlRewriteSimple($this->MyModule, 'Customer', true) . '&Page=' . $Page, '继续操作');
         } else {
             $LogsFunction->logsinfile('102', 0, $CustomersID);
             JsMessage('修改客户失败,请再一次尝试!');
         }
     }
 }