Example #1
0
 public function Customer()
 {
     $this->MyAction = 'Customer';
     $CustProModule = new CustProModule();
     $CustomersModule = new CustomersModule();
     $FuwuModule = new FuwuModule();
     //获取风信项目id
     $ProjectId = FENGXIN_ID;
     $MysqlWhere = " where {$CustProModule->ProjectID}='{$ProjectId}' and AgentID=" . $_SESSION['AgentID'];
     $Page = intval($this->_GET['Page']);
     $Page = $Page ? $Page : 1;
     $Searchtxt = $this->_POST['searchtxt'];
     if ($Searchtxt != '') {
         $MysqlWhere .= " and (WeiXinName like '%{$Searchtxt}%')";
     }
     $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']);
         foreach ($Data['Data'] as $Key => $Value) {
             $CustomerInfo = $CustomersModule->GetOneInfoByKeyID($Value['CustomersID']);
             $Data['Data'][$Key]['CompanyName'] = $CustomerInfo['CompanyName'];
             $PropertyModule = new PropertyModule();
             $PropertyInfo = $PropertyModule->GetOneInfoByKeyID($Value['GongNeng']);
             $Data['Data'][$Key]['GongNeng'] = $PropertyInfo['ProjectPropertyName'];
             $Data['Data'][$Key]['Fuwu'] = '';
             $Fuwu = $this->GetFuwu($Value['CustomersProjectID']);
             if (!empty($Fuwu['have'])) {
                 foreach ($Fuwu['have'] as $f) {
                     $FuwuInfo = $FuwuModule->GetOneInfoByKeyID($f);
                     $Data['Data'][$Key]['Fuwu'] .= ' ' . $FuwuInfo['FuWuName'];
                 }
             } else {
                 $Data['Data'][$Key]['Fuwu'] .= '-- --';
             }
             $Data['Data'][$Key]['Fuwu'] .= '<button class="showfuwu button" value="' . $Value['CustomersProjectID'] . '"><img src="images/view-icon.png"></button>';
         }
         //dd($Data);
         MultiPage($Data, 10);
         $this->Data = $Data;
     }
 }
Example #2
0
 public function Index()
 {
     $Page = _intval($this->_GET['Page'], true);
     $UserID = _intval($this->_GET['UserID'], true);
     $Links = new LinksModule();
     $LinksList = $Links->LinksManager($Page, 20, $UserID);
     MultiPage($LinksList, 10);
     $this->LinksList = $LinksList;
     $ID = _intval($this->_GET['ID'], true);
     if ($ID) {
         $this->LinksDetail = $Links->Detail($ID);
     }
     $this->Category = new LinksCategoryModule();
     $this->Categories = $this->Category->GetLists($ParentCategoryID);
 }
Example #3
0
 public function Lists()
 {
     $MysqlWhere = ' where 1';
     $Page = intval($this->_GET['Page']);
     $Page = $Page ? $Page : 1;
     $FuWuModule = new FuWuModule();
     $ListsNum = $FuWuModule->GetListsNum($MysqlWhere);
     $Rscount = $ListsNum['Num'];
     $PageSize = 1000;
     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'] = $FuWuModule->GetLists($MysqlWhere, $Offset, $Data['PageSize']);
         MultiPage($Data, 10);
         $this->Data = $Data;
     }
     /*
     $aaaaa = '';
     foreach ($Data['Data'] As $Value)
     {
     	$aaaaa.="array (
     				'id' =>'".$Value['FuWuID']."', 
     				'name' => '".$Value['FuWuName']."',
     				'url' => '',
     		  ),
     		  ";
     }
     echo $aaaaa;exit;
     */
     $FuWuID = _intval($this->_GET['FuWuID']);
     if ($FuWuID > 0) {
         $this->FuWuInfo = $FuWuModule->GetOneInfoByKeyID($FuWuID);
     }
 }
Example #4
0
 public function Customer()
 {
     $this->MyAction = 'Customer';
     $CustProModule = new CustProModule();
     $CustomersModule = new CustomersModule();
     //获取G宝盆项目id
     $ProjectId = TONGYI_ID;
     $MysqlWhere = " where {$CustProModule->ProjectID}='{$ProjectId}' and AgentID=" . $_SESSION['AgentID'];
     $Page = intval($this->_GET['Page']);
     $Page = $Page ? $Page : 1;
     $Searchtxt = $this->_POST['searchtxt'];
     if ($Searchtxt != '') {
         $MysqlWhere .= " and (G_domain like '%{$Searchtxt}%')";
     }
     $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']);
         foreach ($Data['Data'] as $Key => $Value) {
             $CustomerInfo = $CustomersModule->GetOneInfoByKeyID($Value['CustomersID']);
             $Data['Data'][$Key]['CompanyName'] = $CustomerInfo['CompanyName'];
             $Data['Data'][$Key]['ProjectPropertyName'] = $this->GetGBaoPenVesion($Value['GongNeng']);
         }
         MultiPage($Data, 10);
         $this->Data = $Data;
     }
 }
