chore: 添加多个图片和资源文件

添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
This commit is contained in:
2025-06-15 13:04:37 +08:00
parent 1e61dc3970
commit 7e47ce238b
13220 changed files with 1377028 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
<?php
if(THIS_IN!="edt_c")
exit("错误的访问!");
$db=_mysql_connect();
header("Content-type: text/html;charset=utf-8");
//
$str="";
if($id){
$msg=get_db_msg("select * from ".$table_pre."kh where id='".$id."'");
$arr=explode(",",$msg["color"]);
for($i=0;$i<count($arr);$i++){
if($c && $c==$arr[$i]){
//如果有颜色
}else{
$str.="<option value=\"".$arr[$i]."\">".$arr[$i]."-".get_cate_title_no("color",$arr[$i])."</option>";
}
}
}
echo $str;
?>
+106
View File
@@ -0,0 +1,106 @@
<?php
if(THIS_IN!="edt_c")
exit("错误的访问!");
$uid=check_cookie();
$db=_mysql_connect();
header("Content-type: text/html;charset=utf-8");
//
$str="";
$str2="";
$tmp=get_db_msg("select * from ".$table_pre."client where id='".$uid."'");
//判断是不是代理
if($tmp["face"]=="3"){
$uid=$dp_id;
}
if($id){
$msg=get_db_msg("select * from ".$table_pre."kh where id='".$id."'");
$ggs=get_db_msg("select count(*) num from ".$table_pre."kh_gg where iid='".$id."'");
$pj=get_db_msg("select * from ".$table_pre."client_pj where khid='".$id."' and cid='".$dp_id."'");
if($pj["race"])
$fs="分数:".$pj["race"];
if($msg["ka"]=="y")
$msg_ka="<br><span style='color:red;font-weight:bold;'>删除款</span>";
else
$msg_ka="";
$str="<span>圆牌号:".$msg["xh"]." 款号:".$msg["no"]." 商品名称:".$msg["title"]." 吊牌价:".$msg["price"]." 评价:".$pj["remark"].$fs.$msg_ka."</span>";
$str.="<table border='0' cellspacing='1' cellpadding='3' bgcolor='#cccccc'><tr><td align=\"left\" bgcolor=\"#f0f0f0\">颜色</td>";
if($ggs["num"]>0){
$str.="<td align=\"left\" bgcolor=\"#f0f0f0\">版型</td>";
}
$arr_size=explode(",",$msg["size"]);
for($i=0;$i<count($arr_size);$i++){
$tmp=get_db_msg("select title from ".$table_pre."size where no='".$arr_size[$i]."' and iid='".$msg["size_group"]."'");
$str_size.="<td align=\"center\" bgcolor=\"#f0f0f0\">".$tmp["title"]."</td>";
}
$str.=$str_size."<td align=\"center\" bgcolor=\"#f0f0f0\">小计</td></tr>";
$arr_color=explode(",",$msg["color"]);
$arr_color_ka=explode(",",$msg["color_ka"]);
$jj=0;
$col=1;
$arr_total_s=array();
$total_s=0;
for($j=0;$j<count($arr_color);$j++){
if(!in_array($arr_color[$j],$arr_color_ka)){
if($ggs["num"]>0){
$col=2;
$r_gg=$db->query("select * from web_kh_gg where iid='".$msg["id"]."' and color='".$arr_color[$j]."'");
$kk=0;
while($m_gg=$db->fetch_array($r_gg)){
$str.="<tr><td align=\"center\" style=\"background-color:#f0f0f0;\">[".$arr_color[$j]."]".get_cate_title_no("color",$arr_color[$j])."</td>";
$order_num=get_db_msg("select * from web_order where uid='".$dp_id."' and iid='".$msg["id"]."' and color='".$arr_color[$j]."' and bx='".$m_gg["gg"]."'");
$str.="<td align=\"center\" style=\"background-color:#f0f0f0;\">".get_gg_title($m_gg["gg"])."</td>";
$num_size=get_db_msg("select * from web_order where uid='".$dp_id."' and bx='".$m_gg["gg"]."' and color='".$arr_color[$j]."'");
$total_h=0;
for($n=0;$n<count($arr_size);$n++){
$next="tx_".($jj+1);
$str.="<td bgcolor=\"#ffffff\"><input onchange=\"this.value=this.value.replace(/\D/g,'0');total_hj(".$n.",'tx_".$jj."',".$j.");\" onfocus=\"save_this_value(this.value);\" id=\"tx_".$jj."\" onkeydown=\"jump('".$next."')\" type=\"text\" name=\"num_".$arr_color[$j]."_".$m_gg["gg"]."_".$arr_size[$n]."\" value=\"".deel_0($order_num["num_".$arr_size[$n]])."\" style=\"width:40px;\" /></td>";
$total_h+=deel_0($order_num["num_".$arr_size[$n]]);
$arr_total_s[$j][$kk][$n]=deel_0($order_num["num_".$arr_size[$n]]);
$jj++;
}
$str.="<td align=\"center\" style=\"background-color:#f0f0f0;\">$total_h</td></tr>";
$total_s+=$total_h;
$kk++;
}
}else{
$str.="<tr><td align=\"center\" style=\"background-color:#f0f0f0;\">[".$arr_color[$j]."]".get_cate_title_no("color",$arr_color[$j])."</td>";
$num_size=get_db_msg("select * from web_order where uid='".$dp_id."' and bx='".$m_gg["gg"]."' and color='".$arr_color[$j]."'");
$total_h=0;
for($n=0;$n<count($arr_size);$n++){
$order_num=get_db_msg("select * from web_order where uid='".$dp_id."' and iid='".$msg["id"]."' and color='".$arr_color[$j]."'");
$str_value=$order_num["num_".$arr_size[$n]];
$next="tx_".($jj+1);
$str.="<td bgcolor=\"#ffffff\"><input onchange=\"this.value=this.value.replace(/\D/g,'0');total_hj(".$n.",'tx_".$jj."',".$j.");\" onfocus=\"save_this_value(this.value);\" id=\"tx_".$jj."\" onkeydown=\"jump('".$next."')\" type=\"text\" name=\"num_".$arr_color[$j]."_".$m_gg["gg"]."_".$arr_size[$n]."\" value=\"".deel_0($str_value)."\" style=\"width:40px;\" /></td>";
$total_h+=deel_0($str_value);
$arr_total_s[$j][$n]=deel_0($str_value);
$jj++;
}
$str.="<td align=\"center\" style=\"background-color:#f0f0f0;\"><label id=\"label_xj_".$j."\">$total_h<label></td></tr>";
$total_s+=$total_h;
}
}
}
$str_td="";
for($n=0;$n<count($arr_size);$n++){
$tt=0;
for($j=0;$j<count($arr_color);$j++){
if($ggs["num"]>0){
$r_gg=$db->query("select * from web_kh_gg where iid='".$msg["id"]."' and color='".$arr_color[$j]."'");
$kk=0;
while($m_gg=$db->fetch_array($r_gg)){
$tt+=$arr_total_s[$j][$kk][$n];
$kk++;
}
}else{
$tt+=$arr_total_s[$j][$n];
}
}
$str_td.="<td align=\"left\" style=\"background-color:#f0f0f0;\"><label id=\"label_".$n."\">".$tt."</label></td>";
}
$str.="<tr><td align=\"center\" colspan=\"$col\" style=\"background-color:#f0f0f0;\">合计</td>".$str_td."<td align=\"center\" style=\"background-color:#f0f0f0;\"><label id=\"label_zj\">".$total_s."</label></td></tr>";
}
echo $str."</table>";
?>
+12
View File
@@ -0,0 +1,12 @@
<?php
if(THIS_IN!="edt_c")
exit("错误的访问!");
$uid=check_cookie();
$db=_mysql_connect();
header("Content-type: text/html;charset=utf-8");
//
$str="";
$tmp=get_db_msg("select * from ".$table_pre."client where username='".$username."'");
$str=$tmp[order_num]."";
echo $str;
?>
+12
View File
@@ -0,0 +1,12 @@
<?php
if(THIS_IN!="edt_c")
exit("错误的访问!");
$uid=check_cookie();
$db=_mysql_connect();
header("Content-type: text/html;charset=utf-8");
//
$str="";
$tmp=get_db_msg("select * from ".$table_pre."client where username='".$username."'");
$str=deel_je_show($tmp["order_money_zk"]);
echo $str;
?>
+48
View File
@@ -0,0 +1,48 @@
<?php
if(THIS_IN!="edt_c")
exit("错误的访问!");
$db=_mysql_connect();
header("Content-type: text/html;charset=utf-8");
//
$str="";
if($id){
$msg=get_db_msg("select * from ".$table_pre."kh where id='".$id."'");
$arr=explode(",",$msg["color"]);
//取得杯型
$arrBx=array();
$r1=$db->query("select * from ".$table_pre."size_bx where no='".$msg["no"]."' order by bx");
$i1=0;
while($m1=$db->fetch_array($r1)){
$arrBx[$i1][]=$m1["bx"];
$arrBx[$i1][]=$m1["size"];
$i1++;
}
$show_bx=($i1>0)?"y":"n";
if(count($arrBx)==0){
$arrBx[0][0]="";
$arrBx[0][1]=$msg["size"];
}
//价格
$str.="吊牌价:".$msg["price"]."元/结算价".$msg["price_zk"]."";
$str.="|^^|";
//颜色,杯型,尺码
$str.="<table border=\"0\" cellpadding=\"4\" cellspacing=\"1\">";
for($i=0;$i<count($arr);$i++){
for($j=0;$j<count($arrBx);$j++){
$str.="<tr><td><input type=\"checkbox\" name=\"color_bx[]\" value=\"".$arr[$i]."_".$arrBx[$j][0]."\">".$arr[$i]."-".get_cate_title_no("color",$arr[$i])."</td>";
if($show_bx=="y")
$str.="<td>".$arrBx[$j][0]."</td>";
$str.="<td>";
//尺码
$arr1=explode(",",$arrBx[$j][1]);
for($k=0;$k<count($arr1);$k++){
$tmp=get_db_msg("select * from ".$table_pre."size where iid='".$msg["size_group"]."' and no='".$arr1[$k]."'");
$str.="<input type=\"checkbox\" name=\"size_".$arr[$i]."_".$arrBx[$j][0]."[]\" value=\"".$arr1[$k]."\">".$tmp["title"]."&nbsp;";
}
$str."</td></tr>";
}
}
$str.="</table>|^^|";
}
echo $str;
?>
+24
View File
@@ -0,0 +1,24 @@
<?php
if(THIS_IN!="edt_c")
exit("错误的访问!");
$uid=check_cookie();
$db=_mysql_connect();
$msg_login_user=get_db_msg("select * from ".$table_pre."user where id='".$uid."'");
$tmp=explode(",",$_v);
$pic=array();
for($i=0;$i<count($tmp);$i++){
$pic[$i]=$tmp[$i];
}
$content="<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\" bgcolor=\"#cccccc\">";
for($i=0;$i<ceil(count($pic)/4);$i++){
$content.="<tr bgcolor=\"#ffffff\">";
for($j=0;$j<4;$j++){
$url="../attachments/dp/mini/".$pic[$i*4+$j];
$url=is_file($url)?out_good_pic($url,150,200,' border=0'):"&nbsp;";
$content.="<td align=\"center\" valign=\"middle\" width=\"25%\"><a href=\"../attachments/dp/big/".$pic[$i*4+$j]."\" target=\"_blank\">".$url."</a></td>";
}
$content.="</tr>";
}
$_title_="图片预览";
include template("blank");
?>
+114
View File
@@ -0,0 +1,114 @@
<?php
if(THIS_IN!="edt_c")
exit("错误的访问!");
$uid=check_cookie();
$db=_mysql_connect();
$msg_login_user=get_db_msg("select * from ".$table_pre."user where id='".$uid."'");
$_title_=$_title_?$_title_:"目录";
$msg_mod=get_db_msg("select * from ".$table_pre."channel where id='".$_cid."'");
$_nav_="首页 > <a href=\"".$_SERVER[PHP_SELF]."?_cid=".$_cid."&_m=".$msg_mod["module"]."&s_gid=".$s_gid."\">".$msg_mod["title"]."</a> > <a href=\"".$_SERVER[PHP_SELF]."?_cid=".$_cid."&_m=".$_m."\">".$_title_."管理</a>";
switch($_a){
case "add" :
if($id){
$msg=get_db_msg("select * from ".$table_pre."path where id='".$id."'");
$_nav_.=" > 修改";
}else{
$_nav_.=" > 新增";
}
$content[]=array("名称","<input type=\"text\" name=\"title\" value=\"".$msg["title"]."\" style=\"width:400px\" maxlength=255>");
//js_code
$js_code="function ok(){
obj=document.form1;
if(obj.title.value==''){
alert('请输入名称!');
obj.title.focus();
return false;
}
return true;
}";
//
$form_property=" onsubmit=\"return ok()\"";
$form_hidden=array("id"=>$id,"_a"=>"save_add","_title_"=>$_title_,"http_pre"=>$_SERVER['HTTP_REFERER']);
include template("manage_add");
break;
case "save_add" :
//验证
$c=get_db_msg("select count(*) 'num' from ".$table_pre."path where title='".$title."' and id<>'".$id."' and module='".$msg_mod["module"]."'");
if($c["num"]>0)
alert_and_back("该目录已经存在,请重新输入一个!");
if($id){
$query="update ".$table_pre."path set title='".$title."' where id='".$id."'";
$db->query($query);
$log_action="修改";
}else{
//ord
$tmp=get_db_msg("select max(ord) 'num' from ".$table_pre."path where module='".$msg_mod["module"]."'");
if($tmp[num]>0)
$ord=$tmp[num]+1;
else
$ord=1;
//
$query="insert ".$table_pre."path (path,deep,ord,title,module) values ('0','1','".$ord."','".$title."','".$msg_mod["module"]."')";
$db->query($query);
$iid=$db->insert_id();
$log_action="新增";
}
$lid=$id?$id:$iid;
set_log($log_action.$msg_mod["title"].$_title_,$title."|".$lid);
url_redirect($http_pre);
break;
case "save_ord":
for($i=0;$i<count($id);$i++){
$q="update ".$table_pre."path set ord='".$ord[$i]."' where id='".$id[$i]."'";
$db->query($q);
}
url_redirect();
break;
case "delete" :
$num=count($id);
if($num==0)
alert_and_back("请至少选择一条记录!");
for($i=0;$i<$num;$i++){
$tmp=get_db_msg("select * from ".$table_pre."path where id='".$id[$i]."'");
$lid.=$tmp["title"]."|".$id[$i].", ";
$db->query("delete from ".$table_pre."path where id='".$id[$i]."'");
}
$lid=substr($lid,0,-2);
set_log("删除".$msg_mod["title"].$_title_,$lid);
url_redirect();
break;
default :
//
$sql_con="where module='".$msg_mod["module"]."'";
$tmp=get_db_msg("select count(*) 'total' from ".$table_pre."path ".$sql_con);
$total=$tmp["total"];
//
$form_hidden=array(
"s_keyword"=>$s_keyword,
"_title_"=>$_title_
);
//
$column=array(
"<input type=checkbox name=toggle onclick=\"checkAll(".$total.")\">名称 <a href='javascript:save_ord(".$total.")'><img src='images/save_order.png' border=0 alt='保存次序'></a>",
"ID"
);
$column_property=array("align=left","align=left width=70");
//
$act="<input type=\"button\" value=\"新增\" onclick=\"dadd()\" class=\"button_act\">";
$act.=" <input type=\"button\" value=\"删除\" onclick=\"ddel(".$total.")\" class=\"button_act\">";
//
$query="select * from ".$table_pre."path ".$sql_con."and deep='1' order by ord";
//echo $query."<br>";
$res=$db->query($query);
$count=0;
while($msg=$db->fetch_array($res)){
$content[$count][]="<input type=checkbox id='cb".$count."' name=id[] value=\"".$msg[id]."\"><input type=text name=ord[] value='".$msg[ord]."' class=text_area style='width:20px'> <a href=\"".$_SERVER[PHP_SELF]."?_m=".$_m."&_cid=".$_cid."&_a=add&id=".$msg[id]."&_title_=".urlencode($_title_)."\">".$msg[title]."</a>";
$content[$count][]=$msg[id];
$count++;
}
if(!$content)
$content[0]="暂无记录!";
include template("manage_list");
break;
}
?>
+133
View File
@@ -0,0 +1,133 @@
<?php
if(THIS_IN!="edt_c")
exit("错误的访问!");
$uid=check_cookie();
$db=_mysql_connect();
$msg_login_user=get_db_msg("select * from ".$table_pre."user where id='".$uid."'");
$_title_=$_title_?$_title_:"目录";
$msg_mod=get_db_msg("select * from ".$table_pre."channel where id='".$_cid."'");
$_nav_="首页 > <a href=\"".$_SERVER[PHP_SELF]."?_cid=".$_cid."&_m=".$msg_mod["module"]."&s_gid=".$s_gid."\">".$msg_mod["title"]."</a> > <a href=\"".$_SERVER[PHP_SELF]."?_cid=".$_cid."&_m=".$_m."\">".$_title_."管理</a>";
switch($_a){
case "add" :
if($id){
$msg=get_db_msg("select * from ".$table_pre."path where id='".$id."'");
$_nav_.=" > 修改";
}else{
$_nav_.=" > 新增";
}
//path_op
$path_op="<option value='0'>-根目录-</option>";
$r=$db->query("select * from ".$table_pre."path where module='".$msg_mod["module"]."' and deep='1' and id<>'".$id."' order by ord");
while($m=$db->fetch_array($r)){
$path_op.="<option value='".$m[path]."-".$m[id]."'";
if($m[path]."-".$m[id]==$msg["path"])
$path_op.=" selected";
$path_op.=">".$m["title"]."</option>";
}
$content[]=array("上级目录","<select name=\"path\">".$path_op."</select>");
$content[]=array("目录名称","<input type=\"text\" name=\"title\" value=\"".$msg["title"]."\" style=\"width:400px\" maxlength=255>");
//js_code
$js_code="function ok(){
obj=document.form1;
if(obj.title.value==''){
alert('请输入名称!');
obj.title.focus();
return false;
}
return true;
}";
//
$form_property=" onsubmit=\"return ok()\"";
$form_hidden=array("id"=>$id,"_a"=>"save_add","_title_"=>$_title_,"http_pre"=>$_SERVER['HTTP_REFERER']);
include template("manage_add");
break;
case "save_add" :
//验证
$c=get_db_msg("select count(*) 'num' from ".$table_pre."path where title='".$title."' and path='".$path."' and id<>'".$id."' and module='".$msg_mod["module"]."'");
if($c["num"]>0)
alert_and_back("该目录已经存在,请重新输入一个!");
$deep=get_deep($path);
if($id){
$query="update ".$table_pre."path set path='".$path."',deep='".$deep."',title='".$title."' where id='".$id."'";
$db->query($query);
$log_action="修改";
}else{
//ord
$tmp=get_db_msg("select max(ord) 'num' from ".$table_pre."path where module='".$msg_mod["module"]."' and path='".$path."'");
if($tmp[num]>0)
$ord=$tmp[num]+1;
else
$ord=1;
//
$query="insert ".$table_pre."path (path,deep,ord,title,module) values ('".$path."','".$deep."','".$ord."','".$title."','".$msg_mod["module"]."')";
$db->query($query);
$iid=$db->insert_id();
$log_action="新增";
}
$lid=$id?$id:$iid;
set_log($log_action.$msg_mod["title"].$_title_,$title."|".$lid);
url_redirect($http_pre);
break;
case "save_ord":
for($i=0;$i<count($id);$i++){
$q="update ".$table_pre."path set ord='".$ord[$i]."' where id='".$id[$i]."'";
$db->query($q);
}
url_redirect();
break;
case "delete" :
$num=count($id);
if($num==0)
alert_and_back("请至少选择一条记录!");
for($i=0;$i<$num;$i++){
$tmp=get_db_msg("select * from ".$table_pre."path where id='".$id[$i]."'");
$lid.=$tmp["title"]."|".$id[$i].", ";
$db->query("delete from ".$table_pre."path where id='".$id[$i]."'");
}
$lid=substr($lid,0,-2);
set_log("删除".$msg_mod["title"].$_title_,$lid);
url_redirect();
break;
default :
//
$sql_con="where module='".$msg_mod["module"]."'";
$tmp=get_db_msg("select count(*) 'total' from ".$table_pre."path ".$sql_con);
$total=$tmp["total"];
//
$form_hidden=array(
"s_keyword"=>$s_keyword,
"_title_"=>$_title_
);
//
$column=array(
"<input type=checkbox name=toggle onclick=\"checkAll(".$total.")\">名称 <a href=\"javascript:save_ord1('save_ord',".$total.")\"><img src='images/save_order.png' border=0 alt='保存次序'></a>",
"ID"
);
$column_property=array("align=left","align=left width=70");
//
$act="<input type=\"button\" value=\"新增\" onclick=\"dadd()\" class=\"button_act\">";
$act.=" <input type=\"button\" value=\"删除\" onclick=\"ddel(".$total.")\" class=\"button_act\">";
//
$query="select * from ".$table_pre."path ".$sql_con."and deep='1' order by ord";
//echo $query."<br>";
$res=$db->query($query);
$count=0;
while($msg=$db->fetch_array($res)){
$content[$count][]="<input type=checkbox id='cb".$count."' name=id[] value=\"".$msg[id]."\"><input type=text name=ord[] value='".$msg[ord]."' class=text_area style='width:20px'> <a href=\"".$_SERVER[PHP_SELF]."?_m=".$_m."&_cid=".$_cid."&_a=add&id=".$msg[id]."&_title_=".urlencode($_title_)."\">".$msg[title]."</a>";
$content[$count][]=$msg[id];
//
$q="select * from ".$table_pre."path ".$sql_con."and path='0-".$msg[id]."' order by ord";
$r=$db->query($q);
$count++;
while($m=$db->fetch_array($r)){
$content[$count][]="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--<input type=checkbox id='cb".$count."' name=id[] value=\"".$m[id]."\"><input type=text name=ord[] value='".$m[ord]."' class=text_area style='width:20px'> <a href=\"".$_SERVER[PHP_SELF]."?_m=".$_m."&_cid=".$_cid."&_a=add&id=".$m[id]."&_title_=".urlencode($_title_)."\">".$m[title]."</a>";
$content[$count][]=$m[id];
$count++;
}
}
if(!$content)
$content[0]="暂无记录!";
include template("manage_list");
break;
}
?>
+64
View File
@@ -0,0 +1,64 @@
<?php
if(THIS_IN!="edt_c")
exit("错误的访问!");
$uid=check_cookie();
$db=_mysql_connect();
$msg_login_user=get_db_msg("select * from ".$table_pre."user where id='".$uid."'");
$msg_channel=get_db_msg("select * from ".$table_pre."channel where id='".$_cid."'");
$_title_=$msg_channel["title"];
switch($cate){
case "color":
$return_var=$return_var?$return_var:"color";
$pick_style=$pick_style?$pick_style:1;
$content="<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"4\" cellspacing=\"1\" bgcolor=\"#cccccc\"><tr><td bgcolor=\"#f0f0f0\"><b>请选择颜色</b>";
if($pick_style==1)
$tontent.=" <a href=\"javascript:dselect();\">全不选</a>";
$content.="</td></tr><tr><form name=\"form1\"><td bgcolor=\"#ffffff\">";
$check=explode(",",$value);
$q="select * from ".$table_pre."keyword where cate='".$cate."'order by no";
$r=$db->query($q);
$i=0;
while($m=$db->fetch_array($r)){
if($pick_style==1){
$content.="<input type=\"checkbox\" name=\"color_".$i."\" id=\"color_".$i."\" value=\"".$m["no"]."-".$m["title"]."\"";
if(in_array($m["no"]."-".$m["title"],$check))
$content.=" checked";
$content.="><label for=\"color_".$i."\">".$m["no"]."-".$m["title"]."</label> ";
}else{
$content.="<input type=\"radio\" name=\"color1\" id=\"color_".$i."\" value=\"".$m["no"]."-".$m["title"]."\"";
if($value==$m["no"]."-".$m["title"])
$content.=" checked";
$content.="><label for=\"color_".$i."\">".$m["no"]."-".$m["title"]."</label> ";
}
$i++;
}
$content.="</td></form></tr><tr><td bgcolor=\"#ffffff\"><input type=\"button\" value=\"选择好了\" onclick=\"pick_ok();\"> <input type=\"button\" value=\"清除\" onclick=\"pick_clear();\"> <input type=\"button\" value=\"关闭本窗口\" onclick=\"window.close();\"></td></tr></table>";
//
$js_code="<script>
function pick_ok(){
var str='';
for(var i=0;i<".$i.";i++){
var obj=document.getElementById('color_'+i);
if(obj.checked==true)
str+=obj.value+',';
}
if(str!='')
str=str.substring(0,str.length-1);
window.opener.form1.".$return_var.".value=str;
window.close();
}
function dselect(){
for(var i=0;i<".$i.";i++){
document.getElementById('color_'+i).checked=false;
}
}
function pick_clear(){
window.opener.form1.".$return_var.".value='';
window.close();
}
</script>";
$_title_="颜色选取";
include template("blank");
break;
}
?>
+57
View File
@@ -0,0 +1,57 @@
<?php
if(THIS_IN!="edt_c")
exit("错误的访问!");
$uid=check_cookie();
$db=_mysql_connect();
$msg_login_user=get_db_msg("select * from ".$table_pre."user where id='".$uid."'");
$msg_channel=get_db_msg("select * from ".$table_pre."channel where id='".$_cid."'");
$_title_=$msg_channel["title"];
//
switch($_a){
case "save":
//
$_v=arr_to_str($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]."'";
//echo $q1."<br>";
$db->query($q1);
}
echo "<script> window.opener.location.reload();window.close(); </script>";
break;
default:
$tmp=get_db_msg("select count(*) 'num' from ".$table_pre."keyword where cate='color'");
$total=$tmp["num"];
//取得已经设置的值
$m1=get_db_msg("select * from ".$table_pre."sx where no='".$no."' limit 0,1");
$arr_check=explode(",",$m1["_v"]);
$t_checked=($total==count($arr_check))?" checked":"";
$content="<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"4\" cellspacing=\"1\" bgcolor=\"#cccccc\"><form name=\"form1\" method=\"post\" action=\"".$_SERVER[PHP_SELF]."\"><input type=\"hidden\" name=\"_m\" value=\"".$_m."\"><input type=\"hidden\" name=\"_a\" value=\"save\"><input type=\"hidden\" name=\"no\" value=\"".$no."\"><tr><td bgcolor=\"#f0f0f0\"><b>请选择颜色</b><input type=\"checkbox\" id=\"toggle_1\" onclick=\"check_all(".$total.",1)\"".$t_checked.">";
$content.="</td></tr><tr><td bgcolor=\"#ffffff\">";
$check=explode(",",$value);
$q="select * from ".$table_pre."keyword where cate='color' order by no";
$r=$db->query($q);
$i=1;
while($m=$db->fetch_array($r)){
$content.="<input type=\"checkbox\" name=\"color[]\" id=\"cb_1_".$i."\" value=\"".$m["no"]."\"";
if(in_array($m["no"],$arr_check))
$content.=" checked";
$content.="><label for=\"color_".$i."\">".$m["no"]."-".$m["title"]."</label> ";
$i++;
}
$content.="</td></tr><tr><td bgcolor=\"#ffffff\"><input type=\"submit\" value=\"保存设置\"> <input type=\"button\" value=\"关闭本窗口\" onclick=\"window.close();\"></td></tr></form></table>";
//
$js_code="";
$_title_="颜色选取";
include template("blank");
break;
}
?>
+28
View File
@@ -0,0 +1,28 @@
<?php
if(THIS_IN!="edt_c")
exit("错误的访问!");
$uid=check_cookie();
$db=_mysql_connect();
$msg_login_user=get_db_msg("select * from ".$table_pre."user where id='".$uid."'");
switch($_t){
case "log":
$_title_="日志明细";
$_width_="60";
if($id)
$msg=get_db_msg("select * from ".$table_pre.$_t." where id='".$id."'");
if(!$msg["id"])
exit("对不起,该信息不存在!");
$tmp=get_db_msg("select * from ".$table_pre."user where id='".$msg["uid"]."'");
$content[]=array("用户名","<a href=\"javascript:o_window('".$_SERVER[PHP_SELF]."?_m=manage/view&_t=user&id=".$msg["uid"]."','user',500,600)\">".$tmp["username"]."</a>");
$content[]=array("IP地址",$msg[ip]);
$content[]=array("访问时间",date("Y/n/j H:i:s",$msg["add_date"]));
$content[]=array("执行动作",$msg["action"]);
$content[]=array("备注",$msg["remark"]);
$content[]=array("SQL","<span style='line-height:150%';>".dhtmlchars($msg[sql_value])."<span>");
include template("manage_view");
break;
default:
exit("错误的访问!");
break;
}
?>
+412
View File
@@ -0,0 +1,412 @@
<?php
//订单管理
if(THIS_IN!="edt_c")
exit("错误的访问!");
require THIS_FILE_ROOT."/include/excel_class.php";
require THIS_FILE_ROOT."/include/excel_fun.php";
$uid=check_cookie();
$db=_mysql_connect();
$msg_login_user=get_db_msg("select * from ".$table_pre."client where id='".$uid."'");
$_title_=$_title_?$_title_:"订单录入";
$_nav_="<a href=\"./\">首页</a> > <a href=\"".$_SERVER[PHP_SELF]."?_m=".$_m."&_cid=".$_cid."\">".$_title_."</a>";
$zk_type=get_set("zk_type");
if($bx_sizegroup_title){
$tmp=get_db_msg("select id from ".$table_pre."keyword where cate='size' and title='".$bx_sizegroup_title."' limit 0,1");
$bx_sizegroup_id=$tmp["id"];
}else{
$bx_sizegroup_id=0;
}
switch($_a){
case "save_add_dd":
if(!$dp_id){
alert_and_back("请选择店铺!");
}
if(!$khid){
alert_and_back("请输入款号!");
}
$dp_info=get_db_msg("select * from web_client where id='".$dp_id."'");
if($dp_info["is_checked"]=="y"){
alert_and_back("操作失败,原因是本用户订单已经确认!");
}
//判断是否存在规格
$is_ggk=is_ggk($khid);
//保存订单
$msg=get_db_msg("select * from ".$table_pre."kh where id='".$khid."'");
if($msg["size_group"]==$bx_sizegroup_id){
//取得杯型
$arrBx=array();
$str_bx="";
$r1=$db->query("select * from ".$table_pre."size_bx where no='".$msg["no"]."' order by bx");
$i1=0;
while($m1=$db->fetch_array($r1)){
$arrBx[$i1][]=$m1["bx"];
$arrBx[$i1][]=$m1["size"];
$str_bx.=$m1["bx"].",";
$i1++;
}
//取得尺码
$str_size="";
$r1=$db->query("select * from ".$table_pre."size where iid='".$bx_sizegroup_id."' order by no");
while($m1=$db->fetch_array($r1)){
$str_size.=$m1["no"].",";
}
$str_size=substr($str_size,0,-1);
$arr_size=explode(",",$str_size);
}else{
if($is_ggk=="y"){
$r1=$db->query("select * from ".$table_pre."kh_gg where iid='".$msg["id"]."' order by color,ord");
$i1=0;
while($m1=$db->fetch_array($r1)){
$arrBx[$i1][]=$m1["gg"];
$str_bx.=$m1["gg"].",";
$i1++;
}
$arr_size=explode(",",$msg["size"]);
}else{
$arrBx[0][0]="";
$arrBx[0][1]=$msg["size"];
$arr_size=explode(",",$arrBx[0][1]);
$str_bx="";
}
}
if($str_bx)
$str_bx=substr($str_bx,0,-1);
//
$arr_color=explode(",",$msg["color"]);
$arr_color_ka=explode(",",$msg["color_ka"]);
$tmp_total_num=0;
$tmp_old=get_db_msg("select sum(".get_size_sql("sum").") 'num' from ".$table_pre."order where uid='".$uid."' and iid='".$id."'");
//取得总量
for($i=0;$i<count($arr_color);$i++){
for($j=0;$j<count($arrBx);$j++){
for($k=0;$k<count($arr_size);$k++){
$v="num_".$arr_color[$i]."_".$arrBx[$j][0]."_".$arr_size[$k];
$tmp_total_num+=$$v;
//echo $v."|".$$v."<br>";
}
}
}
//取得选项
$arr_select_no=array();
$q1="select no from ".$table_pre."keyword where cate='arr_select' and flag_ka='y' and no<>'jgd' and no<>'sx' and no<>'zd1' and no<>'zd2' and no<>'zd3' order by ord";
$r1=$db->query($q1);
while($m1=$db->fetch_array($r1)){
$arr_select_no[]=$m1["no"];
}
for($i=0;$i<count($arr_color);$i++){
$check1=get_db_msg("select * from ".$table_pre."kh_dp where kh='".$msg["no"]."' and color='".$arr_color[$i]."' and gz='1' limit 0,1");
if(!in_array($arr_color[$i],$arr_color_ka) && !$check1["id"]){
for($j=0;$j<count($arrBx);$j++){
$sql_size1=$sql_size2=$sql_size3="";
$c=0;
for($k=0;$k<count($arr_size);$k++){
$v="num_".$arr_color[$i]."_".$arrBx[$j][0]."_".$arr_size[$k];
$c+=$$v;
$sql_size1.="num_".$arr_size[$k]."='".$$v."',";
$sql_size2.=",'".$$v."'";
$sql_size3.=",num_".$arr_size[$k];
}
$check=get_db_msg("select id from ".$table_pre."order where _key='".$_key."' and uid='".$dp_id."' and iid='".$khid."' and color='".$arr_color[$i]."' and bx='".$arrBx[$j][0]."'");
if($check["id"]){
if($c>0){
$q="update ".$table_pre."order set size_group_id='".$msg["size_group"]."',".$sql_size1."add_date='".time()."' where id='".$check["id"]."'";
$db->query($q);
cache_order($dp_id,$khid,$arr_color[$i],$arrBx[$j][0]);
}else{
$q="delete from ".$table_pre."order where id='".$check["id"]."'";
$db->query($q);
}
}else{
if($c>0){
$sql1=$sql2="";
for($i1=0;$i1<count($arr_select_no);$i1++){
$sql1.=$arr_select_no[$i1].",";
$sql2.="'".$msg[$arr_select_no[$i1]]."',";
}
$gg=$arrBx[$j][0];
$gg_color=$arr_color[$i];
$q="insert into ".$table_pre."order (uid,upath,iid,no,".$sql1."jgd,color,bx,is_sp,size_group_id".$sql_size3.",_key,price,sx,add_date) values ('".$dp_id."','".$dp_info["path"]."-".$dp_info["id"]."','".$khid."','".$msg["no"]."',".$sql2."'".get_jgd($msg["price"])."','".$arr_color[$i]."','".$arrBx[$j][0]."','".$msg["is_sp"]."','".$msg["size_group"]."'".$sql_size2.",'".$_key."','".$msg["price"]."','".get_sx($arr_color[$i])."','".time()."')";
$db->query($q);
cache_order($dp_id,$khid,$arr_color[$i],$arrBx[$j][0]);
}
}
}
count_ph($dp_id,$khid,$arr_color[$i]);
}
}
//计算数量变化
//echo $q;
$log_hd_old_num=$tmp_old["num"];
$log_hd_num=$tmp_total_num-$tmp_old["num"];
//
//update_log_hd();
set_order_total($dp_id);
url_redirect("index.php?_m=system/order&_a=add_dd&dp_id=".$dp_id);
break;
case "del":
//删除订单
$msg_client=get_db_msg("select * from ".$table_pre."client where id='".$dpid."'");
if($msg_client["is_checked"]=="y"){
alert_and_back("操作失败,原因是本用户订单已经确认!");
}
$q="delete from ".$table_pre."order where iid='".$khid."' and uid='".$dpid."'";
$db->query($q);
//计算排行
$msg_kh=get_db_msg("select id,color from ".$table_pre."kh where id='".$khid."'");
$arr_color=explode(",",$msg_kh["color"]);
for($i=0;$i<count($arr_color);$i++){
count_ph($dpid,$khid,$arr_color[$i]);
}
set_order_total($dpid);
$url=$_SERVER[PHP_SELF]."?_m=system/order&_a=add_dd&dp_id=".$dpid."&khid=".$khid;
url_redirect($url);
break;
//-------------主界面
default :
$js_start="y";
$add_date=date("Y-m-d H:i:s");
$tmp=get_db_msg("select * from ".$table_pre."client where id='".$uid."'");
//判断是不是代理
if($tmp["face"]!="4"){
$dp_info=get_db_msg("select * from web_client where id='".$dp_id."'");
$dp_name=$dp_info["title"];
$str_path=$tmp["path"]."-".$tmp["id"];
//取得店铺自动完成
$str2="var dp_id=\"".$dp_id."\";";
$str2.="var dps = [\n";
if($tmp["face"]=="2"){
$arr_upath=explode(",",$tmp["charge_path"]);
$i2=0;
for($i=0;$i<count($arr_upath);$i++){
$m2=get_db_msg("select face,id,title,username,available,is_checked from ".$table_pre."client where id='".get_parent_id($arr_upath[$i])."'");
if($m2["face"]=="4" && $m2["available"]=="y" && $m2["is_checked"]!="y"){
$str2.="{id:\"".$m2["id"]."\",title:\"".$m2["title"]."\",username:\"".$m2["username"]."\"},\n";
$i2++;
}
}
}else{
$q2="select id,title,username from ".$table_pre."client where (path='".$str_path."' or path like '".$str_path."-%') and face='4' and available='y' and is_checked<>'y' order by id";
$r2=$db->query($q2);
$i2=0;
while($m2=$db->fetch_array($r2)){
$str2.="{id:\"".$m2["id"]."\",title:\"".$m2["title"]."\",username:\"".$m2["username"]."\"},\n";
$i2++;
}
}
if($i2>0)
$str2=substr($str2,0,-2);
$str2.="];\n";
$js_function=$str2."\n";
$js_function.="$(function() {
$('#dp').autocomplete(dps, {
max: 100, //列表里的条目数
minChars: 0, //自动完成激活之前填入的最小字符
width: 300, //提示的宽度,溢出隐藏
scrollHeight: 300, //提示的高度,溢出显示滚动条
matchContains: true, //包含匹配,就是data参数里的数据,是否只要包含文本框里的数据就显示
autoFill: false, //自动填充
formatItem: function(row, i, max) {
return row.title+'('+row.username+')';
},
formatMatch: function(row, i, max) {
return row.title+row.username;
},
formatResult: function(row) {
return row.id;
}
}).result(function(event, row, formatted) {
document.form1.dp.value=row.title;
document.form1.dp_id.value=row.id;
dp_id=row.id;
ajax_get_color3(row.username);
ajax_get_color4(row.username);
if(document.form1.khid.value !=\"\"){
ajax_get_color2(row.id,document.form1.khid.value);
}
});
});\n";
$js_function.="
function ajax_get_color2(id,khid){
var dp_id=parseInt(document.getElementById('dp_id').value);
if(id>0 && dp_id>0){
//ajax
var obj=document.getElementById(\"tr_td\");
var xmlhttp=ajaxinit();
var url=\"?_m=manage/ajax_kh_color2&id=\"+khid+\"&dp_id=\"+id;
xmlhttp.open(\"POST\",url,true);
xmlhttp.setRequestHeader(\"Cache-Control\",\"no-cache\");
xmlhttp.onreadystatechange=function(){
if(xmlhttp.readyState==4 && xmlhttp.status==200){
//alert(xmlhttp.responseText);
obj.innerHTML=xmlhttp.responseText;
}
}
xmlhttp.send(null);
}else{
if(!dp_id)
alert('请输入店铺!');
return;
}
}
function ajax_get_color3(username){
//ajax
var obj=document.getElementById(\"tr_td2\");
var xmlhttp=ajaxinit();
var url=\"?_m=manage/ajax_kh_color3&username=\"+username;
xmlhttp.open(\"POST\",url,true);
xmlhttp.setRequestHeader(\"Cache-Control\",\"no-cache\");
xmlhttp.onreadystatechange=function(){
if(xmlhttp.readyState==4 && xmlhttp.status==200){
//alert(xmlhttp.responseText);
obj.innerHTML=xmlhttp.responseText;
}
}
xmlhttp.send(null);
}
function ajax_get_color4(username){
//ajax
var obj=document.getElementById(\"tr_td3\");
var xmlhttp=ajaxinit();
var url=\"?_m=manage/ajax_kh_color4&username=\"+username;
xmlhttp.open(\"POST\",url,true);
xmlhttp.setRequestHeader(\"Cache-Control\",\"no-cache\");
xmlhttp.onreadystatechange=function(){
if(xmlhttp.readyState==4 && xmlhttp.status==200){
//alert(xmlhttp.responseText);
obj.innerHTML=xmlhttp.responseText;
}
}
xmlhttp.send(null);
}";
$dp_select="<input type=text name=\"dp\" id=\"dp\" onkeydown=\"jump('kh')\" style=\"width:300px\" onfocus=\"this.select()\" value=\"".$dp_name."\">";
}else{
$dp_info=get_db_msg("select * from web_client where id='".$uid."'");
$dp_name=$dp_info["title"];
$str_face="";
$str="var dp_id=\"".$uid."\";";
$dp_id=$uid;
}
//取得款号自动完成
$str.="var khs = [\n";
$q="select id,no,title,xh from ".$table_pre."kh ".$con." order by no";
$r=$db->query($q);
$i=0;
while($m=$db->fetch_array($r)){
$str.="{id:\"".$m["id"]."\",no:\"".$m["no"]."\",xh:\"".$m["xh"]."\",title:\"".$m["title"]."\"},\n";
$i++;
}
if($i>0)
$str=substr($str,0,-2);
$str.="];\n";
$js_function.=$str."\n";
$js_function.="$(function() {
$('#kh').autocomplete(khs, {
max: 100, //列表里的条目数
minChars: 0, //自动完成激活之前填入的最小字符
width: 200, //提示的宽度,溢出隐藏
scrollHeight: 300, //提示的高度,溢出显示滚动条
matchContains: true, //包含匹配,就是data参数里的数据,是否只要包含文本框里的数据就显示
autoFill: false, //自动填充
formatItem: function(row, i, max) {
return row.no+','+row.title;
},
formatMatch: function(row, i, max) {
return row.no;
},
formatResult: function(row) {
return row.id;
}
}).result(function(event, row, formatted) {
document.form1.khid.value=row.id;
document.form1.kh.value=row.no;
document.form1.xh.value=row.xh;
ajax_get_color(row.id);
});
});\n
$(function() {
$('#xh').autocomplete(khs, {
max: 100, //列表里的条目数
minChars: 0, //自动完成激活之前填入的最小字符
width: 200, //提示的宽度,溢出隐藏
scrollHeight: 300, //提示的高度,溢出显示滚动条
matchContains: true, //包含匹配,就是data参数里的数据,是否只要包含文本框里的数据就显示
autoFill: false, //自动填充
formatItem: function(row, i, max) {
return row.xh+','+row.title;
},
formatMatch: function(row, i, max) {
return row.xh;
},
formatResult: function(row) {
return row.id;
}
}).result(function(event, row, formatted) {
document.form1.khid.value=row.id;
document.form1.xh.value=row.xh;
document.form1.kh.value=row.no;
ajax_get_color(row.id);
});
});\n";
$js_function.="
function ajax_get_color(id){
var dp_id=parseInt(document.getElementById('dp_id').value);
if(id>0 && dp_id>0){
//ajax
var obj=document.getElementById(\"tr_td\");
var xmlhttp=ajaxinit();
var url=\"?_m=manage/ajax_kh_color2&id=\"+id+\"&dp_id=\"+dp_id;
xmlhttp.open(\"POST\",url,true);
xmlhttp.setRequestHeader(\"Cache-Control\",\"no-cache\");
xmlhttp.onreadystatechange=function(){
if(xmlhttp.readyState==4 && xmlhttp.status==200){
//alert(xmlhttp.responseText);
obj.innerHTML=xmlhttp.responseText;
}
}
xmlhttp.send(null);
}else{
if(!dp_id)
alert('请输入店铺!');
return;
}
}";
if($tmp["face"]==4){
$content[]=array("店铺代码",$dp_info["username"]);
$content[]=array("店铺名称",$dp_info["title"]);
$content[]=array("已订件数",$dp_info["order_num"]."");
$content[]=array("已订金额",deel_je_show($dp_info["order_money_zk"]));
}else{
$content[]=array("店铺代码或名称",$dp_select);
$content[]=array("已订件数","<div id=\"tr_td2\">".$dp_info[order_num]."</div>");
$content[]=array("已订金额","<div id=\"tr_td3\">".deel_je_show($dp_info["order_money_zk"])."</div>");
}
$content[]=array("圆牌号/款号","<input type=text name=\"xh\" id=\"xh\" onkeydown=\"jump('tx_0')\" style=\"width:50px\" onfocus=\"this.select()\" value=\"\"> / <input type=text name=\"kh\" id=\"kh\" onkeydown=\"jump('tx_0')\" style=\"width:180px\" onfocus=\"this.select()\" value=\"\"><input type=\"hidden\" value=\"\" name=\"khid\" id=\"khid\"><input type=\"hidden\" value=\"".$dp_id."\" name=\"dp_id\" id=\"dp_id\">");
$content[]=array("数量","<div id=\"tr_td\">请选择款号!</div>");
//js_code
$js_code="function ok(){
obj=document.form1;
return true;
}";
$js_code.="
var this_input_value=0;
function save_this_value(v){
this_input_value=v;
}
function total_hj(a,b,c){
var obj=document.getElementById('label_'+a).innerHTML;
var obj2=document.getElementById(b).value;
var obj3=document.getElementById('label_xj_'+c).innerHTML;
var obj4=document.getElementById('label_zj').innerHTML;
document.getElementById('label_'+a).innerHTML=parseFloat(obj)+parseFloat(obj2)-this_input_value;
document.getElementById('label_xj_'+c).innerHTML=parseFloat(obj2)+parseFloat(obj3)-this_input_value;
document.getElementById('label_zj').innerHTML=parseFloat(obj4)+parseFloat(obj2)-this_input_value;
}";
//
$form_property=" onsubmit=\"return ok()\"";
$form_hidden=array("_a"=>"save_add_dd","http_pre"=>$_SERVER['HTTP_REFERER']);
$_width_="100";
include template("manage_add");
break;
}
?>
+126
View File
@@ -0,0 +1,126 @@
<?php
//p1
if(THIS_IN!="edt_c")
exit("错误的访问!");
$uid=check_cookie();
$db=_mysql_connect();
$msg_login_user=get_db_msg("select * from ".$table_pre."client where id='".$uid."'");
$arr_zb_type=explode(",",$zb_type);
$arr_dp=array();
if($msg_login_user["face"]=="3"){
$q="select id,username,title,path from ".$table_pre."client where path='".$msg_login_user["path"]."-".$msg_login_user["id"]."'";
$r=$db->query($q);
$i=0;
while($m=$db->fetch_array($r)){
$arr_dp[$i]=array($m["id"],$m["username"],$m["path"],$m["title"]);
$i++;
}
}else if($msg_login_user["face"]=="2"){
$arr_upath=explode(",",$msg_login_user["charge_path"]);
$i2=0;
for($i=0;$i<count($arr_upath);$i++){
$m=get_db_msg("select face,id,title,username,path from ".$table_pre."client where id='".get_parent_id($arr_upath[$i])."'");
$arr_dp[$i2]=array($m["id"],$m["username"],$m["path"],$m["title"]);
$i2++;
}
}else{
$arr_dp[0]=array($msg_login_user["id"],$msg_login_user["username"],$msg_login_user["path"],$msg_login_user["title"]);
}
//--------------------------------------------
switch($_a){
case "confirm":
//---------确认客户订单
$m=get_db_msg("select * from ".$table_pre."client where id='".$id."'");
if($m["face"]=="4" && $m["is_checked"]=="y"){
//检查上级代理商是否确认
$dl_uid=get_dl_id($m["path"]);
if($dl_uid>0){
$t1=get_db_msg("select * from ".$table_pre."client where id='".$dl_uid."'");
if($t1["is_checked"]=="y"){
alert_and_back("对不起,该店铺的上级代理已经确认订单!");
}
}
}
if($m["is_checked"]=="y"){
$q="update ".$table_pre."client set is_checked='n' where id='".$id."'";
}else{
$q="update ".$table_pre."client set is_checked='y' where id='".$id."'";
}
$db->query($q);
$url=$rurl;
alert_and_redirect("操作成功!",$url);
break;
default:
$s_key=$s_key?$s_key:$_key;
$s_ka=$s_ka?$s_ka:"n";
$s_order=$s_order?$s_order:"num";
//-----------------------search
$search_content="";
$search_content.="<select name=\"s_is_checked\"><option value=''>-订单是否确认-</option>".get_main_op(array("y"=>"","n"=>""),$s_is_checked)."</select> ";
$_tbody="<tr><td align=\"center\" bgcolor=\"#dddddd\" width=\"40\">序号</td><td align=\"center\" bgcolor=\"#dddddd\">省代</td><td align=\"center\" bgcolor=\"#dddddd\">客户</td>";
$_tbody.="<td align=\"center\" bgcolor=\"#dddddd\">店铺代码</td><td align=\"center\" bgcolor=\"#dddddd\">店铺名称</td><td align=\"center\" bgcolor=\"#dddddd\" width=\"50\">订单数量</td><td align=\"center\" bgcolor=\"#dddddd\" width=\"60\">吊牌金额</td>";
$_tbody.="<td align=\"center\" bgcolor=\"#dddddd\" width=\"60\">指标</td>";
$_tbody.="<td align=\"right\" bgcolor=\"#dddddd\" width=\"50\">完成率</td>";
$_tbody.="<td align=\"right\" bgcolor=\"#dddddd\" width=\"50\">状态</td>";
$_tbody.="</tr>";
//$search_content.="<select name=\"s_order\">".get_main_op(array("num"=>"按数量排序","je"=>"按金额排序"),$s_order)."</select> ";
$search_content.=" <input type=submit value=\"开始分析\" class=\"button_act\"> ";
//-----------------------/search
$total_zb_js=$total_zb_je=0;
$count=0;
for($i=0;$i<count($arr_dp);$i++){
$m1=get_db_msg("select id,path,is_checked,face,order_money,order_num,zb,username,title from ".$table_pre."client where id='".$arr_dp[$i][0]."'");
if($m1["face"]=="4"){
if(!$s_is_checked || ($s_is_checked=="y" && $m1["is_checked"]=="y") || ($s_is_checked=="n" && $m1["is_checked"]!="y")){
//
$list=$count+1;
$m_qy=get_db_msg("select title from ".$table_pre."client where id='".get_qy_id($m1["path"]."-".$m1["id"])."'");
$m_dl=get_db_msg("select title from ".$table_pre."client where id='".get_dl_id($m1["path"]."-".$m1["id"])."'");
$bg=($l%2)?"#f0f0f0":"#ffffff";
//指标
$zb=$zb_style=$wcl="";
$td_zb="";
$ydje=$m1["order_money"];
$zb=$m1["zb"]*10000;
$wcl=deel_bfb1($m1["order_money"],$zb,1);
$total_zb_je+=$zb;
$td_zb.="<td bgcolor=\"".$bg."\" align=\"right\">".deel_td($zb)."</td>";
$ydjs=$m1["order_num"];
$button="";
if($m1["is_checked"]=="y"){
if($m1["face"]=="4")
$button="<br><input type=\"button\" value=\"取消确认\" onclick=\"window.location.href='?_m=".$_m."&_a=confirm&id=".$m1["id"]."&rurl=".urlencode("?_m=".$_m."&s_is_checked=".$s_is_checked)."'\">";
$st="已确认";
}else{
$st="未确认";
if($m1["face"]=="4")
$button="<br><input type=\"button\" value=\"确认订单\" onclick=\"window.location.href='?_m=".$_m."&_a=confirm&id=".$m1["id"]."&rurl=".urlencode("?_m=".$_m."&s_is_checked=".$s_is_checked)."'\">";
}
$_tcontent[$count]="<tr height=\"25\"><td bgcolor=\"".$bg."\" width=\"60\">".$list."</td><td bgcolor=\"".$bg."\" align=\"left\">".deel_td($m_qy["title"])."</td><td bgcolor=\"".$bg."\" align=\"left\">".deel_td($m_dl["title"])."</td>";
$_tcontent[$count].="<td bgcolor=\"".$bg."\" align=\"left\">".$m1["username"]."</td><td bgcolor=\"".$bg."\" align=\"left\">".$m1["title"].$button."</td><td bgcolor=\"".$bg."\" align=\"right\"><a href=\"".$_SERVER["PHP_SELF"]."?_m=system/order_report&_a=detail&s_username=".$m1["username"]."&is_sub=y\">".$ydjs."</a></td><td bgcolor=\"".$bg."\" align=\"right\">".$ydje."</td>";
$_tcontent[$count].=$td_zb;
$_tcontent[$count].="<td bgcolor=\"".$bg."\" align=\"right\">".deel_td(deel_0($wcl))."</td><td bgcolor=\"".$bg."\" align=\"right\">".$st."</td></tr>";
$count++;
$total_num+=$ydjs;
$total_money+=$ydje;
}
}
}
if(!$_tcontent){
//
}else{
$_tcontent[$count]="<tr height=\"25\">";
$hj_colspan=5;
$_tcontent[$count]="<td colspan=\"".$hj_colspan."\" align=\"right\" bgcolor=\"#dddddd\">合计</td><td bgcolor=\"#dddddd\" align=\"right\">".$total_num."</td><td bgcolor=\"#dddddd\" align=\"right\">".$total_money."</td>";
$wcl="";
$_tcontent[$count].="<td bgcolor=\"#dddddd\" align=\"right\">".deel_td(deel_num($total_zb_je))."</td>";
$wcl=deel_bfb1($total_money,$total_zb_je,1);
$_tcontent[$count].="<td bgcolor=\"#dddddd\" align=\"right\">".deel_td(deel_0($wcl))."</td><td bgcolor=\"#dddddd\" align=\"right\">&nbsp;</td>";
$_tcontent[$count].="</tr>";
}
$_title=$_title?$_title:$_title_;
include template("report");
break;
}
?>
+459
View File
@@ -0,0 +1,459 @@
<?php
//--------------------------------------------------导入导出
if(THIS_IN!="edt_c")
exit("错误的访问!");
require THIS_FILE_ROOT."/include/excel_class.php";
require THIS_FILE_ROOT."/include/excel_fun.php";
$uid=check_cookie();
$db=_mysql_connect();
$msg_login_user=get_db_msg("select * from ".$table_pre."client where id='".$uid."'");
$_title_=$_title_?$_title_:"导入导出";
$_nav_="<a href=\"./\">首页</a> > <a href=\"".$_SERVER[PHP_SELF]."?_m=".$_m."&_cid=".$_cid."\">".$_title_."</a>";
$zk_type=get_set("zk_type");
if($bx_sizegroup_title){
$tmp=get_db_msg("select id from ".$table_pre."keyword where cate='size' and title='".$bx_sizegroup_title."' limit 0,1");
$bx_sizegroup_id=$tmp["id"];
}else{
$bx_sizegroup_id=0;
}
$arr_dp=array();
if($msg_login_user["face"]=="3"){
$q="select id,username,title,path from ".$table_pre."client where path='".$msg_login_user["path"]."-".$msg_login_user["id"]."'";
$r=$db->query($q);
$i=0;
while($m=$db->fetch_array($r)){
$arr_dp[$i]=array($m["id"],$m["username"],$m["path"],$m["title"]);
$i++;
}
$con_u_all="(upath like '".$msg_login_user["path"]."-".$msg_login_user["id"]."-%' or upath='".$msg_login_user["path"]."-".$msg_login_user["id"]."') and ";
}else if($msg_login_user["face"]=="2"){
$arr_upath=explode(",",$msg_login_user["charge_path"]);
$i2=0;
for($i=0;$i<count($arr_upath);$i++){
$m=get_db_msg("select face,id,title,username,path from ".$table_pre."client where id='".get_parent_id($arr_upath[$i])."'");
if($m["face"]=="4"){
$arr_dp[$i2]=array($m["id"],$m["username"],$m["path"],$m["title"]);
$i2++;
}
}
$con_u_all=get_qj_u_con_all($msg_login_user["charge_path"]);
}else{
$arr_dp[0]=array($msg_login_user["id"],$msg_login_user["username"],$msg_login_user["path"],$msg_login_user["title"]);
$con_u_all="uid='".$msg_login_user["id"]."' and";
}
switch($_a){
//----------------------------------------------------------------------导入EXCEL
case "import":
$js_function="function check_form(){
var obj=document.form1;
if(obj.file1.value==\"\"){
alert(\"请选择EXCEL文档!\");
obj.file1.focus();
return false;
}
document.getElementById('b_dr').value='处理中...';
document.getElementById('b_dr').disabled=true;
return true;
}";
$form_property=" onsubmit='return check_form();' enctype='multipart/form-data'";
$form_hidden=array("_a"=>"import_check");
$content[]=array("请选择excel文档","<input type=file name=file1 style='width:250px'>");
$content[]=array("是否清空原数据","<input type='radio' id='is_qk_y' name='is_qk' value='y'><label for='is_qk_y'>是</label>
<input type='radio' name='is_qk' id='is_qk_n' value='n'><label for='is_qk_y'>否</label>");
$content[]=array("格式说明","1、只支持2003版本的excel文档,如果提示格式问题,请另存为“Excel 97-2003工作簿”;<br>2、文档格式如下:<a href=\"drmb.xls\"><span style=\"font-size:14px;font-weight:bold;color:#0000ff;\"><模板下载></span></a>");
$_submit_button_="<input type=submit id='b_dr' name='b_dr' value='导 入' class='button1'> ";
$_width_=120;
include template("manage_add");
break;
case "import_check":
if(!$is_qk){
alert_and_back("请选择导入模式:是否清空原数据!");
}
$con_u_all=str_replace("uid","id",substr($con_u_all,0,-4));
$con_u_all=str_replace("upath","path",$con_u_all);
//取得可导入字段
$arr_column_order=array("client"=>"客户代码","no"=>"款号","color"=>"颜色代码");
//$arr_column_order["bx"]="版型";
$file1=$_FILES["file1"];
if($file1["name"]){
if(!check_file_type("xls",get_file_ext($file1["name"])))
alert_and_back("文件格式错误,请参考格式说明!");
}
$tmp_file_name=save_tmp_file($file1);
$tmp_content=get_tmp_content($tmp_file_name);
$arr_content=explode("|-|-|",$tmp_content);
$arr_thead=get_table_thead($tmp_content);
//检测
$str_client=$str_no=$str_color=$str_bx="";
$ind_client=0;
$ind_no=1;
$ind_color=2;
$total_avail=0;
$total_qx=0;
for($i=1;$i<count($arr_content);$i++){
$tmp_arr=explode("|^_^|",$arr_content[$i]);
if(trim($tmp_arr[0])){
$avail="y";
//检测客户代码
$tmp=get_db_msg("select * from ".$table_pre."client where username='".trim($tmp_arr[0])."' and face='4' and available<>'n' and is_checked<>'y' and ".$con_u_all);
if(!$tmp["id"]){
$str_client.=trim($tmp_arr[0]).";";
$avail="n";
}
//检测款号
$tmp_kh=get_db_msg("select id,color,no,color_ka from ".$table_pre."kh where no='".$tmp_arr[1]."'");
if($tmp_kh["id"]>0){
$iid=$tmp_kh["id"];
//款号正确,检测颜色
$tmp1=get_db_msg("select id,no from ".$table_pre."keyword where cate='color' and no='".$tmp_arr[2]."'");
$color=$tmp1["no"];
$arr_check_color=explode(",",$tmp_kh["color"]);
if($tmp1["id"]>0 && in_array($tmp1["no"],$arr_check_color)){
//颜色正确
}else{
$str_color.=$tmp_arr[1]."-".$tmp_arr[2].";";
$avail="n";
}
}else{
$str_no.=$tmp_arr[1].";";
$avail="n";
}
/*
if($avail!="n"){
//检测版型
$arr_right_bx=array();
$q4="select gg from ".$table_pre."kh_gg where iid='".$iid."' and color='".$color."'";
$r4=$db->query($q4);
while($m4=$db->fetch_array($r4)){
$arr_right_bx[]=$m4["gg"];
}
if(trim($tmp_arr[3])){
if(in_array(get_gg_id(trim($tmp_arr[3])),$arr_right_bx)){
//正确
}else{
$avail="n";
$str_bx.=$tmp["no"].",".$color.",".trim($tmp_arr[3]).";";
}
}else{
if(count($arr_right_bx)>0){
$avail="n";
$str_bx.=$tmp["no"].",".$color.",".trim($tmp_arr[3]).";";
}
}
}
*/
//是否取消
$arr1=explode(",",$tmp_kh["color_ka"]);
$is_ka=(in_array($tmp_arr[2],$arr1))?"y":"n";
$size_start=3;
if($avail=="y"){
$tmp1=get_db_msg("select color_ka from ".$table_pre."kh where no='".$tmp_arr[1]."'");
for($j=$size_start;$j<count($tmp_arr);$j++){
if($is_ka=="y"){
$total_qx+=$tmp_arr[$j];
}
$total_avail+=$tmp_arr[$j];
}
}
}
}
$str_check="";
if($str_client)
$str_check.="客户代码有误,请检查:".substr($str_client,0,-1)."<br>";
if($str_no)
$str_check.="款号有误,请检查:".substr($str_no,0,-1)."<br>";
if($str_color)
$str_check.="颜色有误,请检查:".substr($str_color,0,-1)."<br>";
if($str_bx)
$str_check.="版型有误,请检查:".substr($str_bx,0,-1)."<br>";
if(!$str_check){
$str_check="无误";
$avail="y";
}else{
$avail="n";
}
$content[]=array("字段检测结果","<p style=\"line-height:150%;\">".$str_check."</p>");
$total=count($arr_content)-1;
if($total_qx>0)
$str_qx="<span style='color:#ff0000;font-weight:bold;'>取消".$total_qx."件</span>";
else
$str_qx="";
$content[]=array("本次订单量","有效".($total_avail-$total_qx)."".$str_qx);
$dis_dr=($avail=="y")?"":" disabled";
$_submit_button_="<input type=submit id='b_dr' name='b_dr' value='导 入' class='button1'".$dis_dr."> <input type=button value='返 回' class='button1' onclick='history.back();'>";
$js_function="function check_form(){
var obj=document.form1;
document.getElementById('b_dr').value='处理中...';
document.getElementById('b_dr').disabled=true;
return true;
}";
$form_property=" onsubmit='return check_form();'";
$form_hidden=array("_a"=>"import_do","is_qk"=>$is_qk,"tmp_file_name"=>$tmp_file_name);
$_width_=100;
include template("manage_add");
break;
case "import_do":
$tmp_content=get_tmp_content($tmp_file_name);
$arr_content=explode("|-|-|",$tmp_content);
$total_avail=0;
if($is_qk=="y"){
$arr_client=array();
for($i=1;$i<count($arr_content);$i++){
$tmp_arr=explode("|^_^|",$arr_content[$i]);
//检测客户代码
$tmp=get_db_msg("select * from ".$table_pre."client where username='".trim($tmp_arr[0])."' and face='4' and available<>'n'");
if($tmp["id"]>0){
if(!in_array($tmp["id"],$arr_client))
$arr_client[]=$tmp["id"];
}
}
for($i=0;$i<count($arr_client);$i++){
$q="delete from ".$table_pre."order where uid='".$arr_client[$i]."'";
//echo $q."<br>";
$db->query($q);
}
}
for($i=1;$i<count($arr_content);$i++){
$tmp_arr=explode("|^_^|",$arr_content[$i]);
//检测客户代码
$tmp=get_db_msg("select * from ".$table_pre."client where username='".trim($tmp_arr[0])."' and face='4' and available<>'n'");
$uid1=$tmp["id"];
//取得款号
$tmp=get_db_msg("select id,color,no,size from ".$table_pre."kh where no='".$tmp_arr[1]."'");
$iid=$tmp["id"];
//取得颜色
$tmp1=get_db_msg("select id,no from ".$table_pre."keyword where cate='color' and no='".$tmp_arr[2]."'");
$color=$tmp1["no"];
/*
//取得版型
$arr_right_bx=array();
$q4="select gg from ".$table_pre."kh_gg where iid='".$iid."' and color='".$color."'";
$r4=$db->query($q4);
while($m4=$db->fetch_array($r4)){
$arr_right_bx[]=$m4["gg"];
}
if(trim($tmp_arr[3])){
$bx=get_gg_id(trim($tmp_arr[3]));
}else{
if(count($arr_right_bx)>0){
$bx=get_gg_id("-");
}else{
$bx="";
}
}
*/
$avail="y";
$size_start=3;
if($avail=="y"){
for($s1=1;$s1<=$sys_size_num;$s1++){
$v1="num_".$s1;
$ind=$s1+$size_start-1;
$$v1=$tmp_arr[$ind];
$total_avail+=$tmp_arr[$ind];
}
//导入数据
if(get_size_sql("count_total")>0){
$msg_to=get_db_msg("select * from ".$table_pre."client where id='".$uid1."'");
$m=get_db_msg("select * from ".$table_pre."kh where id='".$iid."'");
$c=get_db_msg("select * from ".$table_pre."order where iid='".$iid."' and color='".$color."' and bx='".$bx."' and uid='".$uid1."'");
$arr_size=explode(",",$m["size"]);
if($c["id"]>0){
$sql1="";
for($s1=0;$s1<count($arr_size);$s1++){
$v1="num_".$arr_size[$s1];
$$v1+=$c[$v1];
$sql1.="num_".$arr_size[$s1]."='".$$v1."',";
}
$q1="update ".$table_pre."order set ".$sql1."add_date='".time()."' where id='".$c["id"]."'";
cache_order($uid1,$iid,$color,$bx);
}else{
//判断是否是删除款
$ka="n";
if($m["ka"]=="y"){
$ka="y";
}else{
$tmp=explode(",",$m["color_ka"]);
if(in_array($color,$tmp))
$ka="y";
}
$sql_size1=$sql_size2="";
for($s1=0;$s1<count($arr_size);$s1++){
$v1="num_".$arr_size[$s1];
$sql_size1.="num_".$arr_size[$s1].",";
$sql_size2.="'".$$v1."',";
}
$q1="insert into ".$table_pre."order (uid,upath,iid,kh_dj,no,season,gender,sxz,brand,category,category1,bc,series,theme,designer,price,price_zk,jgd,color,bx,ka,size_group_id,".$sql_size1."_key,add_date) values ('".$uid1."','".$msg_to["path"]."-".$msg_to["id"]."','".$m["id"]."','".$m["kh_dj"]."','".$m["no"]."','".$m["season"]."','".$m["gender"]."','".$m["sxz"]."','".$m["brand"]."','".$m["category"]."','".$m["category1"]."','".$m["bc"]."','".$m["series"]."','".$m["theme"]."','".$m["designer"]."','".$m["price"]."','".$m["price_zk"]."','".$m["jgd"]."','".$color."','".$bx."','".$ka."','".$m["size_group"]."',".$sql_size2."'".$_key."','".time()."')";
}
//echo $q1."<br>";
$db->query($q1);
cache_order($uid1,$m["id"],$color,$bx);
}
set_order_total($uid1);
}
}
//
del_tmp_file($tmp_file_name);
$log_remark=$msg_to["username"].",".$total_avail."";
set_log("导入订单",$log_remark);
echo "<script>
alert(\"数据导入成功!\");
window.location.href=\"".$_SERVER[PHP_SELF]."?_m=".$_m."\";
</script>";
break;
//----------------------------------------------------------------------/导入EXCEL
case "export_do":
if($dpid){
$tmp=get_db_msg("select id,path,face from ".$table_pre."client where id='".$dpid."'");
if($tmp["face"]=="4")
$con_u=" uid='".$tmp["id"]."' and ";
else
$con_u="(upath='".$tmp["path"]."-".$tmp["id"]."' or upath like '".$tmp["path"]."-".$tmp["id"]."-%') and ";
}else{
$con_u=$con_u_all;
}
if($s_ka=="y"){
$sql_con=" where ".$con_u." ka='y'";
}else{
$sql_con=" where ".$con_u." ka<>'y'";
}
$tmp=get_db_msg("select count(distinct uid) 'num' from ".$table_pre."order".$sql_con);
$total_num=$tmp["num"];
if($total_num>0){
$list=$list?$list:0;
$file_name=$file_name?$file_name:"details_".date("y-m-d-h-i-s")."_".get_rand(4).".xls";
$m_uid=get_db_msg("select uid from ".$table_pre."order".$sql_con." group by uid order by uid limit ".$list.",1");
if($list==0){
$content=get_execl_html_body()."<table x:str border=0 cellpadding=0 cellspacing=0 style='border-collapse:collapse;table-layout:fixed;'>";
//取得合并尺码
$arr_size_merged=get_size_merged();
$num_size_total=count($arr_size_merged);
//取得尺码表头内容
$num_size_group=0;
$size_tr=array();
$r1=$db->query("select * from ".$table_pre."keyword where cate='size' order by ord");
while($m1=$db->fetch_array($r1)){
$size_tr[$num_size_group]="";
for($i=1;$i<=$num_size_total;$i++){
$tmp=get_db_msg("select title from ".$table_pre."size where iid='".$m1["id"]."' and no='".$i."'");
$t=$tmp["title"]?$tmp["title"]:"&nbsp;";
$size_tr[$num_size_group].="<td>".$t."</td>";
}
$num_size_group++;
}
//-------------------/处理尺码表头结束
$content.="<tr><td rowspan=\"".$num_size_group."\">省代</td><td rowspan=\"".$num_size_group."\">客户</td><td rowspan=\"".$num_size_group."\">店铺名称</td><td rowspan=\"".$num_size_group."\">店铺代码</td><td rowspan=\"".$num_size_group."\">圆牌号</td><td rowspan=\"".$num_size_group."\">款号</td>";
//取得定制选项
$q="select * from ".$table_pre."keyword where cate='arr_select' and flag_ka='y' and no<>'jgd' and no<>'sx' and no<>'season' and no<>'zd1' and no<>'zd2' and no<>'zd3' and no<>'zd4' and no<>'gender' order by ord";
$r=$db->query($q);
$num_dz=0;
while($m=$db->fetch_array($r)){
$content.="<td rowspan=\"".$num_size_group."\">".get_cate_title_no("arr_select",$m["no"])."</td>";
$num_dz++;
}
$content.="<td rowspan=\"".$num_size_group."\">我的星级</td><td rowspan=\"".$num_size_group."\">我的评价</td><td rowspan=\"".$num_size_group."\">吊牌价</td><td rowspan=\"".$num_size_group."\">颜色</td><td rowspan=\"".$num_size_group."\">颜色代码</td>";
//$content.="<td rowspan=\"".$num_size_group."\">版型</td>";
$content.=$size_tr[0]."<td rowspan=\"".$num_size_group."\">小计</td><td rowspan=\"".$num_size_group."\">吊牌金额</td>";
$content.="</tr>";
for($i=1;$i<$num_size_group;$i++){
$content.="<tr>".$size_tr[$i]."</tr>";
}
}else{
$content="";
}
if($list<$total_num){
$content.=get_order_by_uid($m_uid["uid"],$s_ka);
file_put_contents("xls/".$file_name,$content,FILE_APPEND);
echo "<br>".$list."/".$total_num."家店铺导出完成!<Br>";
$list++;
$url=$_SERVER["PHP_SELF"]."?_m=".$_m."&_a=export_do&list=".$list."&file_name=".$file_name."&dpid=".$dpid."&s_ka=".$s_ka;
url_redirect($url);
}else{
if($m_uid["uid"]>0)
$content.=get_order_by_uid($m["uid"],$s_ka);
$content.="</table></body></html>";
file_put_contents("xls/".$file_name,$content,FILE_APPEND);
echo $total_num."家店铺导出完成,<a href=\"xls/".$file_name."\">下载</a> <a href=\"".$_SERVER["PHP_SELF"]."?_m=".$_m."\">返回</a>";
}
}else{
echo "没有数据,<a href=\"".$_SERVER["PHP_SELF"]."?_m=".$_m."\">返回</a>";
}
break;
default:
$add_date=date("Y-m-d H:i:s");
//判断是不是代理
if($msg_login_user["face"]!="4"){
if($dp_id){
$dp_info=get_db_msg("select * from web_client where id='".$dp_id."'");
$dp_name=$dp_info["title"];
}
//取得店铺框
$str="var clients = [\n";
for($i=0;$i<count($arr_dp);$i++){
$str.="{id:\"".$arr_dp[$i][0]."\",t:\"".$arr_dp[$i][3]."\",u:\"".$arr_dp[$i][1]."\",p:\"".$arr_dp[$i][2]."-".$arr_dp[$i][0]."\"},\n";
}
if($i>0)
$str=substr($str,0,-2);
$str.="];\n";
$js_function.=$str."\n$(function() {
$('#dp').autocomplete(clients, {
max: 100, //列表里的条目数
minChars: 0, //自动完成激活之前填入的最小字符
width: 300, //提示的宽度,溢出隐藏
scrollHeight: 300, //提示的高度,溢出显示滚动条
matchContains: true, //包含匹配,就是data参数里的数据,是否只要包含文本框里的数据就显示
autoFill: false, //自动填充
formatItem: function(row, i, max) {
return row.t+'('+row.u+')';
},
formatMatch: function(row, i, max) {
return row.t+row.u;
},
formatResult: function(row) {
return row.id;
}
}).result(function(event, row, formatted) {
document.form1.dp.value=row.t;
document.form1.dp_id.value=row.id;
dp_id=row.id;
});
});\n";
$dp_select="<input type=text name=\"dp\" id=\"dp\" style=\"width:300px\" onfocus=\"this.select()\" value=\"".$dp_name."\"><input type=hidden name=\"dp_id\" id=\"dp_id\" value=\"".$dp_id."\">";
}else{
$dp_info=get_db_msg("select * from web_client where id='".$uid."'");
$dp_name=$dp_info["title"];
$dp_id=$uid;
}
if($msg_login_user["face"]==4){
$content[]=array("店铺代码",$dp_info["username"]);
$content[]=array("店铺名称",$dp_info["title"]."<input type=hidden name=\"dp_id\" id=\"dp_id\" value=\"".$dp_id."\">");
}else{
$content[]=array("店铺代码或名称",$dp_select);
}
$content[]=array("取消款","<select name='s_ka' id='s_ka'>".get_main_op(array("n"=>"不含取消款","y"=>"取消款"),"")."</select>");
//js_code
$js_code="
function order_export(){
var dpid=document.getElementById('dp_id').value;
var ka_obj=document.getElementById('s_ka');
var s_ka=ka_obj.options[ka_obj.selectedIndex].value
var url='?_m=".$_m."&_a=export_do&dpid='+dpid+'&s_ka='+s_ka;
window.location.href=url;
document.getElementById('b_dc').value='处理中...';
document.getElementById('b_dc').disabled=true;
return true;
}
function order_import(){
var url='?_m=".$_m."&_a=import';
window.location.href=url;
}";
//
$form_property=" onsubmit=\"return ok()\"";
$form_hidden=array("_a"=>"export_do","http_pre"=>$_SERVER['HTTP_REFERER']);
$_width_="100";
$js_start="n";
$_submit_button_="<input id=\"b_dc\" name=\"b_dc\" type=\"button\" value=\"订单导出\" onclick=\"order_export();\"> <input type=\"button\" value=\"订单导入\" onclick=\"order_import();\">";
include template("manage_add");
break;
}
?>
+148
View File
@@ -0,0 +1,148 @@
<?php
//--------------------------------------------------------------------------------订单打印
//p1
if(THIS_IN!="edt_c")
exit("错误的访问!");
$uid=check_cookie();
$db=_mysql_connect();
$msg_login_user=get_db_msg("select * from ".$table_pre."client where id='".$uid."'");
$arr_dp=array();
if($msg_login_user["face"]=="3"){
$q="select id,username,title,path from ".$table_pre."client where path='".$msg_login_user["path"]."-".$msg_login_user["id"]."'";
$r=$db->query($q);
$i=0;
while($m=$db->fetch_array($r)){
$arr_dp[$i]=array($m["id"],$m["username"],$m["path"],$m["title"]);
$i++;
}
$con_u_all="(upath like '".$msg_login_user["path"]."-".$msg_login_user["id"]."-%' or upath='".$msg_login_user["path"]."-".$msg_login_user["id"]."') and ";
}else if($msg_login_user["face"]=="2"){
$arr_upath=explode(",",$msg_login_user["charge_path"]);
$i2=0;
for($i=0;$i<count($arr_upath);$i++){
$m=get_db_msg("select face,id,title,username,path from ".$table_pre."client where id='".get_parent_id($arr_upath[$i])."'");
if($m["face"]=="4"){
$arr_dp[$i2]=array($m["id"],$m["username"],$m["path"],$m["title"]);
$i2++;
}
}
$con_u_all=get_qj_u_con_all($msg_login_user["charge_path"]);
}else{
$arr_dp[0]=array($msg_login_user["id"],$msg_login_user["username"],$msg_login_user["path"],$msg_login_user["title"]);
$con_u_all="uid='".$msg_login_user["id"]."' and";
}
//
$_title_="订单打印";
$_nav_="<a href=\"".$_SERVER[PHP_SELF]."\">首页</a> > <a href=\"".$_SERVER[PHP_SELF]."?_m=".$_m."&_cid=".$_cid."\">".$_title_."</a>";
$arr_report=array("detail"=>"明细","confirm"=>"汇总");
//--------------------------------------------
$_a=$_a?$_a:"detail";
$zk_type=get_set("zk_type");
$file_root1=THIS_FILE_ROOT;
switch($_a){
case "confirm":
require $file_root1."/tmpl/order_print_confirm.php";
break;
case "detail":
require $file_root1."/tmpl/order_print_detail.php";
break;
case "export":
require $file_root1."/tmpl/order_print_export.php";
break;
//----------------------------------------------------------------------设置折扣
case "set_zk" :
//设置折扣
$add_date=date("Y-m-d H:i:s");
if($id){
$msg=get_db_msg("select * from ".$table_pre."client where id='".$id."'");
$path=$msg["path"];
$_nav_="设置折扣";
}
$content[]=array("客户","<b>".$msg["title"]."(".$msg["username"].")</b>");
if($zk_type=="y1"){
$zk_value=$msg["zk"];
$zk_value=$zk_value>0?$zk_value:"100";
$zb="<input type=\"text\" name=\"zk\" id=\"zk\" style=\"width:30px\" value=\"".$zk_value."\">%";
}else if($zk_type=="y2"){
//取得指标格式
$zkxf="category";
switch($zkxf){
case "category":
$zb="<table border=\"0\" cellspacing=\"1\" cellpadding=\"3\" align=\"left\" bgcolor=\"#cccccc\"><tr><td bgcolor=\"#f0f0f0\">大类</td><td bgcolor=\"#f0f0f0\">折扣</td><td bgcolor=\"#f0f0f0\">折后金额</td></tr>";
//大类
$q="select * from ".$table_pre."keyword where cate='".$zkxf."' order by no";
$r=$db->query($q);
$num_total=0;
$i=1;
$total_money=0;
while($m=$db->fetch_array($r)){
$zk_value=get_zk($id,$m["no"]);
$zk_value=$zk_value>0?$zk_value:"100";
$tmp=get_db_msg("select sum((".get_size_sql("sum").")*price) 'money' from ".$table_pre."order where uid='".$id."' and category='".$m["no"]."' and ka<>'y'");
$zhje=$tmp["money"]*$zk_value/100;
$total_money+=$zhje;
$zb.="<tr><td bgcolor=\"#ffffff\">".$m["no"]."-".$m["title"]."<input type=\"hidden\" name=\"zkno[]\" value=\"".$m["no"]."\"></td><td bgcolor=\"#ffffff\"><input type=\"text\" name=\"num_".$m["no"]."\" id='num_".$i."' style=\"width:30px\" value=\"".$zk_value."\"></td><td bgcolor=\"#ffffff\" align=\"right\">".keep_float($zhje,2)."</td></tr>";
$i++;
}
$zb.="<tr><td bgcolor=\"#ffffff\" align=\"right\" colspan=\"2\">合计</td><td bgcolor=\"#ffffff\" align=\"right\">".keep_float($total_money,2)."</td></tr>";
break;
}
$zb.="</table>";
}
$content[]=array("折扣",$zb);
//js_code
$js_code.="function ok(){
obj=document.form1;
return true;
}";
//
$form_property=" onsubmit=\"return ok()\"";
$form_hidden=array("id"=>$id,"_a"=>"save_set_zk");
$_submit_button_="<input type=\"submit\" name=\"s1\" value=\"保存设置\"> <input type=\"button\" name=\"b1\" value=\"关闭窗口\" onclick=\"window.close();\">";
$_width_="40";
include template("win_add");
exit;
break;
case "save_set_zk":
$msg_client=get_db_msg("select * from ".$table_pre."client where id='".$id."'");
if($zk_type=="y1"){
$db->query("update ".$table_pre."client set zk='".$zk."' where id='".$id."'");
}else if($zk_type=="y2"){
$cid=$id;
$zkxf="category";
switch($zkxf){
case "category":
for($i=0;$i<count($zkno);$i++){
$var_num="num_".$zkno[$i];
update_zk($cid,$zkno[$i],$$var_num);
}
break;
}
}
set_order_total($cid);
echo "<script>
window.opener.location.reload();
window.location.href='?_m=".$_m."&_cid=".$_cid."&_a=set_zk&id=".$id."';
alert('设置成功!');
//window.close();
</script>";
break;
default:
//
break;
}
//-----------------------tab
$tab_content=array();
$i=0;
foreach($arr_report as $k => $v){
if($k==$_a)
$tab_content[$i][0]="_1";
else
$tab_content[$i][0]="";
$tab_content[$i][1]="<a href=\"".$_SERVER[PHP_SELF]."?_cid=".$_cid."&_m=".$_m."&_a=".$k."&s_username=".$s_username."&sub=".$sub."\">".$v."</a>";
$i++;
}
//-----------------------/tab
$_tmpl=$_tmpl?$_tmpl:"report";
include template($_tmpl);
?>
+148
View File
@@ -0,0 +1,148 @@
<?php
//--------------------------------------------------------------------------------订单打印
//p1
if(THIS_IN!="edt_c")
exit("错误的访问!");
$uid=check_cookie();
$db=_mysql_connect();
$msg_login_user=get_db_msg("select * from ".$table_pre."client where id='".$uid."'");
$arr_dp=array();
if($msg_login_user["face"]=="3"){
$q="select id,username,title,path from ".$table_pre."client where path='".$msg_login_user["path"]."-".$msg_login_user["id"]."'";
$r=$db->query($q);
$i=0;
while($m=$db->fetch_array($r)){
$arr_dp[$i]=array($m["id"],$m["username"],$m["path"],$m["title"]);
$i++;
}
$con_u_all="(upath like '".$msg_login_user["path"]."-".$msg_login_user["id"]."-%' or upath='".$msg_login_user["path"]."-".$msg_login_user["id"]."') and ";
}else if($msg_login_user["face"]=="2"){
$arr_upath=explode(",",$msg_login_user["charge_path"]);
$i2=0;
for($i=0;$i<count($arr_upath);$i++){
$m=get_db_msg("select face,id,title,username,path from ".$table_pre."client where id='".get_parent_id($arr_upath[$i])."'");
if($m["face"]=="4"){
$arr_dp[$i2]=array($m["id"],$m["username"],$m["path"],$m["title"]);
$i2++;
}
}
$con_u_all=get_qj_u_con_all($msg_login_user["charge_path"]);
}else{
$arr_dp[0]=array($msg_login_user["id"],$msg_login_user["username"],$msg_login_user["path"],$msg_login_user["title"]);
$con_u_all="uid='".$msg_login_user["id"]."' and";
}
//
$_title_="订单打印";
$_nav_="<a href=\"".$_SERVER[PHP_SELF]."\">首页</a> > <a href=\"".$_SERVER[PHP_SELF]."?_m=".$_m."&_cid=".$_cid."\">".$_title_."</a>";
$arr_report=array("detail"=>"明细","confirm"=>"汇总");
//--------------------------------------------
$_a=$_a?$_a:"detail";
$zk_type=get_set("zk_type");
$file_root1=THIS_FILE_ROOT;
switch($_a){
case "confirm":
require $file_root1."/tmpl/order_print_confirm.php";
break;
case "detail":
require $file_root1."/tmpl/order_print_detail1.php";
break;
case "export":
require $file_root1."/tmpl/order_print_export.php";
break;
//----------------------------------------------------------------------设置折扣
case "set_zk" :
//设置折扣
$add_date=date("Y-m-d H:i:s");
if($id){
$msg=get_db_msg("select * from ".$table_pre."client where id='".$id."'");
$path=$msg["path"];
$_nav_="设置折扣";
}
$content[]=array("客户","<b>".$msg["title"]."(".$msg["username"].")</b>");
if($zk_type=="y1"){
$zk_value=$msg["zk"];
$zk_value=$zk_value>0?$zk_value:"100";
$zb="<input type=\"text\" name=\"zk\" id=\"zk\" style=\"width:30px\" value=\"".$zk_value."\">%";
}else if($zk_type=="y2"){
//取得指标格式
$zkxf="category";
switch($zkxf){
case "category":
$zb="<table border=\"0\" cellspacing=\"1\" cellpadding=\"3\" align=\"left\" bgcolor=\"#cccccc\"><tr><td bgcolor=\"#f0f0f0\">大类</td><td bgcolor=\"#f0f0f0\">折扣</td><td bgcolor=\"#f0f0f0\">折后金额</td></tr>";
//大类
$q="select * from ".$table_pre."keyword where cate='".$zkxf."' order by no";
$r=$db->query($q);
$num_total=0;
$i=1;
$total_money=0;
while($m=$db->fetch_array($r)){
$zk_value=get_zk($id,$m["no"]);
$zk_value=$zk_value>0?$zk_value:"100";
$tmp=get_db_msg("select sum((".get_size_sql("sum").")*price) 'money' from ".$table_pre."order where uid='".$id."' and category='".$m["no"]."' and ka<>'y'");
$zhje=$tmp["money"]*$zk_value/100;
$total_money+=$zhje;
$zb.="<tr><td bgcolor=\"#ffffff\">".$m["no"]."-".$m["title"]."<input type=\"hidden\" name=\"zkno[]\" value=\"".$m["no"]."\"></td><td bgcolor=\"#ffffff\"><input type=\"text\" name=\"num_".$m["no"]."\" id='num_".$i."' style=\"width:30px\" value=\"".$zk_value."\"></td><td bgcolor=\"#ffffff\" align=\"right\">".keep_float($zhje,2)."</td></tr>";
$i++;
}
$zb.="<tr><td bgcolor=\"#ffffff\" align=\"right\" colspan=\"2\">合计</td><td bgcolor=\"#ffffff\" align=\"right\">".keep_float($total_money,2)."</td></tr>";
break;
}
$zb.="</table>";
}
$content[]=array("折扣",$zb);
//js_code
$js_code.="function ok(){
obj=document.form1;
return true;
}";
//
$form_property=" onsubmit=\"return ok()\"";
$form_hidden=array("id"=>$id,"_a"=>"save_set_zk");
$_submit_button_="<input type=\"submit\" name=\"s1\" value=\"保存设置\"> <input type=\"button\" name=\"b1\" value=\"关闭窗口\" onclick=\"window.close();\">";
$_width_="40";
include template("win_add");
exit;
break;
case "save_set_zk":
$msg_client=get_db_msg("select * from ".$table_pre."client where id='".$id."'");
if($zk_type=="y1"){
$db->query("update ".$table_pre."client set zk='".$zk."' where id='".$id."'");
}else if($zk_type=="y2"){
$cid=$id;
$zkxf="category";
switch($zkxf){
case "category":
for($i=0;$i<count($zkno);$i++){
$var_num="num_".$zkno[$i];
update_zk($cid,$zkno[$i],$$var_num);
}
break;
}
}
set_order_total($cid);
echo "<script>
window.opener.location.reload();
window.location.href='?_m=".$_m."&_cid=".$_cid."&_a=set_zk&id=".$id."';
alert('设置成功!');
//window.close();
</script>";
break;
default:
//
break;
}
//-----------------------tab
$tab_content=array();
$i=0;
foreach($arr_report as $k => $v){
if($k==$_a)
$tab_content[$i][0]="_1";
else
$tab_content[$i][0]="";
$tab_content[$i][1]="<a href=\"".$_SERVER[PHP_SELF]."?_cid=".$_cid."&_m=".$_m."&_a=".$k."&s_username=".$s_username."&sub=".$sub."\">".$v."</a>";
$i++;
}
//-----------------------/tab
$_tmpl=$_tmpl?$_tmpl:"report";
include template($_tmpl);
?>
File diff suppressed because it is too large Load Diff
+131
View File
@@ -0,0 +1,131 @@
<?php
if(THIS_IN!="edt_c")
exit("错误的访问!");
$uid=check_cookie();
$db=_mysql_connect();
$msg_login_user=get_db_msg("select * from ".$table_pre."client where id='".$uid."'");
$_title_="用户管理";
$_nav_="<a href=\"".$_SERVER[PHP_SELF]."?_m=user/main\">首页</a>";
switch($_a){
case "set_password" :
$content0[]=array("用户名",$msg_login_user["username"]);
$content0[]=array("新密码","<input type=\"password\" name=\"password\" style='width:100px'> *");
$content0[]=array("新密码确认","<input type=\"password\" name=\"password_confirm\" style='width:100px'> *");
//js_code
$js_code="";
//
$content="<script>
function ok(){
obj=document.form1;
if(obj.password.value==''){
alert('请输入密码!');
obj.password.focus();
return false;
}
if(obj.password.value!=obj.password_confirm.value){
alert('2次输入的密码不一致!');
obj.password.focus();
return false;
}
return true;
}
</script><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\"><form name=\"form1\" action=\"".$_SERVER[PHP_SELF]."\" onsubmit=\"return ok()\"><input type=\"hidden\" name=\"_m\" value=\"user/info\"><input type=\"hidden\" name=\"_a\" value=\"save_password\">";
for($i=0;$i<count($content0);$i++){
$content.="<tr><td width=\"120\" align=\"right\" style=\"font-weight:bold;\">".$content0[$i][0]."</td><td align=\"left\">&nbsp;".$content0[$i][1]."</td></tr>";
}
$content.="<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"保存修改\"></td></tr></table>";
$_button_="<input type=\"button\" value=\" 返 回 \" onclick=\"location.href='".$_SERVER[PHP_SELF]."?_m=user/info'\">";
$_title1_="密码设置";
break;
case "save_password" :
if($password!=$password_confirm)
alert_and_back("2次输入的密码不一致!");
$query="update ".$table_pre."user set password='".md5($password)."' where id='".$uid."'";
$db->query($query);
$lid=$id?$id:$db->insert_id();
set_log("用户密码设置",$msg_login_user["username"]."|".$uid);
echo "<script>
alert('密码设置成功,下次登录请使用新密码!');
location.href=\"".$_SERVER[PHP_SELF]."?_m=user/info\";
</script>";
break;
case "modify";
$d_gender=$msg_login_user["gender"];
$d_zjlx=$msg_login_user["zjlx"];
//
$content0[]=array("用户名","<input type=\"text\" name=\"username\" value=\"".$msg_login_user["username"]."\" style='width:100px' maxlength=\"50\" disabled> *");
$content0[]=array("密码提示问题","<input type=\"text\" name=\"password_question\" style='width:300px' value=\"".$msg_login_user["password_question"]."\"> *");
$content0[]=array("密码提示答案","<input type=\"text\" name=\"password_answer\" style='width:150px' value=\"".$msg_login_user["password_answer"]."\"> *");
$content0[]=array("真实姓名","<input type=\"text\" name=\"name\" style='width:80px' value=\"".$msg_login_user["name"]."\"> <select name=\"gender\">".get_main_op($arr_gender,$d_gender)."</select>");
$content0[]=array("固定电话","<input type=\"text\" name=\"phone\" style='width:200px' value=\"".$msg_login_user["phone"]."\">");
$content0[]=array("手机号码","<input type=\"text\" name=\"cellphone\" style='width:200px' value=\"".$msg_login_user["cellphone"]."\">");
$content0[]=array("电子邮箱","<input type=\"text\" name=\"email\" style='width:200px' value=\"".$msg_login_user["email"]."\">");
$content0[]=array("证件号码","<select name=\"zjlx\"><option value=''>--</option>".get_main_op($arr_zjlx,$d_zjlx)."</select> <input type=\"text\" name=\"zjhm\" style='width:200px' value=\"".$msg_login_user["zjhm"]."\">");
$content0[]=array("出生日期","<input type=\"text\" name=\"birthday\" style='width:70px' value=\"".deel_date_null($msg_login_user["birthday"])."\" onclick=\"WdatePicker()\" readonly>");
$content0[]=array("居住城市","<input type=\"text\" name=\"city\" style='width:80px' value=\"".$msg_login_user["city"]."\">");
$content0[]=array("邮寄地址","<input type=\"text\" name=\"addr\" style='width:300px' value=\"".$msg_login_user["addr"]."\">");
$content0[]=array("邮编","<input type=\"text\" name=\"postcode\" style='width:80px' value=\"".$msg_login_user["postcode"]."\">");
$content0[]=array("备注信息","<textarea name=\"remark\" style='width:200px' rows=\"3\">".$msg_login_user["remark"]."</textarea>");
$content0[]=array("注册日期",date("Y-m-d",$msg_login_user["add_date"]));
//
$content="<script>
function ok(){
if(obj.password_question.value==''){
alert('请输入密码提示问题!');
obj.password_question.focus();
return false;
}
if(obj.password_answer.value==''){
alert('请输入密码提示答案!');
obj.password_answer.focus();
return false;
}
return true;
}
</script><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\"><form name=\"form1\" action=\"".$_SERVER[PHP_SELF]."\" onsubmit=\"return ok()\"><input type=\"hidden\" name=\"_m\" value=\"user/info\"><input type=\"hidden\" name=\"_a\" value=\"save_modify\">";
for($i=0;$i<count($content0);$i++){
$content.="<tr><td width=\"120\" align=\"right\" style=\"font-weight:bold;\">".$content0[$i][0]."</td><td align=\"left\">&nbsp;".$content0[$i][1]."</td></tr>";
}
$content.="<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"保存修改\"></td></tr></table>";
$_button_="<input type=\"button\" value=\" 返 回 \" onclick=\"location.href='".$_SERVER[PHP_SELF]."?_m=user/info'\">";
$_title1_="修改个人资料";
break;
case "save_modify" :
$query="update ".$table_pre."user set name='".$name."',password_question='".$password_question."',password_answer='".$password_answer."',gender='".$gender."',phone='".$phone."',cellphone='".$cellphone."',email='".$email."',zjlx='".$zjlx."',zjhm='".$zjhm."',city='".$city."',addr='".$addr."',postcode='".$postcode."',birthday='".$birthday."',remark='".$remark."' where id='".$uid."'";
$db->query($query);
set_log("学员资料修改",$msg_login_user["username"]."|".$uid);
echo "<script>
alert('信息保存成功!');
location.href=\"".$_SERVER[PHP_SELF]."?_m=user/info\";
</script>";
break;
default:
$_title1_="个人资料";
$content0[]=array("用户名",$msg_login_user["username"]);
$content0[]=array("密码提示问题",$msg_login_user["password_question"]);
$content0[]=array("密码提示答案",$msg_login_user["password_answer"]);
$content0[]=array("真实姓名",$msg_login_user["name"]);
$content0[]=array("性别",get_main_value($arr_gender,$msg_login_user["gender"]));
$content0[]=array("固定电话",$msg_login_user["phone"]);
$content0[]=array("手机号码",$msg_login_user["cellphone"]);
$content0[]=array("电子邮箱",$msg_login_user["email"]);
$content0[]=array("证件类别",get_main_value($arr_zjlx,$msg_login_user["zjlx"]));
$content0[]=array("证件号码",$msg_login_user["zjhm"]);
$content0[]=array("出生日期",deel_date_null($msg_login_user["birthday"]));
$content0[]=array("居住城市",$msg_login_user["city"]);
$content0[]=array("邮寄地址",$msg_login_user["addr"]);
$content0[]=array("邮编",$msg_login_user["postcode"]);
$content0[]=array("备注信息",dhtmlchars($msg_login_user["remark"]));
$content0[]=array("注册日期",date("Y-m-d",$msg_login_user["add_date"]));
$content="<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\">";
for($i=0;$i<count($content0);$i++){
$content.="<tr><td width=\"120\" align=\"right\" style=\"font-weight:bold;\">".$content0[$i][0]."</td><td align=\"left\">&nbsp;".$content0[$i][1]."</td></tr>";
}
$content.="</table>";
$_button_="<input type=\"button\" value=\"资料修改\" onclick=\"location.href='".$_SERVER[PHP_SELF]."?_m=user/info&_a=modify'\"> <input type=\"button\" value=\"密码设置\" onclick=\"location.href='".$_SERVER[PHP_SELF]."?_m=user/info&_a=set_password'\">";
break;
}
$_title_=$_title1_."-首页";
$_right="hidden";
include template("user");
?>
+49
View File
@@ -0,0 +1,49 @@
<?php
if(THIS_IN!="edt_c")
exit("错误的访问!");
$time_forever=time()+365*24*3600;
switch($_a){
case "login":
//检查
if($username && $password){
$db=_mysql_connect();
$m=get_db_msg("select * from ".$table_pre."client where username='".$username."' and password='".$password."' limit 0,1");
if($m["id"]>0){
if($m["available"]=="n"){
$msg_error="对不起,该用户已经被禁用!";
include template("login");
}else if($m["face"] !="4" && $m["face"] !="3" && $m["face"] !="2"){
$msg_error="对不起,请输入正确的代理号或店铺号!";
include template("login");
}else{
//记住用户名
if($remember_username=="y")
setcookie("remember_username_pc",$username,$time_forever,"/");
//设置cookie
$t=($auto_login=="y")?$time_forever:0;
setcookie(THIS_COOKIE,$m["id"],$t,"/");
//记录日志
$uid=$m["id"];
set_log("登录系统");
//更新用户最新登录
$db->query("update ".$table_pre."client set lastactivity='".time()."' where id='".$uid."'");
//记录在线状态
$login_uid=$m["id"];
//update_session("登录系统","用户首页");
//进入登录页面
url_redirect("?_m=user/main");
}
}else{
$msg_error="用户名或密码错误!";
set_log("登录失败","尝试:".$username."/".$password);
include template("login");
}
}else{
alert_and_back("请输入用户名和密码!");
}
break;
default:
include template("login");
break;
}
?>
+9
View File
@@ -0,0 +1,9 @@
<?php
if(THIS_IN!="edt_c")
exit("错误的访问!");
$db=_mysql_connect();
$uid=check_cookie();
set_log("退出系统");
setcookie(THIS_COOKIE,0,0,"/");
include template("login");
?>
+12
View File
@@ -0,0 +1,12 @@
<?php
if(THIS_IN!="edt_c")
exit("错误的访问!");
$login_uid=check_cookie();
$db=_mysql_connect();
$msg_login_user=get_db_msg("select * from ".$table_pre."client where id='".$login_uid."'");
$_title_="首页";
$_nav_="<a href=\"?_m=user/main\">首页</a> > 欢迎登录";
$column[0][0]="欢迎登陆";
$column[0][1]="<div style=\"padding:10px;\">&nbsp;&nbsp;&nbsp;&nbsp;欢迎登陆E订通后台管理系统,请选择左边的菜单进行操作。<br><p style=\"line-height:400px;\">&nbsp;</p></div>";
include template("index_manage");
?>