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首页 > ".$_title_.""; $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("客户","".$msg["title"]."(".$msg["username"].")"); if($zk_type=="y1"){ $zk_value=$msg["zk"]; $zk_value=$zk_value>0?$zk_value:"100"; $zb="%"; }else if($zk_type=="y2"){ //取得指标格式 $zkxf="category"; switch($zkxf){ case "category": $zb=""; //大类 $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.=""; $i++; } $zb.=""; break; } $zb.="
大类折扣折后金额
".$m["no"]."-".$m["title"]."".keep_float($zhje,2)."
合计".keep_float($total_money,2)."
"; } $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_=" "; $_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 window.opener.location.reload(); window.location.href='?_m=".$_m."&_cid=".$_cid."&_a=set_zk&id=".$id."'; alert('设置成功!'); //window.close(); "; 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]="".$v.""; $i++; } //-----------------------/tab $_tmpl=$_tmpl?$_tmpl:"report"; include template($_tmpl); ?>