Пример #1
0
 public function Profile()
 {
     $this->MyAction = 'Profile';
     $AgentModule = new AgentModule();
     if (strlen($this->_POST['PassWord']) >= 6) {
         $Update['PassWord'] = md5($this->_POST['PassWord']);
     }
     if ($this->_POST['EnterpriseName']) {
         $Update['EnterpriseName'] = $this->_POST['EnterpriseName'];
     }
     if ($this->_POST['ContactName']) {
         $Update['ContactName'] = $this->_POST['ContactName'];
     }
     if ($this->_POST['ContactTel']) {
         $Update['ContactTel'] = $this->_POST['ContactTel'];
     }
     if ($this->_POST['ContactEmail']) {
         $Update['ContactEmail'] = $this->_POST['ContactEmail'];
     }
     if ($this->_POST['ContactAddress']) {
         $Update['ContactAddress'] = $this->_POST['ContactAddress'];
     }
     $filter[AgentID] = intval($_SESSION['AgentID']);
     //dd($Update);
     if (!empty($Update)) {
         if ($AgentModule->UpdateArray($Update, $filter)) {
             JsMessage('修改个人资料成功');
         } else {
             JsMessage('修改个人资料失败,请再一次尝试!');
         }
     }
     $AgentInfo = $AgentModule->GetOneInfoByKeyID($_SESSION['AgentID']);
     //dd($AgentInfo);
     $this->Data = $AgentInfo;
 }
Пример #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;
 }
Пример #3
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;
     }
 }
Пример #4
0
 public function GetRenewals($CustomersProjectID = 0, $Year = 1)
 {
     //获取G宝盆项目id
     $ProjectId = TONGYI_ID;
     $CustProModule = new CustProModule();
     $PropertyModule = new PropertyModule();
     $AgentModule = new AgentModule();
     $where = "Where CustomersProjectID={$CustomersProjectID} and AgentID={$_SESSION['AgentID']} and ProjectId={$ProjectId}";
     $CustProInfo = $CustProModule->GetLists($where);
     $EndTime = $CustProInfo[0]['EndTime'];
     $GongNeng = $CustProInfo[0]['GongNeng'];
     $NowTime = Date('Y');
     if (Date('Y', $EndTime) - $NowTime > 10) {
         die('达最高上限年限');
     }
     //获取当前代理的G宝盆等级
     $Agentinfo = $AgentModule->GetOneInfoByKeyID($_SESSION['AgentID']);
     $LevelID['AgentPriceID'] = $Agentinfo['GBaoPenAgentPriceID'];
     //获取该等级的折扣
     $AgentPriceModule = new AgentPriceModule();
     $AgentPriceinfo = $AgentPriceModule->GetOneInfoByArrayKeys($LevelID);
     $AgenDiscount = $AgentPriceinfo['AgenDiscount'];
     //获取该功能的价格
     $Propertyinfo = $PropertyModule->GetProjectPropertyLists("where ProjectID={$ProjectId} and ProjectPropertyID={$GongNeng}");
     $MarketPrice = $Propertyinfo[0]['MarketPrice'];
     $StandardCost = ceil($MarketPrice * $AgenDiscount * $Year);
     $data['newEndTime'] = date('Y-m-d', strtotime("{$EndTime}+ {$Year} years"));
     $data['StandardCost'] = $StandardCost;
     $data['AgenDiscount'] = $AgentPriceinfo['AgenDiscount'];
     return $data;
 }
Пример #5
0
 public function showRenewalscost()
 {
     $json = stripcslashes($this->_GET['cost']);
     $data = json_decode($json, TRUE);
     $CustomersProjectID = $data['CustoProID'];
     $versiontime = $data['version'];
     unset($data['CustoProID']);
     unset($data['version']);
     $where = "where CustomersProjectID={$CustomersProjectID}";
     //获取风信项目id
     $ProjectId = FENGXIN_ID;
     $where .= " and ProjectID={$ProjectId} and AgentID={$_SESSION['AgentID']}";
     $AgentModule = new AgentModule();
     $CustFuwuModule = new CustFuwuModule();
     $FuWuModule = new FuWuModule();
     //获取当前代理的等级
     $Agentinfo = $AgentModule->GetOneInfoByKeyID($_SESSION['AgentID']);
     $LevelID['AgentPriceID'] = $Agentinfo['FengXinAgentPriceID'];
     //获取该等级的折扣
     $AgentPriceModule = new AgentPriceModule();
     $CustProModule = new CustProModule();
     $AgentPriceinfo = $AgentPriceModule->GetOneInfoByArrayKeys($LevelID);
     $AgenDiscount = $AgentPriceinfo['AgenDiscount'];
     $CustProInfo = $CustProModule->GetInfoByWhere($where);
     if (!empty($CustProInfo)) {
         $cost = 0;
         $Endtime = date('Y-m-d', strtotime($CustProInfo['EndTime']));
         $PropertyModule = new PropertyModule();
         $PropertyInfo = $PropertyModule->GetOneInfoByKeyID($CustProInfo['GongNeng']);
         $MarketPrice = $PropertyInfo['MarketPrice'];
         if (strtotime($Endtime) < strtotime(date('Y-m-d'))) {
             $cost = (strtotime($versiontime) - strtotime(date('Y-m-d'))) / (3600 * 24) * $MarketPrice * $AgenDiscount / 365;
         } else {
             $cost = (strtotime($versiontime) - strtotime($Endtime)) / (3600 * 24) * $MarketPrice * $AgenDiscount / 365;
         }
         foreach ($data as $k => $v) {
             $FuWuInfo = $FuWuModule->GetOneInfoByKeyID($k);
             $FuWuPrice = $FuWuInfo['FuWuPrice'];
             $sql = "where CustomersProjectID={$CustomersProjectID} and FuWuID={$k}";
             $CustFuwuInfo = $CustFuwuModule->GetInfoByWhere($sql);
             //dd($CustFuwuInfo);
             $FuwuEndTime = date('Y-m-d', strtotime($CustFuwuInfo['EndTime']));
             if (strtotime($FuwuEndTime) < strtotime(date('Y-m-d'))) {
                 $cost += (strtotime($v) - strtotime(date('Y-m-d'))) / (3600 * 24) * $FuWuPrice * $AgenDiscount / 365;
             } else {
                 $cost += (strtotime($v) - strtotime($FuwuEndTime)) / (3600 * 24) * $FuWuPrice * $AgenDiscount / 365;
             }
         }
     }
     echo '此次续费将消费金额<span class="red font22">¥:' . round($cost) . '</span>';
     exit;
 }
