Esempio n. 1
0
 public function UpdateGBPen()
 {
     if ($this->_GET) {
         $CustomersProjectID = $this->_GET['CustomersProjectID'];
         $this->__LoadModules('/modules/class.CustProModule.php');
         $CustProModule = new CustProModule();
         $CustProInfo = $CustProModule->GetOneInfoByKeyID($CustomersProjectID);
         $this->__LoadModules('/modules/class.CustomersModule.php');
         $CustomersModule = new CustomersModule();
         $CustomersInfo = $CustomersModule->GetOneInfoByKeyID($CustProInfo['CustomersID']);
         if ($CustomersProjectInfo['MoreTime'] == '') {
             $EndTime = $CustomersProjectInfo['EndTime'];
         } elseif ($CustomersProjectInfo['EndTime'] > $CustomersProjectInfo['MoreTime']) {
             $EndTime = $CustomersProjectInfo['EndTime'];
         } elseif ($CustomersProjectInfo['EndTime'] < $CustomersProjectInfo['MoreTime']) {
             $EndTime = $CustomersProjectInfo['MoreTime'];
         }
         $PostString = '';
         $PostString .= 'cus_id=' . $CustProInfo['EachProjectID'] . '&';
         $PostString .= 'CompanyName=' . $CustomersInfo['CompanyName'] . '&';
         $PostString .= 'CustomersName=' . $CustomersInfo['CustomersName'] . '&';
         $PostString .= 'Fax=' . $CustomersInfo['Fax'] . '&';
         $PostString .= 'Tel=' . $CustomersInfo['Tel'] . '&';
         $PostString .= 'Email=' . $CustomersInfo['Email'] . '&';
         $PostString .= 'Address=' . $CustomersInfo['Address'] . '&';
         $PostString .= 'Area=' . $CustomersInfo['Area'] . '&';
         $PostString .= 'DomainName=' . $CustomersInfo['DomainName'] . '&';
         $PostString .= 'ServiceName=' . $CustomersInfo['ServiceName'] . '&';
         $PostString .= 'StartTime=' . $CustomersProjectInfo['StartTime'] . '&';
         $PostString .= 'EndTime=' . $EndTime . '&';
         $PostString .= 'md5sign=' . md5(substr($PostString, 0, -1) . $this->SecretKey);
         $Return = PostInfo('http://yu.manage.com/interface.php', $PostString);
         if (_intval($Return['ResultCode']) == 0) {
             JsMessage('操作失败,请重新操作', $_SERVER['HTTP_REFERER']);
         }
         JsMessage($Return['ErrorMessages'], $_SERVER['HTTP_REFERER']);
     }
 }