Example #5
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;
     }
 }
Example #6
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;
     }
 }
Example #7
0
 public function Lists()
 {
     $MysqlWhere = ' where 1';
     $Page = intval($this->_GET['Page']);
     $Page = $Page ? $Page : 1;
     $CustomersModule = new CustomersModule();
     $ListsNum = $CustomersModule->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'] = $CustomersModule->GetLists($MysqlWhere, $Offset, $Data['PageSize']);
         MultiPage($Data, 10);
         $this->Data = $Data;
     }
 }
Example #8
0
 public function Lists()
 {
     include 'Include/LevelArray.php';
     $MysqlWhere = ' where 1';
     $Page = intval($this->_GET['Page']);
     $Page = $Page ? $Page : 1;
     $AgentModule = new AgentModule();
     $AgentApiModule = new AgentApiModule();
     $ListsNum = $AgentModule->GetListsNum($MysqlWhere);
     $Rscount = $ListsNum['Num'];
     $PageSize = 20;
     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'] = $AgentModule->GetLists($MysqlWhere, $Offset, $Data['PageSize']);
         $AgentAccountModule = new AgentAccountModule();
         foreach ($Data['Data'] as $Key => $Value) {
             $Array['AgentID'] = $Value['AgentID'];
             $AgentApiInfo = $AgentApiModule->GetOneInfoByForID($Value['AgentID']);
             if (!empty($AgentApiInfo)) {
                 $Data['Data'][$Key]['Api']['url'] = $AgentApiInfo['url'];
                 $Data['Data'][$Key]['Api']['token'] = $AgentApiInfo['token'];
             }
             $AgentAccountInfo = $AgentAccountModule->GetLists('where AgentID=' . $Array['AgentID']);
             $Num = count($AgentAccountInfo);
             if ($Num == 0) {
                 $Data['Data'][$Key]['Total'] = '0';
                 $Data['Data'][$Key]['Balance'] = '0';
             } else {
                 foreach ($AgentAccountInfo as $V) {
                     $Data['Data'][$Key]['Total'] += $V['Total'];
                     $Data['Data'][$Key]['Balance'] += $V['Balance'];
                 }
             }
         }
         MultiPage($Data, 10);
         //dd($Data);
         $this->Data = $Data;
     }
 }
Example #9
0
 public function Customer()
 {
     $this->MyAction = 'Customer';
     $Fuwuqi = new FuwuqiModule();
     $FuwuqiInfo = $Fuwuqi->GetAll();
     foreach ($FuwuqiInfo as $value) {
         $FuwuqiName .= '<option value=' . $value['FuwuqiName'] . '>' . $value['FuwuqiName'] . '</option>';
     }
     $this->FuwuqiName = $FuwuqiName;
     $CustProModule = new CustProModule();
     $CustomersModule = new CustomersModule();
     //获取G宝盆项目id
     $ProjectId = GBAOPEN_ID;
     $MysqlWhere = " where {$CustProModule->ProjectID}='{$ProjectId}' and AgentID=" . $_SESSION['AgentID'];
     $Page = intval($this->_GET['Page']);
     $Page = $Page ? $Page : 1;
     $Searchtxt = $this->_POST['searchtxt'];
     if ($Searchtxt != '') {
         $MysqlWhere .= " and (G_domain like '%{$Searchtxt}%')";
     }
     $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']);
         foreach ($Data['Data'] as $Key => $Value) {
             $CustomerInfo = $CustomersModule->GetOneInfoByKeyID($Value['CustomersID']);
             $Data['Data'][$Key]['CompanyName'] = $CustomerInfo['CompanyName'];
             $Data['Data'][$Key]['CustomersName'] = $CustomerInfo['CustomersName'];
             $Data['Data'][$Key]['Tel'] = $CustomerInfo['Tel'];
             $Data['Data'][$Key]['ProjectPropertyName'] = $this->GetGBaoPenVesion($Value['GongNeng']);
         }
         MultiPage($Data, 10);
         $this->Data = $Data;
     }
     //pc模板列表
     $Model = new ModelModule();
     $PC_Model = $Model->GetListsAll('tb_model', 'where Type = \'PC\'');
     $PC_Model_string = '';
     $PC_Model_string2 = '';
     foreach ($PC_Model as $pc_v) {
         $PC_Model_string .= '<option class="pc-item" value="' . $pc_v['ID'] . '">' . $pc_v['NO'] . '</option>';
         $PC_Model_string2 .= '<option value="' . $pc_v['ID'] . '">' . $pc_v['NO'] . '</option>';
     }
     //手机模板列表
     $Mobile_Model = $Model->GetListsAll('tb_model', 'where Type = \'手机\'');
     $Mobile_Model_string = '';
     $Mobile_Model_string2 = '';
     foreach ($Mobile_Model as $mb_v) {
         $Mobile_Model_string .= '<option class="mob-item" value="' . $mb_v['ID'] . '" style="display:none;">' . $mb_v['NO'] . '</option>';
         $Mobile_Model_string2 .= '<option value="' . $mb_v['ID'] . '">' . $mb_v['NO'] . '</option>';
     }
     //套餐模板列表
     $Package_Model = $Model->GetListsAll('tb_model_packages');
     $Package_Model_string = '';
     foreach ($Package_Model as $pk_v) {
         $Package_Model_string .= '<option class="all-item" value="' . $pk_v['ID'] . '" style="display:none;">' . $pk_v['PackagesNum'] . '</option>';
     }
     $this->PC_Model_string = $PC_Model_string;
     $this->PC_Model_string2 = $PC_Model_string2;
     $this->Mobile_Model_string = $Mobile_Model_string;
     $this->Mobile_Model_string2 = $Mobile_Model_string2;
     $this->Package_Model_string = $Package_Model_string;
 }
