chore: 添加多个图片和资源文件
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
This commit is contained in:
@@ -0,0 +1,528 @@
|
||||
<?php
|
||||
//-------------------------------选项设置
|
||||
header("Content-type: text/html; charset=utf-8");
|
||||
if(THIS_IN!="edt_admin")
|
||||
exit("错误的访问!");
|
||||
$msg_login_user=get_db_msg("select * from ".$table_pre."user where id='".$uid."'");
|
||||
//---------priv
|
||||
$priv=return_priv($_m,$msg_login_user["priv"]);
|
||||
$json_data="{";
|
||||
if($priv[0]=="n"){
|
||||
//没有操作权限
|
||||
$json_data.="\"error\":\"没有操作权限\",\"code\":0,\"msg\":\"\",\"count\":0,\"data\":[],";
|
||||
}else{
|
||||
$arr_column_keyword=array("no"=>"编号","title"=>"名称");
|
||||
$arr_column_keyword_sx=array("no"=>"编号","title"=>"名称","color"=>"颜色名称");
|
||||
if($s_cate=="color")
|
||||
$s_cate_title="颜色";
|
||||
else
|
||||
$s_cate_title=get_cate_title_no("arr_select",$s_cate);
|
||||
//
|
||||
$check=get_db_msg("select count(*) 'num' from ".$table_pre."keyword where cate='arr_select'");
|
||||
if($check["num"]==0){
|
||||
//写入默认数据
|
||||
foreach($arr_global_select as $no => $title){
|
||||
$q="insert into ".$table_pre."keyword (ord,title,cate,no) values ('1','".$title."','arr_select','".$no."')";
|
||||
$db->query($q);
|
||||
}
|
||||
}
|
||||
switch($_a){
|
||||
case "set_color" :
|
||||
//--------------------------设置颜色
|
||||
//取得默认值
|
||||
$m1=get_db_msg("select * from ".$table_pre."sx where no='".$no."' limit 0,1");
|
||||
$json_data.="\"value\":\"".$m1["_v"]."\",";
|
||||
//取得已经被设置过的值
|
||||
$q="select * from ".$table_pre."sx where no<>'".$no."'";
|
||||
$r=$db->query($q);
|
||||
$str_color="";
|
||||
while($m=$db->fetch_array($r)){
|
||||
$t1=explode(",",$m["_v"]);
|
||||
if($m["_v"])
|
||||
$str_color.=$m["_v"].",";
|
||||
}
|
||||
$str_color=deel_end($str_color);
|
||||
$json_data.="\"color_picked\":\"".$str_color."\",";
|
||||
//取得所有颜色
|
||||
$q0="select no,title from ".$table_pre."keyword where cate='color' order by no";
|
||||
$r0=$db->query($q0);
|
||||
$str_color="";
|
||||
while($m0=$db->fetch_array($r0)){
|
||||
$str_color.="{\"no\":\"".$m0["no"]."\",\"title\":\"".$m0["title"]."\"},";
|
||||
}
|
||||
$str_color=deel_end($str_color);
|
||||
$json_data.="\"color\":[".$str_color."],";
|
||||
break;
|
||||
case "save_set_color" :
|
||||
//--------------------------保存颜色设置
|
||||
$tmp=get_db_msg("select id from ".$table_pre."keyword where cate='sx' and no='".$no."'");
|
||||
if($tmp["id"]>0){
|
||||
$_v=$color;
|
||||
$check=get_db_msg("select * from ".$table_pre."sx where no='".$no."'");
|
||||
if($check["id"]>0){
|
||||
$q="update ".$table_pre."sx set _v='".$_v."' where no='".$no."'";
|
||||
}else{
|
||||
$q="insert into ".$table_pre."sx (no,_v) values ('".$no."','".$_v."')";
|
||||
}
|
||||
//echo $q."<br>";
|
||||
$db->query($q);
|
||||
//设置订单表
|
||||
for($i=0;$i<count($color);$i++){
|
||||
$q1="update ".$table_pre."order set sx='".$no."' where color='".$color[$i]."' where _key='".$_key."'";
|
||||
//echo $q1."<br>";
|
||||
$db->query($q1);
|
||||
}
|
||||
$json_data.="\"code\":1,";
|
||||
}else{
|
||||
$json_data.="\"code\":0,\"msg\":\"色系不存在(".$no.")\",";
|
||||
}
|
||||
break;
|
||||
case "add" :
|
||||
if($id){
|
||||
$msg=get_db_msg("select * from ".$table_pre."keyword where id='".$id."'");
|
||||
$no=$msg["no"];
|
||||
$title=$msg["title"];
|
||||
}else{
|
||||
$tmp=get_db_msg("select max(no) 'no' from ".$table_pre."keyword where cate='".$s_cate."'");
|
||||
$no=($tmp["no"]>0)?($tmp["no"]+1):"";
|
||||
$title="";
|
||||
}
|
||||
$json_data.="\"no\":\"".$no."\",\"title\":\"".$title."\",";
|
||||
break;
|
||||
case "save_add" :
|
||||
//验证
|
||||
$c=get_db_msg("select count(*) 'num' from ".$table_pre."keyword where (no='".$no."') and id<>'".$id."' and cate='".$s_cate."'");
|
||||
if($c["num"]>0){
|
||||
$msg_error="该编号已经存在,请检查";
|
||||
$json_data.="\"code\":\"0\",\"msg\":\"".$msg_error."\",";
|
||||
}else{
|
||||
if($id){
|
||||
$msg=get_db_msg("select * from ".$table_pre."keyword where id='".$id."'");
|
||||
if($msg["no"]!=$no){
|
||||
//更新订单表
|
||||
$q1="update ".$table_pre."order set ".$s_cate."='".$no."' where ".$s_cate."='".$msg["no"]."' and _key='".$_key."'";
|
||||
$db->query($q1);
|
||||
//更新款号表
|
||||
if($s_cate=="color"){
|
||||
//颜色例外
|
||||
$q="select * from ".$table_pre."kh";
|
||||
$r=$db->query($q);
|
||||
while($m=$db->fetch_array($r)){
|
||||
$c=$m["color"];
|
||||
$tmp=explode(",",$c);
|
||||
$c_good="";
|
||||
$is_up="n";
|
||||
for($i=0;$i<count($tmp);$i++){
|
||||
if($tmp[$i]==$msg["no"]){
|
||||
$c_good.=$no.",";
|
||||
$is_up="y";
|
||||
}else{
|
||||
$c_good.=$tmp[$i].",";
|
||||
}
|
||||
}
|
||||
if($is_up=="y"){
|
||||
if($c_good)
|
||||
$c_good=substr($c_good,0,-1);
|
||||
$db->query("update ".$table_pre."kh set color='".$c_good."' where id='".$m["id"]."'");
|
||||
//更改图片
|
||||
$i="../attachments/design/mini/".$m["no"]."_".$msg["no"].".jpg";
|
||||
if(is_file($i)){
|
||||
//
|
||||
copy($i,"../attachments/design/mini/".$m["no"]."_".$no.".jpg");
|
||||
del_file($i);
|
||||
//
|
||||
copy("../attachments/design/big/".$m["no"]."_".$msg["no"].".jpg","../attachments/design/big/".$m["no"]."_".$no.".jpg");
|
||||
del_file("../attachments/design/big/".$m["no"]."_".$msg["no"].".jpg");
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if($s_cate=="sx"){
|
||||
$db->query("update ".$table_pre."sx set no='".$no."' where no='".$msg["no"]."'");
|
||||
}else{
|
||||
$db->query("update ".$table_pre."kh set ".$s_cate."='".$no."' where ".$s_cate."='".$msg["no"]."'");
|
||||
}
|
||||
}
|
||||
}
|
||||
$query="update ".$table_pre."keyword set no='".$no."',title='".$title."' where id='".$id."'";
|
||||
$db->query($query);
|
||||
$log_action="修改";
|
||||
}else{
|
||||
$query="insert ".$table_pre."keyword (no,title,cate) values ('".$no."','".$title."','".$s_cate."')";
|
||||
$db->query($query);
|
||||
$iid=$db->insert_id();
|
||||
$log_action="新增";
|
||||
}
|
||||
$lid=$id?$id:$iid;
|
||||
set_log($log_action."选项",$title."|".$lid);
|
||||
$json_data.="\"code\":\"1\",";
|
||||
}
|
||||
break;
|
||||
case "del" :
|
||||
$id=(is_array($id))?$id:array($id);
|
||||
$num=count($id);
|
||||
for($i=0;$i<$num;$i++){
|
||||
$tmp=get_db_msg("select * from ".$table_pre."keyword where id='".$id[$i]."'");
|
||||
if($tmp["cate"]=="sx"){
|
||||
$db->query("delete from ".$table_pre."sx where no='".$tmp["no"]."'");
|
||||
}
|
||||
$lid.=$tmp["title"]."|".$id[$i].", ";
|
||||
$db->query("delete from ".$table_pre."keyword where id='".$id[$i]."'");
|
||||
}
|
||||
$lid=substr($lid,0,-2);
|
||||
set_log("删除".$_title_,$lid);
|
||||
$json_data.="\"code\":1,";
|
||||
break;
|
||||
//------------------------------------------------------------------------------------选项设置
|
||||
case "save_select" :
|
||||
$query="select * from ".$table_pre."keyword where cate='arr_select' order by ord";
|
||||
$res=$db->query($query);
|
||||
while($msg=$db->fetch_array($res)){
|
||||
$var_title="title_".$msg["id"];
|
||||
$var_flag_ka="is_show_".$msg["id"];
|
||||
$var_flag_bd="is_bd_".$msg["id"];
|
||||
//
|
||||
$tmp_flag_ka=($$var_flag_ka=="on")?"y":"n";
|
||||
$tmp_flag_bd=($$var_flag_bd=="on")?"y":"n";
|
||||
$q="update ".$table_pre."keyword set title='".$$var_title."',flag_ka='".$tmp_flag_ka."',flag_bd='".$tmp_flag_bd."' where id='".$msg["id"]."'";
|
||||
//$query.=$q.";";
|
||||
$db->query($q);
|
||||
}
|
||||
set_log("修改字段设置");
|
||||
$json_data.="\"code\":1,";
|
||||
break;
|
||||
case "set_select":
|
||||
$query="select * from ".$table_pre."keyword where cate='arr_select' order by ord";
|
||||
//echo $query."<br>";
|
||||
$res=$db->query($query);
|
||||
$str="";
|
||||
while($msg=$db->fetch_array($res)){
|
||||
$str.="{\"id\":\"".$msg["id"]."\",\"no\":\"".$msg["no"]."\",\"title\":\"".$msg["title"]."\",\"flag_ka\":\"".$msg["flag_ka"]."\",\"flag_bd\":\"".$msg["flag_bd"]."\"},";
|
||||
}
|
||||
$json_data.="\"data\":[".deel_end($str)."],";
|
||||
break;
|
||||
//------------------------------------------------------------------------------------/选项设置
|
||||
//----------------------------------------------------------------------导入EXCEL
|
||||
case "import":
|
||||
//目录权限
|
||||
$arr_path=array(
|
||||
"cache"=>"admin/cache"
|
||||
);
|
||||
$json_data.="\"path_priv\":[";
|
||||
$tmp="";
|
||||
foreach($arr_path as $path_real => $path_title){
|
||||
$tmp.="{\"title\":\"".$path_title."\",\"priv\":";
|
||||
if(new_is_writeable($path_real)==1){
|
||||
$tmp.="\"y\"";
|
||||
}else{
|
||||
$tmp.="\"n\"";
|
||||
}
|
||||
$tmp.="},";
|
||||
}
|
||||
$json_data.=substr($tmp,0,-1)."],";
|
||||
break;
|
||||
case "import_check":
|
||||
$s_cate=$cate;
|
||||
if($s_cate=="sx")
|
||||
$arr_column1=$arr_column_keyword_sx;
|
||||
else
|
||||
$arr_column1=$arr_column_keyword;
|
||||
$file1=$_FILES["up_file"];
|
||||
//echo $file1["name"]."--";
|
||||
$tmp_file_name=save_tmp_file($file1);
|
||||
$tmp_content=get_tmp_content($tmp_file_name);
|
||||
$arr_content=explode("\n",$tmp_content);
|
||||
$arr_thead=get_table_thead($tmp_content);
|
||||
$arr_column=check_table_thead($arr_thead,$arr_column1);
|
||||
$msg="";
|
||||
if(count($arr_column[0])==0){
|
||||
$msg.="未检测到可导入字段,请返回检查EXCEL文件!";
|
||||
//del_tmp_file($tmp_file_name);
|
||||
$json_data.="\"code\":0,\"msg\":\"".$msg."\",";
|
||||
}else{
|
||||
$errmsg="";
|
||||
$arr_init=array();
|
||||
//新增导入时检查是否编号已存在
|
||||
for($i=1;$i<count($arr_content);$i++){
|
||||
$tmp_arr=explode("|^_^|",$arr_content[$i]);
|
||||
|
||||
for($k=0;$k<count($arr_column[0]);$k++){
|
||||
$ind=$arr_column[0][$k];
|
||||
$ititle=$arr_column[1][$k];
|
||||
if($ititle=="no"){
|
||||
$arr_init[]=trim($tmp_arr[$ind]);
|
||||
}
|
||||
}
|
||||
}
|
||||
$arr_result = array_unique($arr_init);
|
||||
if(count($arr_init)>0 && count($arr_init)!=count($arr_result)){
|
||||
$errmsg.="编号存在重复值,请返回检查EXCEL文件!";
|
||||
}
|
||||
|
||||
if($errmsg){
|
||||
$json_data.="\"code\":0,\"msg\":\"".$errmsg."\",";
|
||||
}else{
|
||||
//
|
||||
$column="";
|
||||
foreach($arr_column1 as $k => $v){
|
||||
$column.=$v.",";
|
||||
}
|
||||
if($column)
|
||||
$column=substr($column,0,-1);
|
||||
$msg1=array();
|
||||
$msg1[0]=array("可导入正确字段",$column);
|
||||
//
|
||||
$column="";
|
||||
for($i=0;$i<count($arr_thead);$i++){
|
||||
if(in_array(get_main_key($arr_column1,$arr_thead[$i]),$arr_column[1])){
|
||||
$style=" style='font-weight:bold;color:#0000ff'";
|
||||
}else{
|
||||
$style=" style='color:#cccccc'";
|
||||
}
|
||||
$column.="<span".$style.">".$arr_thead[$i]."</span>,";
|
||||
}
|
||||
if($column)
|
||||
$column=substr($column,0,-1);
|
||||
//
|
||||
$msg1[1]=array("检测到的有效字段",$column);
|
||||
//
|
||||
$total=count($arr_content)-1;
|
||||
$msg1[2]=array("记录条数",$total);
|
||||
$m1="";
|
||||
for($i=0;$i<count($msg1);$i++){
|
||||
$m1.="{\"col1\":\"".$msg1[$i][0]."\",\"col2\":\"".$msg1[$i][1]."\"},";
|
||||
}
|
||||
if($m1)
|
||||
$m1=substr($m1,0,-1);
|
||||
$json_data.="\"code\":1,\"tmp_file_name\":\"".$tmp_file_name."\",\"msg\":[".$m1."],";
|
||||
$json_data.="\"input\":[{\"type\":\"radio\",\"title\":\"导入方式\",\"name\":\"import_type\",\"op\":\"清空导入|新增导入\",\"value\":\"清空导入\"}],";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "import_do":
|
||||
$s_cate=$cate;
|
||||
$import_type=($import_type=="清空导入")?"y":"n";
|
||||
if($s_cate=="sx")
|
||||
$arr_column1=$arr_column_keyword_sx;
|
||||
else
|
||||
$arr_column1=$arr_column_keyword;
|
||||
$tmp_content=get_tmp_content($tmp_file_name);
|
||||
$arr_content=explode("\n",$tmp_content);
|
||||
$arr_thead=get_table_thead($tmp_content);
|
||||
$arr_column=check_table_thead($arr_thead,$arr_column1);
|
||||
$insert_column="";
|
||||
for($i=0;$i<count($arr_column[1]);$i++){
|
||||
if($arr_column[1][$i]!="color")//色系的颜色值不需要导入keyword表
|
||||
$insert_column.=$arr_column[1][$i].",";
|
||||
}
|
||||
if($import_type=="y"){
|
||||
$db->query("delete from ".$table_pre."keyword where cate='".$s_cate."'");
|
||||
}else{
|
||||
$error_str="";
|
||||
//新增导入时检查是否编号已存在
|
||||
for($i=1;$i<count($arr_content);$i++){
|
||||
$tmp_arr=explode("|^_^|",$arr_content[$i]);
|
||||
|
||||
for($k=0;$k<count($arr_column[0]);$k++){
|
||||
$ind=$arr_column[0][$k];
|
||||
$ititle=$arr_column[1][$k];
|
||||
if($ititle=="no"){
|
||||
$tmp_check_no=get_db_msg("select * from web_keyword where cate='".$s_cate."' and no='".trim($tmp_arr[$ind])."' limit 0,1");
|
||||
if($tmp_check_no["id"]){
|
||||
$error_str.=trim($tmp_arr[$ind]).",";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if($error_str){
|
||||
$errormsg="以下编号已存在:".substr($error_str,0,-1);
|
||||
$json_data.="\"code\":0,\"msg\":\"".$errormsg."\",";
|
||||
$json_data=substr($json_data,0,-1)."}";
|
||||
echo $json_data;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
//导入基础数据
|
||||
for($i=1;$i<count($arr_content);$i++){
|
||||
$tmp_arr=explode("|^_^|",$arr_content[$i]);
|
||||
$insert_value="";
|
||||
for($k=0;$k<count($arr_column[0]);$k++){
|
||||
$ind=$arr_column[0][$k];
|
||||
$ititle=$arr_column[1][$k];
|
||||
if($ititle=="color"){
|
||||
$color1=trim($tmp_arr[$ind]);
|
||||
}else{
|
||||
$insert_value.="'".mysql_escape_string(trim($tmp_arr[$ind]))."',";
|
||||
}
|
||||
}
|
||||
$q="insert into ".$table_pre."keyword (".$insert_column."cate,ord) values (".$insert_value."'".$s_cate."','".$i."')";
|
||||
//echo $i.".".$q."<br>";
|
||||
$db->query($q);
|
||||
}
|
||||
if($s_cate=="sx"){
|
||||
//处理颜色
|
||||
for($i=1;$i<count($arr_content);$i++){
|
||||
$tmp_arr=explode("|^_^|",$arr_content[$i]);
|
||||
$no=$color1="";
|
||||
for($k=0;$k<count($arr_column[0]);$k++){
|
||||
$ind=$arr_column[0][$k];
|
||||
$ititle=$arr_column[1][$k];
|
||||
if($ititle=="no")
|
||||
$no=trim($tmp_arr[$ind]);
|
||||
if($ititle=="color")
|
||||
$color1=trim($tmp_arr[$ind]);
|
||||
}
|
||||
//转换颜色
|
||||
$color="";
|
||||
$arr_color=explode(",",$color1);
|
||||
for($j=0;$j<count($arr_color);$j++){
|
||||
$tmp=get_db_msg("select no from ".$table_pre."keyword where cate='color' and title='".$arr_color[$j]."'");
|
||||
if($tmp["no"])
|
||||
$color.=$tmp["no"].",";
|
||||
}
|
||||
if($color)
|
||||
$color=substr($color,0,-1);
|
||||
$check=get_db_msg("select id from ".$table_pre."sx where no='".$no."'");
|
||||
if($check["id"]>0){
|
||||
$q="update ".$table_pre."sx set _v='".$color."' where id='".$check["id"]."'";
|
||||
$db->query($q);
|
||||
//设置订单表
|
||||
$arr_color=explode(",",$color);
|
||||
for($k=0;$k<count($arr_color);$k++){
|
||||
$q1="update ".$table_pre."order set sx='".$no."' where color='".$arr_color[$k]."' and _key='".$_key."'";
|
||||
$db->query($q1);
|
||||
}
|
||||
}else{
|
||||
$q="insert into ".$table_pre."sx (no,_v) values ('".$no."','".$color."')";
|
||||
$db->query($q);
|
||||
//设置订单表
|
||||
$arr_color=explode(",",$color);
|
||||
for($k=0;$k<count($arr_color);$k++){
|
||||
$q1="update ".$table_pre."order set sx='".$no."' where color='".$arr_color[$k]."' and _key='".$_key."'";
|
||||
$db->query($q1);
|
||||
}
|
||||
}
|
||||
//echo $i.".".$q."<br>";
|
||||
}
|
||||
}
|
||||
del_tmp_file($tmp_file_name);
|
||||
$log_remark=$import_flag;
|
||||
set_log("导入 ".get_cate_title_no("arr_select",$s_cate),$log_remark);
|
||||
$json_data.="\"code\":1,\"reload_type\":\"table\",";
|
||||
break;
|
||||
//----------------------------------------------------------------------/导入EXCEL
|
||||
//----------------------------------------------------------------------导出数据
|
||||
case "export":
|
||||
if($s_cate=="sx")
|
||||
$arr_column=$arr_column_keyword_sx;
|
||||
else
|
||||
$arr_column=$arr_column_keyword;
|
||||
$column="";
|
||||
foreach($arr_column as $k => $v){
|
||||
$column.="{\"k\":\"".$k."\",\"t\":\"".$v."\"},";
|
||||
}
|
||||
$column=deel_end($column);
|
||||
$json_data.="\"col\":[".$column."],";
|
||||
break;
|
||||
case "export_do":
|
||||
if($s_cate=="sx")
|
||||
$arr_column=$arr_column_keyword_sx;
|
||||
else
|
||||
$arr_column=$arr_column_keyword;
|
||||
foreach($arr_column as $k => $v){
|
||||
$var="col_".$k;
|
||||
if($$var=="on"){
|
||||
$ex_col[]=$k;
|
||||
}
|
||||
}
|
||||
$num=count($ex_col);
|
||||
if($num==0)
|
||||
alert_and_back("请至少选择一个要导出的字段!");
|
||||
$data=array();
|
||||
//设置表头数据类型
|
||||
for($i=0;$i<$num;$i++){
|
||||
$data["col"][]="str";
|
||||
}
|
||||
//设置表头
|
||||
for($i=0;$i<$num;$i++){
|
||||
$data["header"][0][]=get_main_value($arr_column,$ex_col[$i]);
|
||||
}
|
||||
$query="select * from ".$table_pre."keyword where cate='".$s_cate."' order by no";
|
||||
$r=$db->query($query);
|
||||
$row=0;
|
||||
while($m=$db->fetch_array($r)){
|
||||
for($i=0;$i<$num;$i++){
|
||||
$k=$ex_col[$i];
|
||||
if($k=="color"){
|
||||
//取得颜色
|
||||
$tmp=get_db_msg("select _v from ".$table_pre."sx where no='".$m["no"]."'");
|
||||
$tmp=explode(",",$tmp["_v"]);
|
||||
$str_color="";
|
||||
for($i1=0;$i1<count($tmp);$i1++){
|
||||
$str_color.=get_cate_title_no("color",$tmp[$i1]).",";
|
||||
}
|
||||
if($str_color)
|
||||
$str_color=substr($str_color,0,-1);
|
||||
$data["body"][$row][]=$str_color;
|
||||
}else{
|
||||
$data["body"][$row][]=$m[$k];
|
||||
}
|
||||
}
|
||||
$row++;
|
||||
}
|
||||
//var_dump($data);
|
||||
$file_name=$s_cate."_".date("Y-m-d-H-i");
|
||||
output_excel($file_name,$data);
|
||||
set_log("导出 ".get_cate_title_no("arr_select",$s_cate));
|
||||
exit;
|
||||
break;
|
||||
//----------------------------------------------------------------------/导出数据
|
||||
default :
|
||||
//
|
||||
$s_cate=$s_cate?$s_cate:"color";
|
||||
$json_data.="\"s_cate\":\"".$s_cate."\",";
|
||||
$sql_con="where cate='".$s_cate."'";
|
||||
$tmp=get_db_msg("select count(*) 'total' from ".$table_pre."keyword ".$sql_con);
|
||||
$total_num=$tmp["total"];
|
||||
//-----------------------tab
|
||||
$str_tab="";
|
||||
$q="select no,title from ".$table_pre."keyword where (cate='arr_select' or cate='zd_color') and no not in ('zd1','zd2','zd3') and flag_ka='y' order by ord";
|
||||
$r=$db->query($q);
|
||||
while($m=$db->fetch_array($r)){
|
||||
$str_tab.="{\"no\":\"".$m["no"]."\",\"title\":\"".$m["title"]."\"},";
|
||||
}
|
||||
$str_tab=deel_end($str_tab);
|
||||
$json_data.="\"tab\":[".$str_tab."],";
|
||||
//-----------------------/tab
|
||||
//
|
||||
$query="select * from ".$table_pre."keyword ".$sql_con." order by no";
|
||||
//echo $query."<br>";
|
||||
$res=$db->query($query);
|
||||
$count=0;
|
||||
$json_data.="\"code\":0,\"msg\":\"\",\"count\":".$total_num.",\"data\":[";
|
||||
$str_tmp="";
|
||||
while($msg=$db->fetch_array($res)){
|
||||
$list=$count_first+$count+1;
|
||||
$str_tmp.="{";
|
||||
$str_tmp.="\"id\":\"".$msg["id"]."\",";
|
||||
$str_tmp.="\"no\":\"".$msg["no"]."\",";
|
||||
$str_tmp.="\"title\":\"".$msg["title"]."\",";
|
||||
if($s_cate=="sx"){
|
||||
$b1="<input type=\"button\" value=\"设置颜色\" onclick=\"o_window('?_m=manage/sx_color&no=".$msg["no"]."','sx_color',500,300)\">";
|
||||
//取得色系
|
||||
$tmp=get_db_msg("select * from ".$table_pre."sx where no='".$msg["no"]."'");
|
||||
$sx=show_color($tmp["_v"]);
|
||||
}else{
|
||||
$sx="";
|
||||
}
|
||||
$str_tmp.="\"sx\":\"".$sx."\"";
|
||||
$str_tmp.="},";
|
||||
$count++;
|
||||
}
|
||||
$json_data.=substr($str_tmp,0,-1)."],";
|
||||
break;
|
||||
}
|
||||
}
|
||||
$json_data=substr($json_data,0,-1)."}";
|
||||
echo $json_data;
|
||||
?>
|
||||
Reference in New Issue
Block a user