7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
176 lines
6.7 KiB
PHP
176 lines
6.7 KiB
PHP
<?php
|
||
//-------------------------------推送
|
||
/*
|
||
店铺和主讲和陈列师
|
||
*/
|
||
$uid=check_cookie_jxs();
|
||
//$db=_mysql_connect();
|
||
$msg_login=get_db_msg("select * from ".$table_pre."client where id='".$uid."'");
|
||
$upath=$msg_login["path"]."-".$uid;
|
||
|
||
$sys_enable_tb="y";
|
||
$tmpl_m5_lie=4;
|
||
$tmpl_m5_pic_width=188;
|
||
$tmpl_m5_pic_height=250;
|
||
$tmpl_m5_cl_pic_width=400;
|
||
$tmpl_m5_cl_pic_height=300;
|
||
|
||
$tmpl_no_pic_width=250;
|
||
$tmpl_no_pic_height=250;
|
||
$pic_background=get_set("pic_background");
|
||
$pic_background=$pic_background?$pic_background:"#ffffff";
|
||
|
||
$sys_close=get_set("sys_close");
|
||
$sys_close_image=get_set("sys_close_image");
|
||
$sys_size_num=get_max_size_num();
|
||
|
||
$json_data="{";
|
||
$bs_kh_dj=get_set("bs_kh_dj");
|
||
$json_data.="\"bs_kh_dj\":\"".$bs_kh_dj."\",";
|
||
|
||
header("Content-type: text/html; charset=utf-8");
|
||
|
||
if(THIS_IN!="edt_ipad")
|
||
exit("错误的访问!");
|
||
$json_data.="\"pic_background\":\"".$pic_background."\",";
|
||
$json_data.="\"face\":\"".$msg_login["face"]."\",";
|
||
if($msg_login["face"]=="2"){
|
||
$face="qj";
|
||
}
|
||
switch($_a){
|
||
case "ajax_tb":
|
||
//----------------------------同步
|
||
$w2=$tmpl_m5_pic_width;
|
||
$h2=$tmpl_m5_pic_height;
|
||
//取得默认展厅
|
||
if($s_tid){
|
||
$tid=$s_tid;
|
||
}
|
||
$json_data.="\"s_tid\":\"".$s_tid."\",";
|
||
$tmp=get_db_msg("select id from ".$table_pre."kh_tb_t limit 0,1");
|
||
$tid=$tid?$tid:$tmp["id"];
|
||
$json_data.="\"tid\":\"".$tid."\",";
|
||
//
|
||
$m=get_db_msg("select zsh,title,pic from ".$table_pre."kh_tb where tid='".$tid."' and is_show='y' group by zsh order by zsh desc limit 0,1");
|
||
if($m["zsh"]>0){
|
||
$str=$m["zsh"]."||";
|
||
$str.=$m["title"]."||";
|
||
$json_data.="\"zsh\":\"".$m["zsh"]."\",";
|
||
$json_data.="\"title\":\"".$m["title"]."\",";
|
||
|
||
|
||
//图片
|
||
$pic1="";
|
||
if(trim($m["pic"])){
|
||
$pic1=get_picture($m["pic"],$flag_pad_offline);
|
||
//$str.=$pic1."|".str_replace("\"","'",out_good_pic_set($pic1,$tmpl_m5_cl_pic_width,$tmpl_m5_cl_pic_height));
|
||
$tmpwh=out_good_pic_set_arr($pic1,$tmpl_m5_cl_pic_width,$tmpl_m5_cl_pic_height);
|
||
$json_data.="\"pic\":\"".$pic1."\",";
|
||
$json_data.="\"pic_w\":\"".$tmpwh[0]."\",";
|
||
$json_data.="\"pic_h\":\"".$tmpwh[1]."\",";
|
||
}else{
|
||
$pic1="images/no_pic_big.png";
|
||
$json_data.="\"pic\":\"".$pic1."\",";
|
||
$json_data.="\"pic_w\":\"".$tmpl_no_pic_width."\",";
|
||
$json_data.="\"pic_h\":\"".$tmpl_no_pic_height."\",";
|
||
}
|
||
|
||
$str.="||";
|
||
$query="select title,iid,color from ".$table_pre."kh_tb where tid='".$tid."' and zsh='".$m["zsh"]."' order by ord";
|
||
//echo $query."<br>";
|
||
$res=$db->query($query);
|
||
$style_title_color=get_set("style_title_color");
|
||
$ka_color=get_set("ka_color");
|
||
$str.="var arr_content=[";
|
||
$str_arr_content="";
|
||
while($msg=$db->fetch_array($res)){
|
||
$m_kh=get_db_msg("select * from ".$table_pre."kh where id='".$msg["iid"]."'");
|
||
if($m_kh["ka"]=="y"){
|
||
$c=$ka_color;
|
||
}else{
|
||
$c=get_set_value_dote($style_title_color,$m_kh["kh_dj"]);
|
||
}
|
||
if($msg["iid"]>0){
|
||
//图片获取规则
|
||
if($msg["color"]){
|
||
$pic=get_kh_color_picture($m_kh["no"],$msg["color"],$flag_pad_offline);
|
||
if($face=="qj"){
|
||
$tmp=get_db_msg("select sum(num) 'num' from ".$table_pre."order where ka<>'y' and _key='".$_key."' and iid='".$m_kh["id"]."' and color='".$msg["color"]."' ".get_qj_ucon_all_dpid($msg_login["charge_uid"],""));
|
||
$n1=deel_num($tmp["num"]);
|
||
}else{
|
||
$n1=deel_num(get_order_num_kh_color($m_kh["id"],$msg["color"]));
|
||
}
|
||
}else{
|
||
$pic=get_kh_picture($m_kh["no"],$m_kh["main_pic"],$m_kh["color"],$flag_pad_offline);
|
||
if($face=="qj"){
|
||
$tmp=get_db_msg("select sum(num) 'num' from ".$table_pre."order where ka<>'y' and _key='".$_key."' and iid='".$m_kh["id"]."' ".get_qj_ucon_all_dpid($msg_login["charge_uid"],""));
|
||
$n1=deel_num($tmp["num"]);
|
||
}else{
|
||
$n1=deel_num(get_order_num_kh($m_kh["id"]));
|
||
}
|
||
}
|
||
//取得评价信息
|
||
$tmp=get_db_msg("select id,race,remark from ".$table_pre."client_pj where khid='".$m_kh["id"]."' and cid='".$uid."'");
|
||
$pj_race=$tmp["race"]>0?$tmp["race"]:0;
|
||
$pj_id=$tmp["id"]>0?$tmp["id"]:0;
|
||
$msg_pj=$pj_id."|".$pj_race."|".deel_js_var($tmp["remark"]);
|
||
//取得滑动展示信息
|
||
$text_main="";
|
||
$q="select * from ".$table_pre."keyword where cate='arr_select' and flag_ka='y' and no<>'jgd' and no<>'sx' and no<>'color' order by ord";
|
||
$r=$db->query($q);
|
||
while($m=$db->fetch_array($r)){
|
||
if($m["no"]=="zd1" || $m["no"]=="zd2" || $m["no"]=="zd3"){
|
||
//$text_main.=$m_kh[$m["no"]].",";
|
||
$text_main.=",\"".$m["no"]."\":\"".$m_kh[$m["no"]]."\"";
|
||
}else{
|
||
//$text_main.=deel_js_var(get_cate_title_no($m["no"],$m_kh[$m["no"]])).",";
|
||
$text_main.=",\"".$m["no"]."\":\"".deel_js_var(get_cate_title_no($m["no"],$m_kh[$m["no"]]))."\"";
|
||
}
|
||
}
|
||
//if($text_main)
|
||
//$text_main=substr($text_main,0,-2);
|
||
if($m_kh["remark"]!="")
|
||
$text_main.=",\"remark\":\"".deel_js_var(dhtmlchars($m_kh["remark"]))."\"";
|
||
//$str.=$m_kh["id"].",\"".get_kh_xh($m_kh,$msg["color"])."\",\"".$m_kh["no"]."|".$msg["color"]."\",".deel_num($m_kh["price"]).",\"".$pic."\",\"".str_replace("\"","'",out_good_pic_set($pic,$w2,$h2))."\",".$n1.",\"".$c."\",\"".$msg_pj."\",\"".$text_main."\",";
|
||
$clt="";
|
||
if($msg["color"]){
|
||
$clt=get_cate_title_no("color",$msg["color"]);
|
||
}
|
||
$tmpwh=out_good_pic_set_arr($pic,$w2,$h2);
|
||
$str_arr_content.="{\"khid\":\"".$m_kh["id"]."\",\"kh_dj\":\"".get_cate_title_no("kh_dj",$m_kh["kh_dj"])."\",\"xh\":\"".get_kh_xh($m_kh,$msg["color"])."\",\"kh\":\"".$m_kh["no"]."\",\"color\":\"".$msg["color"]."\",\"colort\":\"".$clt."\",\"price\":\"".deel_num($m_kh["price"])."\",\"pic\":\"".$pic."\",\"pic_w\":\"".$tmpwh[0]."\",\"pic_h\":\"".$tmpwh[1]."\",\"num\":\"".$n1."\",\"style_color\":\"".$c."\",\"xj\":\"".$pj_race."\",\"pjwz\":\"".deel_js_var($tmp["remark"])."\"".$text_main."},";
|
||
}
|
||
}
|
||
$str_arr_content=substr($str_arr_content,0,-1);
|
||
$json_data.="\"tss\":[".$str_arr_content."],";
|
||
$str.="]";
|
||
}else{
|
||
$str="0||";
|
||
$json_data.="\"code\":0,\"msg\":\"暂无数据\",";
|
||
}
|
||
break;
|
||
default:
|
||
if($sys_enable_tb=="y"){
|
||
|
||
//取得默认展厅
|
||
$tmp=get_db_msg("select id from ".$table_pre."kh_tb_t limit 0,1");
|
||
$s_tid=$s_tid?$s_tid:$tmp["id"];
|
||
$json_data.="\"s_tid\":\"".$s_tid."\",";
|
||
//取得展厅信息
|
||
$arr_select_zt="";
|
||
|
||
$q="select * from ".$table_pre."kh_tb_t";
|
||
$r=$db->query($q);
|
||
while($m=$db->fetch_array($r)){
|
||
//$arr_select_zt.="\"".$m["id"]."|".$m["title"]."\",";
|
||
$arr_select_zt.="{\"id\":\"".$m["id"]."\",\"title\":\"".$m["title"]."\"},";
|
||
}
|
||
$arr_select_zt=substr($arr_select_zt,0,-1);
|
||
$json_data.="\"zt\":[".$arr_select_zt."],";
|
||
}else{
|
||
$json_data.="\"code\":0,\"msg\":\"对不起,目前只有IPAD支持该功能!\",";
|
||
}
|
||
break;
|
||
}
|
||
$json_data=substr($json_data,0,-1)."}";
|
||
echo $json_data;
|
||
?>
|