Example #10
0
 public function Recharge()
 {
     $this->MyAction = 'Recharge';
     $Page = intval($this->_GET['Page']);
     $type = $this->_GET['type'];
     $Page = $Page ? $Page : 1;
     $OrderModule = new OrderModule();
     $OrderDescriptionModule = new OrderDescriptionModule();
     $MysqlWhere = "where AgentID={$_SESSION['AgentID']} and Type=1";
     $Searchtxt = $this->_POST['searchtxt'];
     $FengxinID = FENGXIN_ID;
     $GBaoPenID = GBAOPEN_ID;
     if ($Searchtxt != '') {
         $MysqlWhere .= " and OrderNO='{$Searchtxt}'";
     }
     if ($type == 'f') {
         $MysqlWhere .= " and ProjectID='{$FengxinID}'";
     } elseif ($type == 'g') {
         $MysqlWhere .= " and ProjectID='{$GBaoPenID}'";
     } else {
     }
     $OrderInfo = $OrderModule->GetLists($MysqlWhere);
     $ListsNum = $OrderModule->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'] = $OrderModule->GetLists($MysqlWhere, $Offset, $Data['PageSize']);
         //dd($Data);
         foreach ($Data['Data'] as $k => $v) {
             $Description = $OrderDescriptionModule->GetOneInfoByKeyID($v[DescriptionID]);
             $Data['Data'][$k]['Description'] = $Description['Description'];
             if ($v['ProjectID'] == $FengxinID) {
                 $Data['Data'][$k]['ProjectID'] = '风信';
             }
             if ($v['ProjectID'] == $GBaoPenID) {
                 $Data['Data'][$k]['ProjectID'] = 'G宝盆';
             }
         }
         MultiPage($Data, 10);
         $this->Data = $Data;
     }
 }
Example #11
0
 public function Manager()
 {
     $Users = new UsersModule();
     $tmp = $this->__LoadParameters('users');
     foreach ($tmp as $key => $value) {
         $this->{$key} = $value;
     }
     $UserGroups = $Users->GetUserGroups();
     foreach ($UserGroups as $list) {
         $NewUserGroups[$list['UserGroupID']] = $list['GroupName'];
     }
     $this->UserGroups = $NewUserGroups;
     if (is_numeric($this->_GET['UserGroupID'])) {
         $Filters['UserGroupID'] = _intval($this->_GET['UserGroupID'], true);
     }
     if (is_numeric($this->_GET['UserStatus'])) {
         $Filters['UserStatus'] = _intval($this->_GET['UserStatus'], true);
     }
     if (trim($this->_GET['UserName'])) {
         $Filters['UserName'] = trim($this->_GET['UserName']);
     }
     $UserList = $Users->GetList($this->_GET['Page'], 10, $Filters);
     MultiPage($UserList, 10);
     $this->UserList = $UserList;
     $MultiPageUrl = UrlRewriteSimple('Users', 'Manager', true);
     if ($Filters) {
         foreach ($Filters as $key => $value) {
             $MultiPageUrl .= '&' . $key . '=' . $value;
         }
     }
     $this->MultiPageUrl = $MultiPageUrl;
 }