Esempio n. 2
0
 public function LogsLists()
 {
     $Page = intval($this->_GET['Page']);
     $Page = $Page ? $Page : 1;
     $Logs = new LogsModule();
     $LogsFunction = new LogsFunction();
     $CustomersModule = new CustomersModule();
     $AgentModule = new AgentModule();
     $AgentID = $this->_GET['AgentIDValue'];
     $CustomersID = $this->_GET['CustomersIDValue'];
     $OrderNO = $this->_GET['OrderNO'];
     $Time = $this->_GET['Time'];
     $FromIP = $this->_GET['FromIP'];
     $where = 'where 1';
     $so = '';
     if ($AgentID != NULL) {
         $AgentInfo = $AgentModule->GetLists("where UserName='******'");
         $sql_AgentID = $AgentInfo[0]['AgentID'];
         $where .= " and AgentID='{$sql_AgentID}'";
         $so .= '&AgentIDValue=' . $AgentID;
     }
     if ($CustomersID != NULL) {
         $CustomersInfo = $CustomersModule->GetLists("where CustomersName='{$CustomersID}'");
         $sql_CustomersID = $CustomersInfo[0]['CustomersID'];
         $where .= " and CustomersID='{$sql_CustomersID}'";
         $so .= '&CustomersIDValue=' . $CustomersID;
     }
     if ($OrderNO != NULL) {
         $where .= " and OrderNO='{$OrderNO}'";
         $so .= '&OrderNO=' . $OrderNO;
     }
     if ($Time != NULL) {
         $str_Time = date('Y-m-d', strtotime($Time));
         $time_array = explode('-', $str_Time);
         $where .= " and file='logs/{$time_array['0']}{$time_array['1']}/{$time_array['2']}.log'";
         $so .= '&Time=' . $Time;
     }
     if ($FromIP != NULL) {
         $where .= " and ip='{$FromIP}'";
         $so .= '&FromIP=' . $FromIP;
     }
     $ListsNum = $Logs->GetListsNum($where);
     $Rscount = $ListsNum['Num'];
     $PageSize = 15;
     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'];
         }
         $List = $Logs->GetLists($where, $Offset, $Data['PageSize']);
         foreach ($List as $k => $v) {
             $Data['Data'][$k]['id'] = $v['id'];
             $Data['Data'][$k]['code'] = $LogsFunction->operate[$v['code']];
             $Data['Data'][$k]['status'] = $LogsFunction->operate_status[$v['status']];
             $Data['Data'][$k]['ip'] = $v['ip'];
             $Data['Data'][$k]['time'] = $v['time'];
             $Data['Data'][$k]['Remark'] = $v['Remark'];
             $Data['Data'][$k]['OrderNO'] = $v['OrderNO'];
             $CustomersInfo = $CustomersModule->GetOneInfoByKeyID($v['CustomersID']);
             $Data['Data'][$k]['CustomersName'] = $CustomersInfo['CustomersName'];
             $AgentInfo = $AgentModule->GetOneInfoByKeyID($v['AgentID']);
             $Data['Data'][$k]['AgentUserName'] = $AgentInfo['UserName'];
         }
         MultiPage($Data, 10);
         //dd($Data);
         $this->Data = $Data;
         $this->so = $so;
     } else {
         $Data['Data'][0]['id'] = '无数据结果';
         $this->Data = $Data;
     }
 }
Esempio n. 3
0
 public function ToGbaoPenEditInfo($CustomersProjectID = 0, $aim_cus = '')
 {
     if ($CustomersProjectID == 0) {
         return 0;
     }
     $CustProModule = new CustProModule();
     $CustProInfo = $CustProModule->GetOneInfoByKeyID($CustomersProjectID);
     if (empty($CustProInfo)) {
         return 0;
     }
     $CustomersModule = new CustomersModule();
     $CustomersInfo = $CustomersModule->GetOneInfoByKeyID($CustProInfo['CustomersID']);
     $TuUrl = GBAOPEN_DOMAIN . 'superadmin/agency_receive.php';
     $Md5Key = FENGXIN_MD5KEY;
     $ToString .= 'cus_name=' . $CustProInfo['G_name'];
     $ToString .= '&cus_company=' . $CustomersInfo['CompanyName'];
     $ToString .= '&cus_realName=' . $CustomersInfo['CustomersName'];
     $ToString .= '&cus_fax=' . $CustomersInfo['Fax'];
     $ToString .= '&cus_telphone=' . $CustomersInfo['Tel'];
     $ToString .= '&cus_email=' . $CustomersInfo['Email'];
     $ToString .= '&cus_address=' . $CustomersInfo['Address'];
     $ToString .= '&cus_endtime=' . strtotime($CustProInfo['EndTime']);
     $ToString .= '&cus_domain=' . $CustProInfo['G_domain'];
     if ($CustProInfo['ProjectPropertyID'] == 18) {
         $cus_banben = '基础版';
     }
     if ($CustProInfo['ProjectPropertyID'] == 59) {
         $cus_banben = '海报板';
     }
     $ToString .= '&cus_banben=' . $cus_banben;
     $ToString .= '&cus_status=' . $CustProInfo['status'];
     $ToString .= '&aim_cus=' . $aim_cus;
     $ToString .= '&Msg=' . md5($ToString . '&Md5Key=' . $Md5Key);
     $ReturnString = request_by_other($TuUrl, $ToString);
     $ReturnArray = GetReturnInfo($ReturnString);
     if ($ReturnArray['ResultCode'] == 1000 || $ReturnString == 1) {
         return 1;
     } else {
         return $ReturnArray['ErrorMessages'];
     }
 }
