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
+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