Example #12
0
 public function Seach()
 {
     $MysqlWhere = ' where 1';
     $WhereGet = '';
     $this->seachValue = trim($this->_GET['seachValue']);
     //订单号
     $OrderNO = trim($this->_GET['OrderNO']);
     if ($OrderNO != 0) {
         $MysqlWhere .= ' and OrderNO=\'' . $OrderNO . '\'';
         $WhereGet .= '&OrderNO=' . $OrderNO;
         $this->OrderNO = $OrderNO;
     }
     //入账/消费
     $Type = $this->_GET['Type'];
     if ($Type == '入账') {
         $MysqlWhere .= ' and Type=1';
         $WhereGet .= '&Type=' . $Type;
         $this->Type = $Type;
     }
     if ($Type == '消费') {
         $MysqlWhere .= ' and Type=0';
         $WhereGet .= '&Type=' . $Type;
         $this->Type = $Type;
     }
     //代理商
     $AgentIDValue = trim($this->_GET['AgentIDValue']);
     if ($AgentIDValue != '') {
         $AgentModule = new AgentModule();
         $AgentInfo = $AgentModule->GetOneInfoByArrayKeys(array('UserName' => $AgentIDValue));
         $MysqlWhere .= ' and AgentID=' . $AgentInfo['AgentID'];
         $WhereGet .= '&AgentIDValue=' . $AgentIDValue;
         $this->AgentIDValue = $AgentIDValue;
     }
     //产品
     $ProjectIDValue = trim($this->_GET['ProjectIDValue']);
     if ($ProjectIDValue != '') {
         $MysqlWhere .= ' and ProjectID=' . $ProjectIDValue;
         $WhereGet .= '&ProjectIDValue=' . $ProjectIDValue;
         $this->ProjectIDValue = $ProjectIDValue;
     }
     //客户企业名称
     $CustomersIDValue = trim($this->_GET['CustomersIDValue']);
     if ($CustomersIDValue != '') {
         $CustomersModule = new CustomersModule();
         $CustomersInfo = $CustomersModule->GetOneInfoByArrayKeys(array('CompanyName' => $CustomersIDValue));
         $MysqlWhere .= ' and CustomersID=' . $CustomersInfo['CustomersID'];
         $WhereGet .= '&CustomersIDValue=' . $CustomersIDValue;
         $this->CustomersIDValue = $CustomersIDValue;
     }
     //下订单开始时间
     $StartTime = trim($this->_GET['StartTime']);
     $this->StartTime = $StartTime;
     if ($StartTime != '') {
         $StartTime = $StartTime . ' 00:00:00';
         $MysqlWhere .= ' and AddTime>\'' . $StartTime . '\'';
         $WhereGet .= '&StartTime=' . $StartTime;
     }
     //下订单结束时间
     $EndTime = trim($this->_GET['EndTime']);
     $this->EndTime = $EndTime;
     if ($EndTime != '') {
         $EndTime = $EndTime . ' 23:59:59';
         $MysqlWhere .= ' and AddTime<\'' . $EndTime . '\'';
         $WhereGet .= '&EndTime=' . $EndTime;
     }
     //最低交易金额
     $MinAmount = trim($this->_GET['MinAmount']);
     if ($MinAmount != '') {
         $MysqlWhere .= ' and Amount>' . $MinAmount;
         $WhereGet .= '&MinAmount=' . $MinAmount;
         $this->MinAmount = $MinAmount;
     }
     //最高交易金额
     $MaxAmount = trim($this->_GET['MaxAmount']);
     if ($MaxAmount != '') {
         $MysqlWhere .= ' and Amount<' . $MaxAmount;
         $WhereGet .= '&MaxAmount=' . $MaxAmount;
         $this->MaxAmount = $MaxAmount;
     }
     //客户端IP
     $FromIP = trim($this->_GET['FromIP']);
     if ($FromIP != '') {
         $MysqlWhere .= ' and FromIP=\'' . $FromIP . '\'';
         $WhereGet .= '&FromIP=' . $FromIP;
         $this->FromIP = $FromIP;
     }
     $Page = intval($this->_GET['Page']);
     $Page = $Page ? $Page : 1;
     $OrderModule = new OrderModule();
     $ListsNum = $OrderModule->GetListsNum($MysqlWhere);
     $Rscount = $ListsNum['Num'];
     $PageSize = 5000;
     if ($WhereGet == '') {
         $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'] = $OrderModule->GetLists($MysqlWhere, $Offset, $Data['PageSize']);
         $AgentModule = new AgentModule();
         $AgentAccountModule = new AgentAccountModule();
         $ProjectModule = new ProjectModule();
         $OrderDescriptionModule = new OrderDescriptionModule();
         $RuZhangNum = 0;
         $RuZhang = 0;
         $XiaoFei = 0;
         $XiaoFeiNum = 0;
         foreach ($Data['Data'] as $Key => $Value) {
             $Array['AgentID'] = $Value['AgentID'];
             $AgentInfo = $AgentModule->GetOneInfoByKeyID($Array['AgentID']);
             $Data['Data'][$Key]['UserName'] = $AgentInfo['UserName'];
             $ProjectInfo = $ProjectModule->GetOneInfoByKeyID($Value['ProjectID']);
             $Data['Data'][$Key]['ProjectName'] = $ProjectInfo['ProjectName'];
             $AgentAccountInfo = $AgentAccountModule->GetLists('where AgentID=' . $Array['AgentID']);
             $Num = count($AgentAccountInfo);
             if ($Num == 0) {
                 $Data['Data'][$Key]['Total'] = '0';
                 $Data['Data'][$Key]['Balance'] = '0';
             } else {
                 foreach ($AgentAccountInfo as $V) {
                     $Data['Data'][$Key]['Total'] += $V['Total'];
                     $Data['Data'][$Key]['Balance'] += $V['Balance'];
                 }
             }
             $OrderDescriptionInfo = $OrderDescriptionModule->GetOneInfoByKeyID($Value['DescriptionID']);
             $Data['Data'][$Key]['Description'] = $OrderDescriptionInfo['Description'];
             if ($Value['Type'] == 1) {
                 $Data['Data'][$Key]['TypeName'] = '入账';
                 $RuZhang += $Value['Amount'];
                 $RuZhangNum++;
             } else {
                 $Data['Data'][$Key]['TypeName'] = '消费';
                 $XiaoFei += $Value['Amount'];
                 $XiaoFeiNum++;
             }
         }
         $this->RuZhangNum = $RuZhangNum;
         $this->RuZhang = $RuZhang;
         $this->XiaoFei = $XiaoFei;
         $this->XiaoFeiNum = $XiaoFeiNum;
         MultiPage($Data, 10);
         $this->Data = $Data;
         $this->WhereGet = $WhereGet;
     }
 }
