Ejemplo n.º 1
0
 public function Add()
 {
     if ($this->_POST) {
         //提交添加
         $Data['UserName'] = trim($this->_POST['UserName']);
         $PassWord = trim($this->_POST['PassWord']);
         $Data['PassWord'] = md5($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['RegTime'] = time();
         $Data['FromIP'] = GetIp();
         $Data['FengXinAgentPriceID'] = trim($this->_POST['FengXinAgentPriceID']);
         $Data['GBaoPenAgentPriceID'] = trim($this->_POST['GBaoPenAgentPriceID']);
         if (strlen($Data['PassWord']) < 3 || strlen($PassWord) < 6) {
             $this->__Message('信息填写不完整!');
         }
         $AgentModule = new AgentModule();
         $AgentInfo = $AgentModule->GetOneInfoByArrayKeys(array('UserName' => $Data['UserName']));
         if (!empty($AgentInfo)) {
             $this->__Message('该用户名已经被使用过!');
         }
         if ($Data['EnterpriseName'] == '' || $Data['ContactName'] == '' || $Data['ContactTel'] == '') {
             $this->__Message('信息填写不完整!');
         }
         if ($AgentModule->InsertArray($Data)) {
             $this->__Message('添加代理商成功!', UrlRewriteSimple($this->MyModule, 'Lists', true), '继续操作');
         } else {
             $this->__Message('添加代理商失败,请再一次尝试!');
         }
     } else {
         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;
     }
 }
Ejemplo n.º 2
0
 public function Login()
 {
     if ($this->_POST) {
         $Post['UserName'] = trim($this->_POST['UserName']);
         $PassWord = trim($this->_POST['PassWord']);
         if (strlen($Post['UserName']) < 3) {
             JsMessage('用户名错误!');
         } elseif (strlen($PassWord) < 6) {
             JsMessage('密码错误!');
         }
         $AgentModule = new AgentModule();
         $Post['PassWord'] = md5($PassWord);
         $AgentInfo = $AgentModule->GetOneInfoByArrayKeys($Post);
         if (empty($AgentInfo)) {
             JsMessage('用户不存在或者用户名密码错误!');
         } else {
             $this->SetSession($AgentInfo);
             $LogsFunction = new LogsFunction();
             $LogsFunction->Loginlogs();
             JsMessage('登陆成功!', UrlRewriteSimple('Agent', 'Customer', true));
         }
     }
     exit;
 }
Ejemplo n.º 3
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;
     }
 }