7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
590 lines
16 KiB
PHP
590 lines
16 KiB
PHP
<?php
|
|
function arr_to_str1($arr){
|
|
$r="";
|
|
foreach($arr as $n => $t){
|
|
$r.=$t.",";
|
|
}
|
|
$r=substr($r,0,-1);
|
|
return $r;
|
|
}
|
|
function out_good_pica($pic,$width,$height,$property=''){
|
|
if(is_file($pic))
|
|
$wh=GetImageSize($pic);
|
|
else
|
|
return "<img src='images/blank.gif' border='0' width='".$width."' height='".$height."' ".$property.">";
|
|
$tmp="";
|
|
if($width<$wh[0] || $height<$wh[1]){
|
|
if(($wh[0]/$width)>($wh[1]/$height))
|
|
$tmp=" width='".$width."'";
|
|
else
|
|
$tmp=" height='".$height."'";
|
|
}
|
|
return "<img src='".$pic."'".$tmp." border='0' ".$property.">";
|
|
}
|
|
function out_good_pic_seta($pic,$width,$height){
|
|
$w1=$h1=0;
|
|
if(is_file($pic)){
|
|
$wh=GetImageSize($pic);
|
|
}else{
|
|
$pic1=str_replace("content://com.muchuang.edt/","../",$pic).".jpg";
|
|
if(is_file($pic1))
|
|
$wh=GetImageSize($pic1);
|
|
}
|
|
$tmp="";
|
|
if($width<$wh[0] || $height<$wh[1]){
|
|
if(($wh[0]/$width)>($wh[1]/$height)){
|
|
$w1=$width;
|
|
$h1=round($wh[1]*$width/$wh[0]);
|
|
}else{
|
|
$w1=round($wh[0]*$height/$wh[1]);
|
|
$h1=$height;
|
|
}
|
|
}else{
|
|
$w1=$wh[0];
|
|
$h1=$wh[1];
|
|
}
|
|
$str=$w1."|".$h1;
|
|
return $str;
|
|
}
|
|
function kh_dj_srrstr(){
|
|
global $db,$table_pre;
|
|
$q1="select title,no from ".$table_pre."keyword where cate='kh_dj' order by no";
|
|
$r1=$db->query($q1);
|
|
$str="";
|
|
while($m1=$db->fetch_array($r1)){
|
|
$str.=$m1["no"]."_";
|
|
}
|
|
$str=substr($str,0,-1);
|
|
return $str;
|
|
}
|
|
function get_input_from_t($t,$t1,$v,$flag='1'){
|
|
global $db,$table_pre;
|
|
$r="";
|
|
//
|
|
switch($t){
|
|
case "1":
|
|
//y,n选项
|
|
$arr=array("y"=>"是","n"=>"否");
|
|
if($flag=="1")
|
|
$r=$v;
|
|
else
|
|
$r=get_main_value($arr,$v);
|
|
break;
|
|
case "2":
|
|
//文本值
|
|
if($flag=="1"){
|
|
$w=$t1?$t1:400;
|
|
$r=$v;
|
|
}else{
|
|
$r=$v;
|
|
}
|
|
break;
|
|
case "21":
|
|
//颜色值
|
|
if($flag=="1"){
|
|
$r="<div id='_v_c' name='_v_c' ></div><input type='text' id='_v' name='_v' value='".$v."' style='width:60px;color:".$v.";' maxlength=255>";
|
|
}else{
|
|
//$r=$v."<span style='background-color:".$v.";border:1px solid #cccccc;'> </span>";
|
|
$r=$v;
|
|
}
|
|
break;
|
|
case "3":
|
|
//图片
|
|
$tmp=explode("|",$v);
|
|
|
|
if($v){
|
|
if($tmp[0]=="1"){
|
|
$tmp1=explode(",",$tmp[1]);
|
|
for($i=0;$i<count($tmp1);$i++){
|
|
$img_file.="../attachments/".$tmp1[$i].",";
|
|
}
|
|
$img_file=deel_end($img_file);
|
|
}else{
|
|
$img_file="../attachments/".$tmp[1];
|
|
}
|
|
}
|
|
if(is_file($img_file)){
|
|
$img_src=out_good_pica($img_file,225,300," id='img'");
|
|
$img="<a href='".$img_file."' target='_blank'>".$img_src."</a>";
|
|
}else{
|
|
$img="";
|
|
}
|
|
if($flag=="1"){
|
|
$r="";
|
|
$r=$img_file;
|
|
}else{
|
|
$r="";
|
|
$r=$img_file;
|
|
/*if($v){
|
|
if($tmp[0]=="1"){
|
|
$tmp1=explode(",",$tmp[1]);
|
|
for($i=0;$i<count($tmp1);$i++){
|
|
$tmp2="../attachments/".$tmp[$i];
|
|
$r.=$tmp2.",";
|
|
}
|
|
}
|
|
}else{
|
|
$r=" ";
|
|
}*/
|
|
}
|
|
break;
|
|
case "4":
|
|
//select 选项
|
|
if($flag=="1"){
|
|
$op="";
|
|
$tmp=explode(",",$t1);
|
|
for($i=0;$i<count($tmp);$i++){
|
|
$tmp1=explode("|",$tmp[$i]);
|
|
$op.="<option value='".$tmp1[0]."'";
|
|
if($v==$tmp1[0])
|
|
$op.=" selected";
|
|
$op.=">".$tmp1[1]."</option>";
|
|
}
|
|
$r="<select name='_v' id='_v'><option value=''>--</option>".$op."</select>";
|
|
}else{
|
|
$r="无";
|
|
$tmp=explode(",",$t1);
|
|
for($i=0;$i<count($tmp);$i++){
|
|
$tmp1=explode("|",$tmp[$i]);
|
|
if($v==$tmp1[0])
|
|
$r=$tmp1[1];
|
|
}
|
|
}
|
|
break;
|
|
case "5":
|
|
//checkbox 复选框
|
|
$arr_v=explode(",",$v);
|
|
if($flag=="1"){
|
|
$op="";
|
|
$tmp=explode(",",$t1);
|
|
for($i=0;$i<count($tmp);$i++){
|
|
$tmp1=explode("|",$tmp[$i]);
|
|
$op.="<input type='checkbox' name='_v[]' id='_v[]' id='ck_".$i."' value='".$tmp1[0]."'";
|
|
if(in_array($tmp1[0],$arr_v))
|
|
$op.=" checked";
|
|
$op.="><label for='ck_".$i."'>".$tmp1[1]."</label> ";
|
|
}
|
|
$r=$op;
|
|
}else{
|
|
$r="";
|
|
$tmp=explode(",",$t1);
|
|
for($i=0;$i<count($tmp);$i++){
|
|
$tmp1=explode("|",$tmp[$i]);
|
|
if(in_array($tmp1[0],$arr_v))
|
|
$r.=$tmp1[1].",";
|
|
}
|
|
if($r)
|
|
$r=substr($r,0,-1);
|
|
else
|
|
$r="无";
|
|
}
|
|
break;
|
|
case "6":
|
|
//checkbox 复选框+文本框
|
|
$arr_v=explode(",",$v);
|
|
if($flag=="1"){
|
|
$op="";
|
|
$tmp=explode(",",$t1);
|
|
for($i=0;$i<count($tmp);$i++){
|
|
$tmp1=explode("|",$tmp[$i]);
|
|
$op.="<input type='hidden' name='_v2[]' value='".$tmp1[0]."'><input type='checkbox' name='_v[]' id='ck_".$i."' value='".$tmp1[0]."'";
|
|
if(in_array($tmp1[0],$arr_v))
|
|
$op.=" checked";
|
|
$op.="><input type='text' name='_v1[]' style='width:100px;' value='".$tmp1[1]."'><br>";
|
|
}
|
|
$r=$op;
|
|
}else{
|
|
$r="";
|
|
$tmp=explode(",",$t1);
|
|
for($i=0;$i<count($tmp);$i++){
|
|
$tmp1=explode("|",$tmp[$i]);
|
|
if(in_array($tmp1[0],$arr_v))
|
|
$r.=$tmp1[1].",";
|
|
}
|
|
if($r)
|
|
$r=substr($r,0,-1);
|
|
else
|
|
$r="无";
|
|
}
|
|
break;
|
|
case "7":
|
|
//checkbox 复选框,文本是选项
|
|
$arr_v=explode(",",$v);
|
|
if($flag=="1"){
|
|
$op="";
|
|
$tmp=explode(",",$t1);
|
|
for($i=0;$i<count($tmp);$i++){
|
|
$op.="<input type='checkbox' name='_v[]' id='ck_".$i."' value='".$tmp[$i]."'";
|
|
if(in_array($tmp[$i],$arr_v))
|
|
$op.=" checked";
|
|
$op.="><label for='ck_".$i."'>".get_cate_title_no("arr_select",$tmp[$i])."</label> ";
|
|
}
|
|
$r=$op;
|
|
}else{
|
|
$r="";
|
|
$tmp=explode(",",$t1);
|
|
for($i=0;$i<count($tmp);$i++){
|
|
if(in_array($tmp[$i],$arr_v))
|
|
$r.=get_cate_title_no("arr_select",$tmp[$i]).",";
|
|
}
|
|
if($r)
|
|
$r=substr($r,0,-1);
|
|
else
|
|
$r="无";
|
|
}
|
|
break;
|
|
case "8":
|
|
//款号等级 颜色选项
|
|
$arr_v=explode(",",$v);
|
|
if($flag=="1"){
|
|
//
|
|
$q1="select title,no from ".$table_pre."keyword where cate='kh_dj' order by no";
|
|
$r1=$db->query($q1);
|
|
$r="";
|
|
$i=0;
|
|
while($m1=$db->fetch_array($r1)){
|
|
$tmp=explode("|",$arr_v[$i]);
|
|
//$r.=$m1["no"]."-".$m1["title"].":<div class='pc' id='_v_c_".$m1["no"]."' name='_v_c_".$m1["no"]."' ></div><input type='hidden' name='_v_".$m1["no"]."' id='_v_".$m1["no"]."' value='".$tmp[1]."' ><br>";
|
|
//$r.="<script> $('#_v_".$m1["no"]."').colorpicker({fillcolor:true});</script>\n";
|
|
$r.=$m1["no"]."|".$m1["title"]."|".$tmp[1].",";
|
|
$i++;
|
|
}
|
|
if($r)
|
|
$r=substr($r,0,-1);
|
|
//$r.="<input type='hidden' id='_v' name='_v' >";
|
|
}else{
|
|
$q1="select title,no from ".$table_pre."keyword where cate='kh_dj' order by no";
|
|
$r1=$db->query($q1);
|
|
$r="";
|
|
$i=0;
|
|
while($m1=$db->fetch_array($r1)){
|
|
$tmp=explode("|",$arr_v[$i]);
|
|
//$r.="<span style='color:".$tmp[1].";'>".$m1["title"].",";
|
|
$r.=$tmp[1]."_".$m1["title"]."|";
|
|
$i++;
|
|
}
|
|
if($r)
|
|
$r=substr($r,0,-1);
|
|
}
|
|
break;
|
|
case "9":
|
|
//checkbox 复选框+文字+文本框
|
|
$arr_v1=explode(",",$v);
|
|
$arr_v_check=array();
|
|
$arr_v=array();
|
|
for($i1=0;$i1<count($arr_v1);$i1++){
|
|
$tmp=explode("|",$arr_v1[$i1]);
|
|
$arr_v[]=$tmp[0];
|
|
$arr_v_check[$tmp[0]]=$tmp[1];
|
|
}
|
|
if($flag=="1"){
|
|
$op="";
|
|
$tmp=explode(",",$t1);
|
|
for($i=0;$i<count($tmp);$i++){
|
|
$tmp1=explode("|",$tmp[$i]);
|
|
$op.="<input type='checkbox' name='_v1[]' id='ck_".$i."' value='".$tmp1[0]."'";
|
|
if(in_array($tmp1[0],$arr_v))
|
|
$op.=" checked";
|
|
$op.=">".d_translate($tmp1[0])." <input type='text' name='_v2[]' style='width:100px;' value='".get_main_value_num($arr_v_check,$tmp1[0])."'><br>";
|
|
|
|
$r.=$tmp1[0]."|".d_translate($tmp1[0])."|".get_main_value_num($arr_v_check,$tmp1[0]).",";
|
|
}
|
|
//$r=$op;
|
|
if($r)
|
|
$r=substr($r,0,-1);
|
|
}else{
|
|
$r="";
|
|
$tmp=explode(",",$t1);
|
|
for($i=0;$i<count($tmp);$i++){
|
|
$tmp1=explode("|",$tmp[$i]);
|
|
if(in_array($tmp1[0],$arr_v))
|
|
$r.=d_translate($tmp1[0])."|".get_main_value_num($arr_v_check,$tmp1[0]).",";
|
|
}
|
|
if($r)
|
|
$r=substr($r,0,-1);
|
|
else
|
|
$r="不显示排行";
|
|
}
|
|
break;
|
|
case "10":
|
|
//图片
|
|
if($flag=="1"){
|
|
$op="";
|
|
$tmp=explode(",",$t1);
|
|
for($i=0;$i<count($tmp);$i++){
|
|
$tmp1=explode("|",$tmp[$i]);
|
|
if($v==$tmp1[0]){
|
|
$is_checked=" checked";
|
|
}else{
|
|
$is_checked="";
|
|
}
|
|
$op.="<tr><td".$check_css."><input type='radio' name='_v' id='radio_".$tmp1[0]."' value='".$tmp1[0]."'".$is_checked."><label for='radio_".$tmp1[0]."'>".$tmp1[1]."</label></td><td><a href='images/theme_preview_".$tmp1[0].".jpg' target='_blank'><img src='images/theme_preview_".$tmp1[0].".jpg' width='200' border=0></a></td></tr><tr><td colspan='2'><hr></td></td></tr>";
|
|
$r.=$tmp1[0]."|".$is_checked."|".$tmp1[1].",";
|
|
}
|
|
if($r)
|
|
$r=substr($r,0,-1);
|
|
//$r="<table width='100%' border='0' cellspacing='0' cellpadding='0'>".$op."</table>";
|
|
}else{
|
|
$r="无";
|
|
$tmp=explode(",",$t1);
|
|
for($i=0;$i<count($tmp);$i++){
|
|
$tmp1=explode("|",$tmp[$i]);
|
|
if($v==$tmp1[0])
|
|
$r=$tmp1[1];
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
return $r;
|
|
}
|
|
//-------------------------------参数设置
|
|
header("Content-type: text/html; charset=utf-8");
|
|
if(THIS_IN!="edt_admin")
|
|
exit("错误的访问!");
|
|
//-------------------------------execute action
|
|
$uid=check_cookie();
|
|
$db=_mysql_connect();
|
|
$msg_login_user=get_db_msg("select * from ".$table_pre."user where id='".$uid."'");
|
|
//权限判断
|
|
$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($_a){
|
|
case "add" :
|
|
$msg=get_db_msg("select * from ".$table_pre."set where id='".$id."'");
|
|
$json_data.="\"id\":\"".$id."\",";
|
|
$json_data.="\"sc\":\"".$msg["_k"]."\",";
|
|
$json_data.="\"sm\":\"".$msg["_remark"]."\",";
|
|
$json_data.="\"vl\":\"".get_input_from_t($msg["_t"],$msg["_t1"],$msg["_v"])."\",";
|
|
$json_data.="\"_t\":\"".$msg["_t"]."\",";
|
|
$json_data.="\"_v\":\"".$msg["_v"]."\",";
|
|
$json_data.="\"_k\":\"".$msg["_k"]."\",";
|
|
$json_data.="\"_t1\":\"".$msg["_t1"]."\",";
|
|
$json_data.="\"_remark\":\"".$msg["_remark"]."\",";
|
|
if($msg["_k"]=="sys_login_bg"){
|
|
$arrtmp=out_good_pic_set_arr(get_input_from_t($msg["_t"],$msg["_t1"],$msg["_v"]),600,600);
|
|
$json_data.="\"w\":\"".$arrtmp[0]."\",";
|
|
$json_data.="\"h\":\"".$arrtmp[1]."\",";
|
|
}
|
|
if($msg["_t"]=="8"){
|
|
$json_data.="\"khdj\":\"".kh_dj_srrstr()."\",";
|
|
}
|
|
break;
|
|
case "save_add" :
|
|
$json_data.="\"_v\":\"".$_v."\",";
|
|
$json_data.="\"_t\":\"".$_t."\",";
|
|
//var_dump($_v);
|
|
//exit;
|
|
if($_t=="3"){
|
|
$_v=$_v;
|
|
}else if($_t=="5" || $_t=="7"){
|
|
$_v=arr_to_str1($_v);
|
|
}else if($_t=="6"){
|
|
$_v=arr_to_str1($_v);
|
|
if(is_array($_v2)){
|
|
foreach($_v2 as $n => $t){
|
|
$_t1.=$_v2[$n]."|".$_v1[$n].",";
|
|
}
|
|
}
|
|
/*for($i=0;$i<count($_v2);$i++){
|
|
$_t1.=$_v2[$i]."|".$_v1[$i].",";
|
|
}*/
|
|
if($_t1)
|
|
$_t1=substr($_t1,0,-1);
|
|
}else if($_t=="8"){
|
|
$arr=explode("_",$_v);
|
|
$q1="select title,no from ".$table_pre."keyword where cate='kh_dj' order by no";
|
|
$r1=$db->query($q1);
|
|
$ct=0;
|
|
$_v="";
|
|
while($m1=$db->fetch_array($r1)){
|
|
$tmp="_v_".$m1["no"];
|
|
$_v.=$m1["no"]."|".$$tmp.",";
|
|
|
|
$ct++;
|
|
}
|
|
if($_v)
|
|
$_v=substr($_v,0,-1);
|
|
}else if($_t=="9"){
|
|
$_v="";
|
|
if(is_array($_v1)){
|
|
foreach($_v1 as $n => $t){
|
|
if($_v2[$n]>0)
|
|
$_v.=$_v1[$n]."|".$_v2[$n].",";
|
|
}
|
|
}
|
|
/*for($i=0;$i<count($_v1);$i++){
|
|
if($_v2[$i]>0)
|
|
$_v.=$_v1[$i]."|".$_v2[$i].",";
|
|
}*/
|
|
if($_v)
|
|
$_v=substr($_v,0,-1);
|
|
}
|
|
|
|
if($_t!="3"){
|
|
if($id){
|
|
$up1="";
|
|
if($_t=="6")
|
|
$up1=",_t1='".$_t1."'";
|
|
$query="update ".$table_pre."set set _v='".$_v."'".$up1." where id='".$id."'";
|
|
$json_data.="\"q\":\"".$query."\",";
|
|
$db->query($query);
|
|
$log_action="修改";
|
|
$m1=get_db_msg("select _k,_remark from ".$table_pre."set where id='".$id."'");
|
|
if($is_memcache=="y"){
|
|
//清除memcache中的set变量中的值
|
|
$memcache = new Memcache;
|
|
$memcache->connect($memcache_host,$memcache_port);
|
|
$tmpvname='set_'.$m1["_k"];
|
|
$memcache->delete($tmpvname);
|
|
$memcache->close();
|
|
}
|
|
}
|
|
$lid=$id?$id:$iid;
|
|
$json_data.="\"code\":1,";
|
|
set_log($log_action."参数",$m1["_remark"]."|".$_v);
|
|
|
|
}
|
|
$json_data.="\"code\":1,";
|
|
break;
|
|
case "add_pic":
|
|
$msg=get_db_msg("select * from ".$table_pre."set where id='".$id."'");
|
|
$json_data.="\"id\":\"".$msg["id"]."\",";
|
|
$img_file="";
|
|
$img_file="../attachments/".$src."";
|
|
$json_data.="\"src\":\"".$src."\",";
|
|
if($src!="null" && $src){
|
|
$json_data.="\"_v\":\"".$img_file."\",";
|
|
}else{
|
|
$json_data.="\"_v\":\"\",";
|
|
}
|
|
$json_data.="\"ms\":\"".$ms."\",";
|
|
break;
|
|
case "save_add_pic":
|
|
$up_image=$_FILES["up_file"];
|
|
//var_dump($up_image);
|
|
//$ms=$_GET["ms"];
|
|
$a=arr_to_str($_FILES["up_file"]);
|
|
$err="";
|
|
$json_data.="\"ms\":\"".$ms."\",";
|
|
if($del_pic=="y"){
|
|
$json_data.="\"_v\":\"\",";
|
|
if($ms=="1"){
|
|
$tmp=get_db_msg("select * from ".$table_pre."set where id='".$id."'");
|
|
$str1="|".$_v.",";
|
|
$str2="|".$_v;
|
|
$str3=",".$_v;
|
|
$tmpv=str_replace($str1,"|",$tmp["_v"]);
|
|
$tmpv=str_replace($str2,"|",$tmpv);
|
|
$tmpv=str_replace($str3,"",$tmpv);
|
|
$_v=$tmpv;
|
|
}else{
|
|
$_v="";
|
|
}
|
|
}else{
|
|
if($ms=="1"){
|
|
$support_ext="jpg|jpeg";
|
|
if($up_image["name"]){
|
|
if(!check_file_type($support_ext,get_file_ext($up_image["name"])))
|
|
$err="图片格式错误!(支持".$support_ext.")";
|
|
$path1="../attachments";
|
|
$new_file_name="logo_".date("Y-m-d-H-i-s").".".get_file_ext($up_image["name"]);
|
|
upload_file($up_image["tmp_name"],$path1,$new_file_name);
|
|
$tmp=get_db_msg("select * from ".$table_pre."set where id='".$id."'");
|
|
$tmp1=substr($tmp["_v"],0,2);
|
|
if($src){
|
|
$tmpv=str_replace($src,$new_file_name,$tmp["_v"]);
|
|
$_v=$tmpv;
|
|
}else{
|
|
if($tmp["_v"] && $tmp["_v"]!="undefined" && $tmp1=="1|"){
|
|
$_v=$tmp["_v"].",".$new_file_name;
|
|
}else{
|
|
$_v="1|".$new_file_name;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if($ms=="2"){
|
|
$support_ext="MP4|WebM|Ogg";
|
|
if($up_image["name"]){
|
|
if(!check_file_type($support_ext,get_file_ext($up_image["name"])))
|
|
$err="视频格式错误!(支持".$support_ext.")";
|
|
$path1="../attachments";
|
|
$new_file_name="logo_".date("Y-m-d-H-i-s").".".get_file_ext($up_image["name"]);
|
|
//$json_data.="\"f\":\"".$new_file_name."\",";
|
|
//$json_data.="\"f1\":\"".$up_image["tmp_name"]."\",";
|
|
upload_file($up_image["tmp_name"],$path1,$new_file_name);
|
|
$tmp=get_db_msg("select * from ".$table_pre."set where id='".$id."'");
|
|
$_v="2|".$new_file_name;
|
|
}
|
|
}
|
|
}
|
|
if(!$err){
|
|
if($id){
|
|
$tmp=explode("|",$_v);
|
|
if(!$tmp[1]){
|
|
$_v="";
|
|
}
|
|
$query="update ".$table_pre."set set _v='".$_v."',_t1='1|图片,2|视频' where id='".$id."'";
|
|
$db->query($query);
|
|
$log_action="修改";
|
|
$m1=get_db_msg("select _k,_remark from ".$table_pre."set where id='".$id."'");
|
|
if($is_memcache=="y"){
|
|
//清除memcache中的set变量中的值
|
|
$memcache = new Memcache;
|
|
$memcache->connect($memcache_host,$memcache_port);
|
|
$tmpvname='set_'.$m1["_k"];
|
|
$memcache->delete($tmpvname);
|
|
$memcache->close();
|
|
}
|
|
}
|
|
$lid=$id?$id:$iid;
|
|
set_log($log_action."参数",$m1["_remark"]."|".$_v);
|
|
$json_data.="\"code\":1,";
|
|
}else{
|
|
$json_data.="\"code\":0,\"msg\":\"".$err."\"";
|
|
}
|
|
break;
|
|
default :
|
|
//
|
|
//-----------------------tab
|
|
//-----------------------/tab
|
|
//
|
|
$tmp=get_db_msg("select count(*) 'total' from ".$table_pre."set ");
|
|
$total_num=$tmp["total"];
|
|
|
|
$q="select * from ".$table_pre."set where id<1000 order by id";
|
|
$r=$db->query($q);
|
|
$count=0;
|
|
$str_tmp=$str_tmp1="";
|
|
$json_data.="\"q\":\"".$q."\",";
|
|
$json_data.="\"code\":0,\"msg\":\"\",\"count\":".$total_num.",\"data\":[";
|
|
while($msg=$db->fetch_array($r)){
|
|
if($msg["_k"]!="sys_theme"){
|
|
$str_tmp.="{";
|
|
$str_tmp.="\"id\":\"".$msg["id"]."\",";
|
|
$str_tmp.="\"_k\":\"".$msg["_k"]."\",";
|
|
$str_tmp.="\"_remark\":\"".$msg["_remark"]."\",";
|
|
$str_tmp.="\"vl\":\"".get_input_from_t($msg["_t"],$msg["_t1"],$msg["_v"],"2")."\",";
|
|
$str_tmp.="\"_t\":\"".$msg["_t"]."\",";
|
|
$str_tmp.="\"_t1\":\"".$msg["_t1"]."\",";
|
|
if($msg["_k"]=="loginurl"){
|
|
//$tmp=get_db_msg("select * from ".$table_pre."set where _k='logintitle'");
|
|
$str_u=$msg["_v"];
|
|
$str_tmp.="\"dt\":\"".$str_u."\",";
|
|
}
|
|
|
|
$str_tmp.="\"_v\":\"".$msg["_v"]."\"";
|
|
$str_tmp.="},";
|
|
}
|
|
}
|
|
$json_data.=substr($str_tmp,0,-1)."],";
|
|
break;
|
|
}
|
|
}
|
|
$json_data=substr($json_data,0,-1)."}";
|
|
echo $json_data;
|
|
?>
|