Example #13
0
 public function Customer()
 {
     $this->MyAction = 'Customer';
     $MysqlWhere = ' where AgentID=' . $_SESSION['AgentID'];
     $Page = intval($this->_GET['Page']);
     $Page = $Page ? $Page : 1;
     $FengxinID = $this->GetProjectID('风信');
     $GbaopenID = $this->GetProjectID('聚宝盆');
     $CustProModule = new CustProModule();
     $CustomersModule = new CustomersModule();
     $Searchtxt = $this->_POST['searchtxt'];
     if ($Searchtxt != '') {
         $MysqlWhere .= " and (CompanyName like '%{$Searchtxt}%' or CustomersName like '%{$Searchtxt}%')";
     }
     $ListsNum = $CustomersModule->GetListsNum($MysqlWhere);
     $Rscount = $ListsNum['Num'];
     $PageSize = 20;
     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'] = $CustomersModule->GetLists($MysqlWhere, $Offset, $Data['PageSize']);
         foreach ($Data['Data'] as $k => $v) {
             $where = "where ProjectID='{$FengxinID}' and AgentID={$_SESSION['AgentID']} and CustomersID={$v['CustomersID']}";
             $IsFengxin = $CustProModule->GetInfoByWhere($where);
             if (!empty($IsFengxin)) {
                 $Data['fengxin'][$v['CustomersID']] = 1;
                 $Data['Data'][$k]['status'] = $IsFengxin['status'];
             }
             $where = "where ProjectID='{$GbaopenID}' and AgentID={$_SESSION['AgentID']} and CustomersID={$v['CustomersID']}";
             $IsGbaopen = $CustProModule->GetInfoByWhere($where);
             if (!empty($IsGbaopen)) {
                 $Data['gbaopen'][$v['CustomersID']] = 1;
                 $Data['Data'][$k]['status'] = $IsGbaopen['status'];
             }
         }
         MultiPage($Data, 20);
         $this->Data = $Data;
     }
 }
Example #14
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;
 }