Esempio n. 4
0
 public function ToFengXinEditInfo($CustomersProjectID = 0)
 {
     if ($CustomersProjectID == 0) {
         return 0;
     }
     $CustProModule = new CustProModule();
     $CustProInfo = $CustProModule->GetOneInfoByKeyID($CustomersProjectID);
     if (empty($CustProInfo)) {
         return 0;
     }
     $CustomersModule = new CustomersModule();
     $CustomersInfo = $CustomersModule->GetOneInfoByKeyID($CustProInfo['CustomersID']);
     //从行业版获取功能信息
     $ProjectPropertyModule = new ProjectPropertyModule();
     $ProjectPropertyInfo = $ProjectPropertyModule->GetOneInfoByKeyID($CustProInfo['GongNeng']);
     //获取增值服务
     $CustFuwuModule = new CustFuwuModule();
     $CustFuwuList = $CustFuwuModule->GetAll('where CustomersProjectID = ' . $CustomersProjectID);
     $FuWuString = $ProjectPropertyInfo['MyFuWu'];
     foreach ($CustFuwuList as $Value) {
         $FuWuString = $FuWuString . ',' . $Value['FuWuID'];
     }
     $TuUrl = FENGXIN_DOMAIN . 'index.php?g=Api&m=Wxusers&a=index';
     $Md5Key = FENGXIN_MD5KEY;
     $ToString .= 'FengXinUserName='******'FengXinUserName'];
     $ToString .= '&WeiXinName=' . $CustProInfo['WeiXinName'];
     $ToString .= '&WeiXinID=' . $CustProInfo['WeiXinID'];
     $ToString .= '&WeiXinNO=' . $CustProInfo['WeiXinNO'];
     $ToString .= '&GongNeng=' . $FuWuString;
     $ToString .= '&StartTime=' . $CustProInfo['StartTime'];
     $ToString .= '&EndTime=' . $CustProInfo['EndTime'];
     $ToString .= '&Email=' . $CustomersInfo['Email'];
     $ToString .= '&MP=' . $CustomersInfo['MP'];
     $ToString .= '&status=' . $CustProInfo['status'];
     $ToString .= '&Msg=' . md5($ToString . '&Md5Key=' . $Md5Key);
     $Return = request_by_other($TuUrl, $ToString);
     //$ReturnArray = GetReturnInfo($Return);
     if ($Return == 1000) {
         return 1;
     } else {
         return 0;
     }
 }
Esempio n. 5
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;
     }
 }
Esempio n. 6
0
 public function ToGbaoPenEditInfo($CustomersProjectID = 0, $aim_cus = '')
 {
     if ($CustomersProjectID == 0) {
         return 0;
     }
     $CustProModule = new CustProModule();
     $CustProInfo = $CustProModule->GetOneInfoByKeyID($CustomersProjectID);
     if (empty($CustProInfo)) {
         return 0;
     }
     $CustomersModule = new CustomersModule();
     $CustomersInfo = $CustomersModule->GetOneInfoByKeyID($CustProInfo['CustomersID']);
     $TuUrl = GBAOPEN_DOMAIN . 'api/modifyuser';
     $ToString .= 'name=' . $CustProInfo['G_name'];
     if ($CustProInfo['PC_model']) {
         preg_match('/[A-Z]{2}[0]*(\\d*)/', $CustProInfo['PC_model'], $have);
         $ToString .= '&pc_tpl_id=' . $have[1];
     } else {
         $ToString .= '&pc_tpl_id=' . $CustProInfo['PC_model'];
     }
     if ($CustProInfo['Mobile_model']) {
         preg_match('/[A-Z]{2}[0]*(\\d*)/', $CustProInfo['Mobile_model'], $have);
         $ToString .= '&mobile_tpl_id=' . $have[1];
     } else {
         $ToString .= '&mobile_tpl_id=' . $CustProInfo['Mobile_model'];
     }
     $ToString .= '&pc_domain=' . $CustProInfo['PC_domain'];
     $ToString .= '&mobile_domain=' . $CustProInfo['Mobile_domain'];
     $ToString .= '&email=' . $CustomersInfo['Email'];
     $ToString .= '&ftp_address=' . $CustProInfo['G_Ftp_Address'];
     $ToString .= '&ftp_user='******'G_Ftp_User'];
     $ToString .= '&ftp_pwd=' . $CustProInfo['G_Ftp_Pwd'];
     $ToString .= '&weburl=' . $CustProInfo['G_Ftp_FwAdress'];
     $ToString .= '&ftp_port=' . $CustProInfo['G_Ftp_Duankou'];
     $ToString .= '&ftp_dir=' . $CustProInfo['G_Ftp_Mulu'];
     $ToString .= '&ended_at=' . $CustProInfo['EndTime'];
     $ToString .= '&status=' . $CustProInfo['status'];
     /*
     $myfile = fopen("newfile.txt", "w") or die("Unable to open file!");
     fwrite($myfile, GBAOPEN_MD5KEY.'|');
     fwrite($myfile, strtotime($CustProInfo ['EndTime']).'|');
     fwrite($myfile, md5(GBAOPEN_MD5KEY . strtotime($CustProInfo ['EndTime'])));
     fclose($myfile);
     */
     //随机文件名开始生成
     $randomLock = getstr();
     $password = md5($randomLock);
     $password = md5($password);
     //生成握手密钥
     $text = getstr();
     //生成dll文件
     $myfile = @fopen($password . '.dll', "w+");
     if (!$myfile) {
         return 0;
     }
     fwrite($myfile, $text);
     fclose($myfile);
     $ToString .= '&timemap=' . $randomLock;
     $ToString .= '&taget=' . md5($text . $password);
     $ReturnString = request_by_other($TuUrl, $ToString);
     $ReturnArray = json_decode($ReturnString, true);
     print_r($ReturnArray);
     if ($ReturnArray['err'] == 1000) {
         return 1;
     } else {
         return 0;
     }
 }
