Пример #1
0
 public function Lists()
 {
     $this->MyAction = 'Lists';
     $Model = new ModelModule();
     if ($this->_POST['searchtxt']) {
         $Searchtxt = '\'' . trim($this->_POST['searchtxt']) . '\'';
         $Data['Data'][0] = $Model->GetOneInfoByKeyID($Searchtxt, 'NO');
         if (!$Data['Data'][0]) {
             $Model = new PropertyModule();
             $Data['Data'] = $Model->GetAllModelLists('tb_model_packages', 'where PackagesNum = ' . $Searchtxt);
         }
         $this->Data = $Data;
     } elseif ($this->_GET['state']) {
         $Page = intval($this->_GET['Page']);
         $Page = $Page ? $Page : 1;
         $PageSize = 10;
         $From = ($Page - 1) * $PageSize;
         $Data['state'] = $this->_GET['state'];
         $Data['Page'] = $Page;
         $Data['Data'] = $Model->GetTaocanLists('', $From, $PageSize, 'ASC');
         $RecordCount = $Model->GetTaocanListsNum('', 'PackagesNum', 'tb_model_packages');
         $Data['RecordCount'] = $RecordCount['Num'];
         $Data['PageCount'] = ceil($RecordCount['Num'] / $PageSize);
         $Data['PageSize'] = $PageSize;
         $this->Data = $Data;
     } else {
         $Page = intval($this->_GET['Page']);
         $Page = $Page ? $Page : 1;
         $PageSize = 10;
         $From = ($Page - 1) * $PageSize;
         $Data['Page'] = $Page;
         $Data['Data'] = $Model->GetLists('', $From, $PageSize, 'ASC');
         $RecordCount = $Model->GetListsNum();
         $Data['RecordCount'] = $RecordCount['Num'];
         $Data['PageCount'] = ceil($RecordCount['Num'] / $PageSize);
         $Data['PageSize'] = $PageSize;
         $this->Data = $Data;
     }
 }
Пример #2
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;
 }
Пример #3
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;
 }
Пример #4
0
 public function Delete()
 {
     $ProjectID = _intval($this->_GET['ProjectID']);
     $ProjectPropertyID = _intval($this->_GET['ProjectPropertyID']);
     $PropertyModule = new PropertyModule();
     if ($PropertyModule->DeleteProjectPropertyByKeyID($ProjectPropertyID)) {
         $this->__Message('已完成删除操作!', UrlRewriteSimple('Property', 'Lists', true) . '&ProjectID=' . $ProjectID, '继续操作');
     } else {
         $this->__Message('删除失败,请再一次尝试!');
     }
 }
Пример #5
0
 public function GetProjectProperty()
 {
     $ProjectID = _intval($this->_GET['ProjectID']);
     $PropertyModule = new PropertyModule();
     $String = '';
     //产品下属性列表
     $MysqlWhere = ' where ProjectID=' . $ProjectID . ' and ProjectPropertyParentID=0';
     $Data = $PropertyModule->GetProjectPropertyLists($MysqlWhere, 0, 100);
     foreach ($Data as $Key => $Value) {
         $String .= '<p>' . $Value['ProjectPropertyName'];
         $String .= '<select name="ProjectPropertyID[]" id="ProjectPropertyID' . $Value['ProjectPropertyID'] . '">';
         $MysqlWhereTwo = ' where ProjectPropertyParentID=' . $Value['ProjectPropertyID'];
         $Data[$Key]['Two'] = $PropertyModule->GetProjectPropertyLists($MysqlWhereTwo, 0, 100);
         foreach ($Data[$Key]['Two'] as $KeyTwo => $ValueTwo) {
             $String .= '<option value="' . $ValueTwo['ProjectPropertyID'] . '" >&nbsp;&nbsp;' . $ValueTwo['ProjectPropertyName'] . '&nbsp;&nbsp;</option>';
         }
         $String .= '</select>';
         $String .= '</p>';
     }
     echo $String;
     exit;
 }