2 Star 1 Fork 2

徐子玉 / 品贷网

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
brandWall.php 8.48 KB
一键复制 编辑 原始数据 按行查看 历史
徐子玉 提交于 2017-07-05 11:21 . + pdw
<?php
include_once 'config.php';
include_once 'user_head.php';
include_once 'ad_head.php';
include_once 'search_head.php';
include_once 'user_right.php';
include_once 'foot.php';
header ("Content-Type: text/html; charset=UTF-8");
header ("Cache-Control: no-cache, must-revalidate");
header ("Pragma: no-cache");
error_reporting(E_ERROR | E_WARNING | E_PARSE);
$client = new SoapClient($GLOBAL_REMOTE_API);
$xml = '';
//首页轮播
$Show_result = $client->PD_getFactoryShow($xml);
$PD_getFactoryShowResult = $Show_result->PD_getFactoryShowResult;
$PD_getFactoryShowResultArray = json_decode($PD_getFactoryShowResult, TRUE);
//开始解析
$Show_totalCount = $PD_getFactoryShowResultArray[0]['totalCount'];
$Show_success = $PD_getFactoryShowResultArray[0]['success'];
$Show_data = $PD_getFactoryShowResultArray[0]['data'];
$Showhtml = '';
foreach($Show_data as $key=>$d){
$factoryId = $Show_data[$key]['factoryId'];
$picUrl = $Show_data[$key]['picUrl'];
$linkUrl = $Show_data[$key]['linkUrl'];
$linkUrl = ($linkUrl != '') ? $linkUrl : 'store.php?id=' .$factoryId;
$slogan = $Show_data[$key]['slogan'];
$showhtmlArr[] = '<li><a href="' .$linkUrl. '"><img width="850" height="430" src="' .$picUrl. '"></a><p>' .$slogan. '</p></li>';
}
$Showhtml = implode('', $showhtmlArr);
//首页翻滚广告
$adtype = 1;
$ADTypes = array("type"=>$adtype);
$ADList_result = $client->getADList($ADTypes);
$getADListResult = $ADList_result->getADListResult;
$getADListResultArray = json_decode($getADListResult, TRUE);
//开始解析
$ADList_totalCount = $getADListResultArray[0]['totalCount'];
$ADList_success = $getADListResultArray[0]['success'];
$ADList_data = $getADListResultArray[0]['data'];
$ADListhtml = '';
foreach($ADList_data as $key=>$d){
$factoryId = $ADList_data[$key]['factoryId'];
$picUrl = $ADList_data[$key]['picUrl'];
$linkUrl = $ADList_data[$key]['linkUrl'];
$linkUrl = ($linkUrl != '') ? $linkUrl : 'store.php?id=' .$factoryId;
$adlisthtmlArr[] = '<li><a href="' .$linkUrl. '" target="_blank"><img src="' .$picUrl. '" /></a></li>';
}
$ADListhtml = implode('', $adlisthtmlArr);
//热门厂家
$hotF_result = $client->PD_hotFactory($xml);
$PD_hotFactoryResult = $hotF_result->PD_hotFactoryResult;
$PD_hotFactoryResultArray = json_decode($PD_hotFactoryResult, TRUE);
//开始解析
$hotF_totalCount = $PD_hotFactoryResultArray[0]['totalCount'];
$hotF_success = $PD_hotFactoryResultArray[0]['success'];
$hotF_data = $PD_hotFactoryResultArray[0]['data'];
if ($hotF_totalCount > 0 && $hotF_success == true)
{
$hotFactoryhtml = '';
foreach($hotF_data as $key=>$d){
// $factoryId = $data[$key]['factoryId'];
$factoryName = $hotF_data[$key]['factoryName'];
$factoryId = $hotF_data[$key]['factoryId'];
// $ListPic = $data[$key]['ListPic'];
$hotFactoryhtmlArr[] = '<a href="store.php?id=' .$factoryId. '"><li>' .$factoryName. '</li></a>';
}
$hotFactoryhtml = implode('', $hotFactoryhtmlArr);
}
//根据市获取区域列表
$citys = array("city"=>$city);
$getDistrictByCity_result = $client->PD_getDistrictByCity($citys);
$PD_getDistrictByCityResult = $getDistrictByCity_result->PD_getDistrictByCityResult;
$PD_getDistrictByCityResultArray = json_decode($PD_getDistrictByCityResult, TRUE);
//解析区域
$City_totalCount = $PD_getDistrictByCityResultArray[0]['totalCount'];
$City_success = $PD_getDistrictByCityResultArray[0]['success'];
$City_data = $PD_getDistrictByCityResultArray[0]['data'];
//全部区域
$Cityhtml = '';
foreach($City_data as $key=>$d){
$district = $City_data[$key]['district'];
$CityhtmlArr[] = '<a href="search.php?city='. $city .'&dist=' . $district . '"><li>' .$district. '</li></a>';
}
$Cityhtml = implode('', $CityhtmlArr);
//产品分类
$ProductType_result = $client->PD_ProductType($xml);
$PD_ProductTypeResult = $ProductType_result->PD_ProductTypeResult;
$PD_ProductTypeResultArray = json_decode($PD_ProductTypeResult, TRUE);
//开始解析
$ProductType_totalCount = $PD_ProductTypeResultArray[0]['totalCount'];
$ProductType_success = $PD_ProductTypeResultArray[0]['success'];
$ProductType_data = $PD_ProductTypeResultArray[0]['data'];
$ProductTypehtml = '';
foreach($ProductType_data as $key=>$d){
$SeriesId = $ProductType_data[$key]['SeriesId'];
$SeriesName = $ProductType_data[$key]['SeriesName'];
if(isset($ProductType_data[$key]['Type'])){
foreach($ProductType_data[$key]['Type'] as $k=>$pt){
$TypeId = $ProductType_data[$key]['Type'][$k]['TypeId'];
$TypeName = $ProductType_data[$key]['Type'][$k]['TypeName'];
$TypeNamehtmlArr[] = '<dl class="afcl"><dt><a href="search.php?seriesId=' .$SeriesId. '&typeId=' .$TypeId. '" type_id="' .$TypeId. '">' .$TypeName. '</a></dt></dl>';
}
$TypeNamehtml = implode('', $TypeNamehtmlArr);
$ProductTypehtmlArr[] = '<div class="parent" onmouseover="this.className=\'parent activep\'" onmouseout="this.className=\'parent\'"><p><a href="search.php?seriesId=' .$SeriesId. '" series_id="' .$SeriesId. '">' .$SeriesName. '</a></p><div class="subs">' .$TypeNamehtml. '</div></div>';
$TypeNamehtml = '';
$TypeNamehtmlArr = '';
$ProductTypehtml = implode('', $ProductTypehtmlArr);
}
else{
$ProductTypehtmlArr[] = '<div class="parent" onmouseover="this.className=\'parent activep\'" onmouseout="this.className=\'parent\'"><p><a href="search.php?seriesId=' .$SeriesId. '" series_id="' .$SeriesId. '">' .$SeriesName. '</a></p></div>';
}
}
$ProductTypehtml = implode('', $ProductTypehtmlArr);
//产品分类
$ProductTypeindexhtml = '';
foreach($ProductType_data as $key=>$d){
$ff = $ProductType_data[0]['SeriesName'];
$sf = $ProductType_data[1]['SeriesName'];
$tf = $ProductType_data[2]['SeriesName'];
$fof = $ProductType_data[3]['SeriesName'];
$ff_id = $ProductType_data[0]['SeriesId'];
$sf_id = $ProductType_data[1]['SeriesId'];
$tf_id = $ProductType_data[2]['SeriesId'];
$fof_id = $ProductType_data[3]['SeriesId'];
}
if($user_id > 0 && $ProxyName == ''){
$right_user = '<div class="usename_show">'.$phoneNumber.'</div> ';
}
else if($user_id > 0 && $ProxyName != ''){
$right_user = '<div class="usename_show">'.$ProxyName.'</div> ';
}
else{
$right_user = '<ul class="denglubtn"><a href="login.html"><li>登录</li></a><a href="register.html"><li>注册</li></a></ul>';
}
//新闻信息展示
$pageIndex=1;
$pageSize=20;
$parms = array("pageIndex"=>$pageIndex,"pageSize"=>$pageSize);
$result = $client->getIndexFInfo($parms);
if(!is_soap_fault($result)) {
//获取用户信息
$getIndexFInfoResult = $result->getIndexFInfoResult;
$getIndexFInfoResultArray = json_decode($getIndexFInfoResult, TRUE);
//开始解析
//获取用户信息
$getIndexFInfo_totalCount = $getIndexFInfoResultArray[0]['totalCount'];
$getIndexFInfo_success = $getIndexFInfoResultArray[0]['success'];
$getIndexFInfo_data = $getIndexFInfoResultArray[0]['data'];
if ($getIndexFInfo_totalCount > 0 && $getIndexFInfo_success == true)
{
$NewsListhtml = '';
foreach($getIndexFInfo_data as $item){
$fId = $item['factoryId'];
$InfoId = $item['InfoId'];
$InfoTitle = $item['InfoTitle'];
$NewsList_htmlArr[] = '<li><a href="store_newspage.php?factoryId=' . $fId . '&id=' . $InfoId . '">' . $InfoTitle . '</a></li>';
}
$NewsListhtml = implode('', $NewsList_htmlArr);
}
}
//输出模板
$filename = "brandWall.html";
$file = @fopen($filename,"r");
if ($file) {
$contents = @fread($file, filesize($filename));
$contents = str_replace("{\$hotFactoryhtml}", $hotFactoryhtml, $contents);
$contents = str_replace("{\$Showhtml}", $Showhtml, $contents);
$contents = str_replace("{\$ADListhtml}", $ADListhtml, $contents);
$contents = str_replace("{\$NewsListhtml}", $NewsListhtml, $contents);
$contents = str_replace("{\$user_head_html}", $user_head_html, $contents);
$contents = str_replace("{\$Cityhtml}", $Cityhtml, $contents);
$contents = str_replace("{\$ProductTypehtml}", $ProductTypehtml, $contents);
$contents = str_replace("{\$ad_head_html}", $ad_head_html, $contents);
$contents = str_replace("{\$search_head_html}", $search_head_html, $contents);
$contents = str_replace("{\$right_user}", $right_user, $contents);
$contents = str_replace("{\$userright_html}", $userright_html, $contents);
$contents = str_replace("{\$foot_html}", $foot_html, $contents);
$contents = str_replace("{\$1f}", $ff, $contents);
$contents = str_replace("{\$2f}", $sf, $contents);
$contents = str_replace("{\$3f}", $tf, $contents);
$contents = str_replace("{\$4f}", $fof, $contents);
$contents = str_replace("{\$1f_id}", $ff_id, $contents);
$contents = str_replace("{\$2f_id}", $sf_id, $contents);
$contents = str_replace("{\$3f_id}", $tf_id, $contents);
$contents = str_replace("{\$4f_id}", $fof_id, $contents);
echo $contents;
fclose($file);
}
?>
1
https://gitee.com/xuqipeter/pdw.git
git@gitee.com:xuqipeter/pdw.git
xuqipeter
pdw
品贷网
master

搜索帮助