Esempio n. 7
0
 public function DeleteCustomer()
 {
     $LogsFunction = new LogsFunction();
     $CustomersID = $this->_GET['ID'];
     $CustomersModule = new CustomersModule();
     $CustomersInfo = $CustomersModule->GetOneInfoByKeyID($CustomersID);
     if ($CustomersInfo['AgentID'] != $_SESSION['AgentID']) {
         $LogsFunction->logsinfile('103', 3, $CustomersID);
         JsMessage('删除失败,请确定您已经登录!');
     }
     $Page = _intval($this->_GET['Page']);
     $CustProModule = new CustProModule();
     $CustProModule->DeleteInfoByCustomersID($CustomersID);
     if ($CustomersModule->DeleteInfoByKeyID($CustomersID)) {
         $LogsFunction->logsinfile('103', 1, $CustomersID);
         JsMessage('已完成删除操作!', UrlRewriteSimple('Agent', 'Customer', true) . '&Page=' . $Page, '继续操作');
     } else {
         $LogsFunction->logsinfile('103', 0, $CustomersID);
         JsMessage('删除失败,请再一次尝试!');
     }
 }
Esempio n. 8
0
 public function Lists()
 {
     $CustomersID = _intval($this->_GET['CustomersID']);
     $MysqlWhere = ' where CustomersID=' . $CustomersID;
     $Page = intval($this->_GET['Page']);
     $Page = $Page ? $Page : 1;
     $CustProModule = new CustProModule();
     $ListsNum = $CustProModule->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'] = $CustProModule->GetLists($MysqlWhere, $Offset, $Data['PageSize']);
         $ProjectModule = new ProjectModule();
         $CustomersModule = new CustomersModule();
         $PropertyModule = new PropertyModule();
         foreach ($Data['Data'] as $Key => $Value) {
             $CustomersInfo = $CustomersModule->GetOneInfoByKeyID($Value['CustomersID']);
             $Data['Data'][$Key]['CompanyName'] = $CustomersInfo['CompanyName'];
             $ProjectInfo = $ProjectModule->GetOneInfoByKeyID($Value['ProjectID']);
             $Data['Data'][$Key]['ProjectName'] = $ProjectInfo['ProjectName'];
             if ($Value['ProjectPropertyID'] != '') {
                 $Data['Data'][$Key]['ProjectPropertyArray'] = $PropertyModule->GetProjectPropertyLists(' where ProjectPropertyID in(' . $Value['ProjectPropertyID'] . ')', 0, 100);
             }
         }
         MultiPage($Data, 10);
         $this->Data = $Data;
     }
     //获取用户信息
     $CustomersID = _intval($this->_GET['CustomersID']);
     $CustomersModule = new CustomersModule();
     $CustomersInfo = $CustomersModule->GetOneInfoByKeyID($CustomersID);
     $this->CustomersInfo = $CustomersInfo;
     //获取所有产品
     $ProjectModule = new ProjectModule();
     $ProjectLists = $ProjectModule->GetProjectLists('', 0, 100);
     $this->ProjectLists = $ProjectLists;
     //客戶产品信息
     $CustomersProjectID = _intval($this->_GET['CustomersProjectID']);
     if ($CustomersProjectID > 0) {
         $CustProInfo = $CustProModule->GetOneInfoByKeyID($CustomersProjectID);
         //产品下属性列表
         $ProjectID = $CustProInfo['ProjectID'];
         $PropertyModule = new PropertyModule();
         $String = '';
         $selected = '';
         $MysqlWhere = ' where ProjectID=' . $ProjectID . ' and ProjectPropertyParentID=0';
         $PropertyData = $PropertyModule->GetProjectPropertyLists($MysqlWhere, 0, 100);
         foreach ($PropertyData as $Key => $Value) {
             $String .= '<p>' . $Value['ProjectPropertyName'];
             $String .= '<select name="ProjectPropertyID[]" id="ProjectPropertyID' . $Value['ProjectPropertyID'] . '">';
             $MysqlWhereTwo = ' where ProjectPropertyParentID=' . $Value['ProjectPropertyID'];
             $PropertyData[$Key]['Two'] = $PropertyModule->GetProjectPropertyLists($MysqlWhereTwo, 0, 100);
             foreach ($PropertyData[$Key]['Two'] as $KeyTwo => $ValueTwo) {
                 $a = ',' . $CustProInfo['ProjectPropertyID'] . ',';
                 $b = ',' . $ValueTwo['ProjectPropertyID'] . ',';
                 if (strstr($a, $b)) {
                     $selected = 'selected="selected"';
                 }
                 $String .= '<option value="' . $ValueTwo['ProjectPropertyID'] . '" ' . $selected . '>&nbsp;&nbsp;' . $ValueTwo['ProjectPropertyName'] . '&nbsp;&nbsp;</option>';
                 unset($selected);
             }
             $String .= '</select>';
             $String .= '</p>';
         }
         $CustProInfo['property'] = $String;
     }
     $this->CustomersProjectID = $CustomersProjectID;
     $this->CustProInfo = $CustProInfo;
 }
