7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
124 lines
4.4 KiB
PHP
124 lines
4.4 KiB
PHP
<?php
|
|
//----------------------------------------------------------订货规则设置
|
|
header("Content-type: text/html; charset=utf-8");
|
|
$gobal_cl_num=10;
|
|
if(THIS_IN!="edt_admin")
|
|
exit("错误的访问!");
|
|
//-------------------------------execute action
|
|
$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{
|
|
switch($_a1){
|
|
//------------------------------------------------------------------------------------规则启用设置
|
|
case "save_select" :
|
|
$query="";
|
|
//$json_data.="\"a\":\"a\",";
|
|
for($i=0;$i<count($id);$i++){
|
|
$vl="is_show_".$id[$i];
|
|
$flag=($$vl=="on")?"y":"n";
|
|
//$json_data.="\"f".$i."\":\"".$flag."\",";
|
|
$q="update ".$table_pre."keyword set flag_ka='".$flag."' where id='".$id[$i]."'";
|
|
$query.=$q.";";
|
|
$db->query($q);
|
|
}
|
|
set_log("修改规则启用");
|
|
$json_data.="\"code\":1,";
|
|
break;
|
|
case "save_select_id" :
|
|
$flag=($val=="on")?"y":"n";
|
|
$q="update ".$table_pre."keyword set flag_ka='".$flag."' where id='".$id."'";
|
|
$db->query($q);
|
|
|
|
set_log("修改规则启用");
|
|
$json_data.="\"code\":1,";
|
|
break;
|
|
case "set_select":
|
|
//
|
|
$sql_con="where cate='dhgz'";
|
|
//
|
|
$form_hidden=array(
|
|
"_a1"=>"",
|
|
"s_cate"=>$s_cate
|
|
);
|
|
$act="<input type=button value=' 保 存 ' class='btn_black' onclick=\"document.form1._a1.value='save_select';document.form1.submit();\">";
|
|
$act.="<input type=button value=' 返 回 ' class='btn_black' onclick=\"location.href='".$_SERVER[PHP_SELF]."?_m=".$_m."&_cid=".$_cid."'\">";
|
|
//
|
|
$column=array(
|
|
"序号",
|
|
"名称",
|
|
"是否启用"
|
|
);
|
|
$column_property=array("align=left width=40","align=left","align=left width=70");
|
|
//-----------------------tab
|
|
//-----------------------/tab
|
|
//
|
|
$query="select * from ".$table_pre."keyword ".$sql_con." order by ord";
|
|
//echo $query."<br>";
|
|
$res=$db->query($query);
|
|
$count=0;
|
|
while($msg=$db->fetch_array($res)){
|
|
$list=$count+1;
|
|
$content[$count][]=$list;
|
|
$sty=($msg["flag_ka"]=="n")?"#cccccc":"#000000";
|
|
$content[$count][]="<input type=\"hidden\" name=id[] value=\"".$msg["id"]."\"><span style=\"color:".$sty."\">".$msg["title"]."(".$msg["no"].")</span>";
|
|
$content[$count][]="<select name=\"is_show[]\" class=\"slt_list2\">".get_main_op($arr_yn,$msg["flag_ka"])."</select>";
|
|
$count++;
|
|
}
|
|
if(!$content)
|
|
$content[0]="暂无记录!";
|
|
$_nav_.=" > <a style=\"color:#44CFD4;\" href=\"".$_SERVER[PHP_SELF]."?_m=".$_m."&_cid=".$_cid."&_a=set_select\">规则启用</a>";
|
|
include template("manage_list");
|
|
break;
|
|
//------------------------------------------------------------------------------------/规则设置
|
|
default:
|
|
$tmp=get_db_msg("select count(*) 'total' from ".$table_pre."keyword where cate='dhgz' ");
|
|
$total_num=$tmp["total"];
|
|
|
|
|
|
$query="select * from ".$table_pre."keyword where cate='dhgz' order by ord";
|
|
//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;
|
|
$xh=$count+1;
|
|
$str_tmp.="{";
|
|
$str_tmp.="\"id\":\"".$msg["id"]."\",";
|
|
$str_tmp.="\"xh\":\"".$xh."\",";
|
|
$str_tmp.="\"no\":\"".$msg["no"]."\",";
|
|
$str_tmp.="\"title\":\"".$msg["title"]."\",";
|
|
$str_tmp.="\"flag_ka\":\"".$msg["flag_ka"]."\"";
|
|
$str_tmp.="},";
|
|
$count++;
|
|
}
|
|
|
|
//取得默认的规则
|
|
/*$m1=get_db_msg("select * from ".$table_pre."keyword where (cate='dhgz') and flag_ka='y' order by ord limit 0,1");
|
|
if($m1["id"]>0)
|
|
$default_cate=$m1["no"];
|
|
$s_cate=$s_cate?$s_cate:$default_cate;
|
|
if($s_cate){
|
|
include "gz_".$s_cate.".php";
|
|
}else{
|
|
//
|
|
$column_str="<tr class=\"tabel_list_head\"><td>请先启用规则!</td></tr>";
|
|
//$_nav_.="";
|
|
//-----------------------tab
|
|
$tab_action="<input type=\"button\" value=\"规则启用\" onclick=\"location.href='".$_SERVER[PHP_SELF]."?_m=".$_m."&_cid=".$_cid."&_a1=set_select'\" class=\"btn_black\">";
|
|
//-----------------------/tab
|
|
include template("manage_list");
|
|
}*/
|
|
$json_data.=substr($str_tmp,0,-1)."],";
|
|
break;
|
|
}
|
|
}
|
|
$json_data=substr($json_data,0,-1)."}";
|
|
echo $json_data;
|
|
?>
|