Пример #6
0
 public function AddAccount()
 {
     if ($this->_POST) {
         //提交添加
         $Post['ProjectID'] = _intval($this->_POST['ProjectID']);
         $Post['AgentID'] = _intval($this->_POST['AgentID']);
         $Remarks = trim($this->_POST['Remarks']);
         $JinE = trim($this->_POST['JinE']);
         $Page = _intval($this->_POST['Page']);
         if ($JinE < 1 || $Post['ProjectID'] == 0 || $Post['AgentID'] == 0) {
             $this->__Message('信息填写错误!');
         }
         $AgentAccountModule = new AgentAccountModule();
         $AgentAccountInfo = $AgentAccountModule->GetOneInfoByArrayKeys($Post);
         if (empty($AgentAccountInfo)) {
             //添加数据表
             $Post['Remarks'] = $Remarks;
             $Post['Total'] = $JinE;
             $Post['Balance'] = $JinE;
             $IsOk = $AgentAccountModule->InsertArray($Post);
         } else {
             //更新数据表
             $UpdateInfo['Remarks'] = $Remarks;
             $UpdateInfo['Total'] = $AgentAccountInfo['Total'] + $JinE;
             $UpdateInfo['Balance'] = $AgentAccountInfo['Balance'] + $JinE;
             $IsOk = $AgentAccountModule->UpdateArrayByArrayKeys($UpdateInfo, $Post);
         }
         if ($IsOk) {
             $AddOrderIsOk = $this->AddOrder($Post['AgentID'], $Post['ProjectID'], $JinE + $AgentAccountInfo['Balance'], $JinE);
             if ($AddOrderIsOk == 0) {
                 $this->__Message('入账成功,记录操作失败!', UrlRewriteSimple($this->MyModule, 'Lists', true) . '&Page=' . $Page, '继续操作');
             }
             $this->__Message('入账成功!', UrlRewriteSimple($this->MyModule, 'Lists', true) . '&Page=' . $Page, '继续操作');
         } else {
             $this->__Message('入账失败,请再一次尝试!');
         }
     } else {
         $AgentID = trim($this->_GET['AgentID']);
         $AgentModule = new AgentModule();
         $this->AgentInfo = $AgentModule->GetOneInfoByKeyID($AgentID);
         //print_r($this->AgentInfo);exit;
         include 'Include/LevelArray.php';
         $ProjectModule = new ProjectModule();
         $this->ProjectLists = $ProjectModule->GetProjectLists();
     }
 }
Пример #7
0
 public function Info()
 {
     $this->OrderID = _intval($this->_GET['OrderID']);
     $this->Page = _intval($this->_GET['Page']);
     $OrderModule = new OrderModule();
     $OrderInfo = $OrderModule->GetOneInfoByKeyID($this->OrderID);
     $AgentModule = new AgentModule();
     $AgentInfo = $AgentModule->GetOneInfoByKeyID($OrderInfo['AgentID']);
     $OrderInfo['AgentUserName'] = $AgentInfo['UserName'];
     $ProjectModule = new ProjectModule();
     $ProjectInfo = $ProjectModule->GetOneInfoByKeyID($OrderInfo['ProjectID']);
     $OrderInfo['ProjectName'] = $ProjectInfo['ProjectName'];
     $OrderDescriptionModule = new OrderDescriptionModule();
     $OrderDescriptionInfo = $OrderDescriptionModule->GetOneInfoByKeyID($OrderInfo['DescriptionID']);
     $OrderInfo['Description'] = $OrderDescriptionInfo['Description'];
     if ($OrderInfo['Type'] == 1) {
         $OrderInfo['TypeName'] = '入账';
     } else {
         $OrderInfo['TypeName'] = '消费';
     }
     $this->OrderInfo = $OrderInfo;
 }