Esempio n. 9
0
 public function showList()
 {
     $public = $this->_POST['_code'];
     $token = $this->_POST['_token'];
     $From = $this->_POST['fistid'] ? $this->_POST['fistid'] : 0;
     $Pagesize = $this->_POST['num'] ? $this->_POST['num'] + 1 : 11;
     $AgentID = $this->verify($public, $token);
     if ($AgentID) {
         $CustomersModule = new CustomersModule();
         $CustProModule = new CustProModule();
         $where = "where AgentID={$AgentID}";
         $CustProInfo = $CustProModule->GetLists($where, $From, $Pagesize);
         foreach ($CustProInfo as $k => $v) {
             $show[$k]['id'] = $v['CustomersProjectID'];
             $show[$k]['project_name'] = $this->GetNamebyProjectID($v['ProjectID']);
             $show[$k]['create_at'] = $v['AddTime'];
             $show[$k]['begin_at'] = $v['StartTime'];
             $show[$k]['end_at'] = $v['EndTime'];
             $show[$k]['status'] = $v['status'];
             $CustomerInfo = $CustomersModule->GetOneInfoByKeyID($v['CustomersID']);
             $show[$k]['company'] = $CustomerInfo['CompanyName'];
             $show[$k]['customer'] = $CustomerInfo['CustomersName'];
             $show[$k]['phone'] = $CustomerInfo['Tel'];
             $show[$k]['email'] = $CustomerInfo['Email'];
             $show[$k]['Vesion'] = $v['GongNeng'];
             $show[$k]['others'] = '';
         }
     } else {
         $show = array(0);
     }
     die(jsonp($show, 'JSONP'));
 }