query($sql1); while($msg1=$db->fetch_array($res1)){ $str1.="{\"no\":\"".$msg1["pl"]."\",\"title\":\"".$msg1["pl"]."\"},"; } if($str1) $str1=substr($str1,0,-1); // $arr_xse=array("je"=>"销售额","js"=>"销售量"); foreach($arr_xse as $key => $val){ $str2.="{\"no\":\"".$key."\",\"title\":\"".$val."\"},"; } if($str2) $str2=substr($str2,0,-1); // $ct=3; $str3=""; $sql3="select title from web_zdb_config group by title order by id"; $res3=$db->query($sql3); while($msg3=$db->fetch_array($res3)){ $str3.="{\"no\":\"".$ct."\",\"title\":\"".$msg3["title"]."\"},"; $ct++; } if($str3) $str3=substr($str3,0,-1); $json_data.="\"lscxk\":{\"cxe_options\":[".$str2."],\"pl_options\":[".$str1."]},"; $json_data.="\"dpxg_menu\":[".$str3."],"; break; case "get_lscxk": if($xseVal=="je"){ $table1.=" web_zdb_ls_je "; }else if($xseVal=="js"){ $table1.=" web_zdb_ls_js "; }else{ $table1.=" web_zdb_ls_je "; } $con=""; if($plVal){ $con.=" pl='".$plVal."' and "; } if($con) $con=" where ".substr($con,0,-4); $ct=0; $str1=""; $sql1="select * from ".$table1.$con." order by id limit 0,2"; $res1=$db->query($sql1); while($msg1=$db->fetch_array($res1)){ $mouthL=""; if($msg1["m1"]) $mouthL.="{\"title\":\"1月\",\"val\":\"".$msg1["m1"]."\"},"; if($msg1["m2"]) $mouthL.="{\"title\":\"2月\",\"val\":\"".$msg1["m2"]."\"},"; if($msg1["m3"]) $mouthL.="{\"title\":\"3月\",\"val\":\"".$msg1["m3"]."\"},"; if($msg1["m4"]) $mouthL.="{\"title\":\"4月\",\"val\":\"".$msg1["m4"]."\"},"; if($msg1["m5"]) $mouthL.="{\"title\":\"5月\",\"val\":\"".$msg1["m5"]."\"},"; if($msg1["m6"]) $mouthL.="{\"title\":\"6月\",\"val\":\"".$msg1["m6"]."\"},"; if($msg1["m7"]) $mouthL.="{\"title\":\"7月\",\"val\":\"".$msg1["m7"]."\"},"; if($msg1["m8"]) $mouthL.="{\"title\":\"8月\",\"val\":\"".$msg1["m8"]."\"},"; if($msg1["m9"]) $mouthL.="{\"title\":\"9月\",\"val\":\"".$msg1["m9"]."\"},"; if($msg1["m10"]) $mouthL.="{\"title\":\"10月\",\"val\":\"".$msg1["m10"]."\"},"; if($msg1["m11"]) $mouthL.="{\"title\":\"11月\",\"val\":\"".$msg1["m11"]."\"},"; if($msg1["m12"]) $mouthL.="{\"title\":\"12月\",\"val\":\"".$msg1["m12"]."\"},"; if($mouthL) $mouthL=deel_end($mouthL); $xszl=$msg1["m1"]+$msg1["m2"]+$msg1["m3"]+$msg1["m4"]+$msg1["m5"]+$msg1["m6"]+$msg1["m7"]+$msg1["m8"]+$msg1["m9"]+$msg1["m10"]+$msg1["m11"]+$msg1["m12"]; $mouthmax=max($msg1["m1"],$msg1["m2"],$msg1["m3"],$msg1["m4"],$msg1["m5"],$msg1["m6"],$msg1["m7"],$msg1["m8"],$msg1["m9"],$msg1["m10"],$msg1["m11"],$msg1["m12"]); // $str1.="{"; $str1.="\"id\":\"".$msg1["id"]."\","; $str1.="\"kh\":\"".$msg1["kh"]."\","; $str1.="\"pl\":\"".$msg1["pl"]."\","; $str1.="\"price\":\"".$msg1["price"]."\","; $str1.="\"ph\":\"".$msg1["ph"]."\","; $str1.="\"xsje_zb\":\"".$msg1["xsje_zb"]."\","; $str1.="\"xsje\":\"".$msg1["xsje"]."\","; $str1.="\"ljxsje_zb\":\"".$msg1["ljxsje_zb"]."\","; $str1.="\"zfs\":\"".$msg1["zfs"]."\","; $str1.="\"dzl\":\"".$msg1["dzl"]."\","; $str1.="\"mouthlist\":[".$mouthL."],"; $str1.="\"mouthmax\":\"".$mouthmax."\","; $str1.="\"xszl\":\"".$xszl."\""; $str1.="},"; $ct++; } if($str1) $str1=substr($str1,0,-1); if($ct===0){ $str1=""; }else if($ct==1){ $str1="{\"id\":\"-1\"},".$str1.",{\"id\":\"-1\"}"; }else{ $str1="{\"id\":\"-1\"},".$str1; } $json_data.="\"cxk_list\":[".$str1."],"; break; case "get_lscxk_id": if($xseVal=="je"){ $table1.=" web_zdb_ls_je "; }else if($xseVal=="js"){ $table1.=" web_zdb_ls_js "; }else{ $table1.=" web_zdb_ls_je "; } $con=""; if($plVal){ $con.=" pl='".$plVal."' and "; } if($direction=="prev"){ //上一款 $tmp=get_db_msg("select * from ".$table1." where ".$con." id<'".$lsid."' order by id desc limit 0,1"); $zid=$tmp["id"]>0?$tmp["id"]:"-1"; }else{ //下一款 $tmp=get_db_msg("select * from ".$table1." where ".$con." id>'".$lsid."' order by id limit 0,1"); $zid=$tmp["id"]>0?$tmp["id"]:"-1"; } // $mouthL=""; if($tmp["m1"]) $mouthL.="{\"title\":\"1月\",\"val\":\"".$tmp["m1"]."\"},"; if($tmp["m2"]) $mouthL.="{\"title\":\"2月\",\"val\":\"".$tmp["m2"]."\"},"; if($tmp["m3"]) $mouthL.="{\"title\":\"3月\",\"val\":\"".$tmp["m3"]."\"},"; if($tmp["m4"]) $mouthL.="{\"title\":\"4月\",\"val\":\"".$tmp["m4"]."\"},"; if($tmp["m5"]) $mouthL.="{\"title\":\"5月\",\"val\":\"".$tmp["m5"]."\"},"; if($tmp["m6"]) $mouthL.="{\"title\":\"6月\",\"val\":\"".$tmp["m6"]."\"},"; if($tmp["m7"]) $mouthL.="{\"title\":\"7月\",\"val\":\"".$tmp["m7"]."\"},"; if($tmp["m8"]) $mouthL.="{\"title\":\"8月\",\"val\":\"".$tmp["m8"]."\"},"; if($tmp["m9"]) $mouthL.="{\"title\":\"9月\",\"val\":\"".$tmp["m9"]."\"},"; if($tmp["m10"]) $mouthL.="{\"title\":\"10月\",\"val\":\"".$tmp["m10"]."\"},"; if($tmp["m11"]) $mouthL.="{\"title\":\"11月\",\"val\":\"".$tmp["m11"]."\"},"; if($tmp["m12"]) $mouthL.="{\"title\":\"12月\",\"val\":\"".$tmp["m12"]."\"},"; if($mouthL) $mouthL=deel_end($mouthL); $xszl=$tmp["m1"]+$tmp["m2"]+$tmp["m3"]+$tmp["m4"]+$tmp["m5"]+$tmp["m6"]+$tmp["m7"]+$tmp["m8"]+$tmp["m9"]+$tmp["m10"]+$tmp["m11"]+$tmp["m12"]; $mouthmax=max($tmp["m1"],$tmp["m2"],$tmp["m3"],$tmp["m4"],$tmp["m5"],$tmp["m6"],$tmp["m7"],$tmp["m8"],$tmp["m9"],$tmp["m10"],$tmp["m11"],$tmp["m12"]); $str1="{\"id\":\"".$zid."\",\"kh\":\"".$tmp["kh"]."\",\"pl\":\"".$tmp["pl"]."\",\"price\":\"".$tmp["price"]."\",\"ph\":\"".$tmp["ph"]."\",\"xsje_zb\":\"".$tmp["xsje_zb"]."\",\"xsje\":\"".$tmp["xsje"]."\",\"ljxsje_zb\":\"".$tmp["ljxsje_zb"]."\",\"zfs\":\"".$tmp["zfs"]."\",\"dzl\":\"".$tmp["dzl"]."\",\"mouthlist\":[".$mouthL."],\"mouthmax\":\"".$mouthmax."\",\"xszl\":\"".$xszl."\"}"; $json_data.="\"cxk_detail\":[".$str1."],"; break; case "get_dpxg1": $str1=""; $sql1="select name from web_zdb_dpxg where title='".$title."' group by name"; $res1=$db->query($sql1); while($msg1=$db->fetch_array($res1)){ $ct=1; $str2=""; $sql2="select xdata,ydata from web_zdb_dpxg where title='".$title."' and name='".$msg1["name"]."' order by xdata"; $res2=$db->query($sql2); while($msg2=$db->fetch_array($res2)){ $str2.="{\"no\":\"".$ct."\",\"title\":\"".$msg2["xdata"]."\",\"value\":\"".$msg2["ydata"]."\"},"; $ct++; } $str1.="{\"no\":\"1\",\"title\":\"".$msg1["name"]."\",\"content\":[".substr($str2,0,-1)."]},"; } if($str1) $str1=substr($str1,0,-1); $json_data.="\"data\":[".$str1."],"; break; case "get_dpxg2": $str1=""; $sql1="select * from web_zdb_dpxg where title='".$title."'"; $res1=$db->query($sql1); while($msg1=$db->fetch_array($res1)){ $str1.="{\"name\": \"".$msg1["name"]."\",\"xAxis\":\"".$msg1["xdata"]."\",\"yAxis\":\"".$msg1["ydata"]."\"},"; } if($str1) $str1=substr($str1,0,-1); $json_data.="\"data\":[".$str1."],"; break; case "get_dpxg_select": $str1=""; $sql1="select * from web_zdb_config where title='".$title."'"; $res1=$db->query($sql1); while($msg1=$db->fetch_array($res1)){ $str1.="{\"id\":\"".$msg1["id"]."\",\"title\": \"".$msg1["title2"]."\",\"tbcate\":\"".$msg1["tb_cate"]."\"},"; } if($str1) $str1=substr($str1,0,-1); $json_data.="\"data\":[".$str1."],"; break; case "get_dpxg_other": if($tbcate=="line"){ $str1=""; $sql1="select name from web_zdb_dpxg where title='".$title."' and title2='".$title2."' group by name"; $res1=$db->query($sql1); while($msg1=$db->fetch_array($res1)){ $ct=1; $str2=""; $sql2="select xdata,ydata from web_zdb_dpxg where title='".$title."' and title2='".$title2."' and name='".$msg1["name"]."' order by xdata"; $res2=$db->query($sql2); while($msg2=$db->fetch_array($res2)){ $str2.="{\"no\":\"".$ct."\",\"title\":\"".$msg2["xdata"]."\",\"value\":\"".$msg2["ydata"]."\"},"; $ct++; } $str1.="{\"no\":\"1\",\"title\":\"".$msg1["name"]."\",\"content\":[".substr($str2,0,-1)."]},"; } if($str1) $str1=substr($str1,0,-1); $json_data.="\"data\":[".$str1."],"; }else if($tbcate=="markArea"){ $str1=""; $sql1="select * from web_zdb_dpxg where title='".$title."' and title2='".$title2."'"; $res1=$db->query($sql1); while($msg1=$db->fetch_array($res1)){ $str1.="{\"name\": \"".$msg1["name"]."\",\"xAxis\":\"".$msg1["xdata"]."\",\"yAxis\":\"".$msg1["ydata"]."\"},"; } if($str1) $str1=substr($str1,0,-1); $json_data.="\"data\":[".$str1."],"; }else if($tbcate=="bar" || $tbcate=="pie"){ $str1=""; $sql1="select * from web_zdb_dpxg where title='".$title."' and title2='".$title2."'"; $res1=$db->query($sql1); while($msg1=$db->fetch_array($res1)){ $str1.="{\"title\": \"".$msg1["xdata"]."\", \"value\": \"".$msg1["ydata"]."\"},"; } if($str1) $str1=substr($str1,0,-1); $json_data.="\"data\":[".$str1."],"; }else if($tbcate=="barmore"){ // $str4=""; $arr4=array(); $sql4="select name from web_zdb_dpxg where title='".$title."' and title2='".$title2."' group by name"; $res4=$db->query($sql4); while($msg4=$db->fetch_array($res4)){ $str4.="\"".$msg4["name"]."\","; $arr4[]=$msg4["name"]; } $str1=""; $sql1="select xdata from web_zdb_dpxg where title='".$title."' and title2='".$title2."' group by xdata"; $res1=$db->query($sql1); while($msg1=$db->fetch_array($res1)){ $str2=""; for($i=0;$iquery($sql4); while($msg4=$db->fetch_array($res4)){ $str4.="\"".$msg4["xdata"]."\","; $arr4[]=$msg4["xdata"]; } $str1=""; $str3=""; $sql1="select name from web_zdb_dpxg where title='".$title."' and title2='".$title2."' group by name"; $res1=$db->query($sql1); while($msg1=$db->fetch_array($res1)){ $str2=""; for($i=0;$i".$zsh." order by zsh limit 0,1"); }else if($direction=="prev"){ $tmp=get_db_msg("select * from web_kh_cl where zsh<".$zsh." order by zsh desc limit 0,1"); }else{ $tmp=get_db_msg("select * from web_kh_cl order by zsh limit 0,1"); } $this_zsh=$tmp["zsh"]?$tmp["zsh"]:"-1"; $str1=""; if($this_zsh=="-1"){ $str1.="\"zsh\":\"-1\""; }else{ $clpic=get_kh_cl_big($tmp["pic"],$flag_pad_offline); $tmppic=out_good_pic_set_arr($clpic,400,300); $str1.="\"zsh\":\"".$this_zsh."\","; $str1.="\"pic\":\"".$clpic."\","; $str1.="\"pic_w\":\"".$tmppic[0]."\","; $str1.="\"pic_h\":\"".$tmppic[1]."\","; $str1.="\"pic_remark\":\"".$tmp["remark"]."\","; // $str2=""; $sql="select * from web_kh_cl where zsh='".$this_zsh."' group by kh,color order by ord"; $res=$db->query($sql); while($msg=$db->fetch_array($res)){ $tmp_kh=get_db_msg("select * from web_kh where no='".$msg["kh"]."'"); $tmp_zdb_yc=get_db_msg("select * from web_zdb_yc where no='".$msg["kh"]."' and color='".$msg["color"]."'"); $tmp_order=get_db_msg("select sum(num) 'js' from web_order where uid='".$uid."' and no='".$msg["kh"]."' and color='".$msg["color"]."' and ka<>'y' and _key='".$_key."'"); $pic=get_kh_color_picture($msg["kh"],$msg["color"],$flag_pad_offline); $tmppic=out_good_pic_set_arr($pic,100,100); $str2.="{"; $str2.="\"khid\":\"".$tmp_kh["id"]."\","; $str2.="\"pic\":\"".$pic."\","; $str2.="\"pic_w\":\"".$tmppic[0]."\","; $str2.="\"pic_h\":\"".$tmppic[1]."\","; $str2.="\"kh\":\"".$msg["kh"]."\","; $str2.="\"pl\":\"".get_cate_title_no("category",$tmp_kh["category"])."\","; $str2.="\"khzd1\":\"".get_cate_title_no($khzd1,$tmp_kh[$khzd1])."\","; $str2.="\"khzd2\":\"".get_cate_title_no($khzd2,$tmp_kh[$khzd2])."\","; $str2.="\"khzd3\":\"".get_cate_title_no($khzd3,$tmp_kh[$khzd3])."\","; $str2.="\"color\":\"".$msg["color"]."\","; $str2.="\"remark\":\"".get_cate_title_no("color",$msg["color"])."\","; $str2.="\"ycgxd\":\"".$tmp_zdb_yc["ycgxd"]."\","; $str2.="\"tjdhl\":\"".$tmp_zdb_yc["tjdhl"]."\","; $str2.="\"tjdhl1\":\"".$tmp_zdb_yc["tjdhl1"]."\","; $str2.="\"zd1\":\"".$tmp_zdb_yc["zd1"]."\","; $str2.="\"zd2\":\"".$tmp_zdb_yc["zd2"]."\","; $str2.="\"zd3\":\"".$tmp_zdb_yc["zd3"]."\","; $str2.="\"zd4\":\"".$tmp_zdb_yc["zd4"]."\","; $str2.="\"zd5\":\"".$tmp_zdb_yc["zd5"]."\","; $str2.="\"zd6\":\"".$tmp_zdb_yc["zd6"]."\","; $str2.="\"zd7\":\"".$tmp_zdb_yc["zd7"]."\","; $str2.="\"zd8\":\"".$tmp_zdb_yc["zd8"]."\","; $str2.="\"zd9\":\"".$tmp_zdb_yc["zd9"]."\","; $str2.="\"zd10\":\"".$tmp_zdb_yc["zd10"]."\","; $str2.="\"ydjs\":\"".$tmp_order["js"]."\""; $str2.="},"; } $str1.="\"dks\":[".substr($str2,0,-1)."]"; } $json_data.="\"cldata\":{".$str1."},"; break; } $json_data=substr($json_data,0,-1)."}"; echo $json_data; ?>