This repository has been archived on 2026-06-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
wsh5485 7e47ce238b chore: 添加多个图片和资源文件
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
2025-06-15 13:04:37 +08:00

3063 lines
83 KiB
PHP
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
////////////解析session动作
function parse_session_action($action){
$tmp=explode("|",$action);
$_m=$tmp[0];
$_a=$tmp[1];
$r="";
if($_a=="o"){
$r.="订单分析";
}else{
$r.="订货界面";
}
return $r;
}
///////////////////////////////////////////////////////字符串
function ifor_edt_str2num($str){
$key="background";
$num="";
for($i=0;$i<strlen($str);$i++){
for($k=0;$k<strlen($key);$k++){
if(substr($key,$k,1)==substr($str,$i,1))
$num.=$k;
}
}
return $num;
}
//
function deel_text_html($text){
$text=StripSlashes($text);
$text=str_replace("\"","'",$text);
return $text;
}
//
function get_editor($text,$id='content1',$w='100%',$h='450px'){
$text=deel_text_html($text);
$r="<textarea id=\"".$id."\" name=\"".$id."\" style=\"width:".$w.";height:".$h.";visibility:hidden;\">".$text."</textarea>";
//$r="<INPUT type=\"hidden\" name=\"".$id."\" value=\"".$text."\"><IFRAME ID=\"".$text1."\" src=\"editor/ewebeditor.htm?id=".$id."&style=mini\" frameborder=\"0\" scrolling=\"no\" width=\"".$w."\" height=\"".$h."\"></IFRAME>";
return $r;
}
//取得唯一标识
function gsession(){
$r=date("YmdHis").substr(microtime(),2,6);
return $r;
}
//daddslashes
function daddslashes($string) {
if(!get_magic_quotes_gpc()) {
if(is_array($string)) {
foreach($string as $key => $val) {
$string[$key] = daddslashes($val, $force);
}
} else {
$string = addslashes($string);
}
}
return $string;
}
//dstripslashes
function dstripslashes($string) {
if(is_array($string)) {
foreach($string as $key => $val) {
$string[$key] = dstripslashes($val, $force);
}
} else {
$string = stripslashes($string);
}
return $string;
}
//取得随机字母
function get_rand($num){
$choper="123456789abcdefghijklmnpqrstuvwxyz";
for($i=0;$i<$num;$i++){
$r_str.=substr($choper,rand(0,strlen($choper)-1),1);
}
return $r_str;
}
//取得随机数字
function get_rand_num($num){
$choper="0123456789";
for($i=0;$i<$num;$i++){
$r_str.=substr($choper,rand(0,strlen($choper)-1),1);
}
return $r_str;
}
//转换成html
function dhtmlchars($str){
$str=str_replace("<","&lt;",$str);
$str=str_replace(">","&gt;",$str);
$str=str_replace("\n","<br>",$str);
$str=str_replace("\r","",$str);
$str=str_replace(" ","&nbsp;",$str);
return $str;
}
//dhtmlspecialchars
function dhtmlspecialchars($string) {
if(is_array($string)) {
foreach($string as $key => $val) {
$string[$key] = dhtmlspecialchars($val);
}
} else {
$string = preg_replace('/&amp;((#(\d{3,5}|x[a-fA-F0-9]{4})|[a-zA-Z][a-z0-9]{2,5});)/', '&\\1',
str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $string));
}
return $string;
}
//去除html标记
function no_html($content){
$search=array("'<script[^>]*?>.*?</script>'si",
"'<[\/\!]*?[^<>]*?>'si",
"'([\r\n])[\s]+'",
"'&(quot|#34);'i",
"'&(amp|#38);'i",
"'&(lt|#60);'i",
"'&(gt|#62);'i",
"'&(nbsp|#160);'i",
"'&(iexcl|#161);'i",
"'&(cent|#162);'i",
"'&(pound|#163);'i",
"'&(copy|#169);'i",
"'&#(\d+);'e");
$replace=array("",
"",
"\\1",
"\"",
"&",
"<",
">",
" ",
chr(161),
chr(162),
chr(163),
chr(169),
"chr(\\1)");
$content=preg_replace($search,$replace,$content);
return $content;
}
/////显示短标题
//不带省略号
function substrgb($str,$len){
if(strlen($str)<$len+1){
return $str;
}else{
$start=0;
for($i=0;$i<$start+$len;$i++){
$tmpstr=(ord($str[$i])>=161 && ord($str[$i])<=247 && ord($str[$i+1])>=161 && ord($str[$i+1])<=254)?$str[$i].$str[++$i]:$tmpstr=$str[$i];
if ($i>=$start&&$i<($start+$len))
$tmp.=$tmpstr;
}
return $tmp;
}
}
//带省略号
function substrgb1($str,$len){
if(strlen($str)<$len+1){
return $str;
}else{
$start=0;
for($i=0;$i<$start+$len;$i++){
$tmpstr=(ord($str[$i])>=161 && ord($str[$i])<=247 && ord($str[$i+1])>=161 && ord($str[$i+1])<=254)?$str[$i].$str[++$i]:$tmpstr=$str[$i];
if ($i>=$start&&$i<($start+$len))
$tmp.=$tmpstr;
}
return $tmp."...";
}
}
//截取字符
function sub_start_end($str,$start,$end){
$tmp=explode($start,$str);
$tmp=explode($end,$tmp[1]);
return $tmp[0];
}
//
function check_td($str){
return trim($str)?$str:"&nbsp;";
}
///////////////////////////////////////////////////////url相关
//重定向
function url_redirect($url=''){
$url=$url?$url:$_SERVER["HTTP_REFERER"];
//echo $url;
echo "<script> window.location.href='".$url."'; </script>";
//echo "<meta http-equiv=\"rsefresh\" content=\"1;url=".$url."\">";
echo "<body><a href=\"".$url."\">Success!</a></body>";
exit();
}
//输出js代码并且重定向
function jscode_and_redirect($url='',$jscode=''){
$url=$url?$url:$_SERVER["HTTP_REFERER"];
echo "<html><head><meta http-equiv=\"refresh\" content=\"1;url=".$url."\"></head><body>".$jscode."</body></html>";
exit();
}
//输出js错误提示
function alert($msg){
echo "<script> alert('".$msg."'); </script>";
exit();
}
//输出js错误提示并返回
function alert_and_back($msg){
echo "<html><head><meta http-equiv=\"content-type\" content=\"text/html;charset=gb2312\"></head><body><script> alert('".$msg."');\n history.back(); </script></body></html>";
exit();
}
//输出js错误提示并关闭窗口
function alert_and_close($msg){
echo "<html><head><meta http-equiv=\"content-type\" content=\"text/html;charset=gb2312\"></head><body><script> alert('".$msg."');\n window.close(); </script></body></html>";
exit();
}
//输出js错误提示并重定向
function alert_and_redirect($msg,$url){
echo "<html><head><meta http-equiv=\"refresh\" content=\"0;url=".$url."\"><meta http-equiv=\"content-type\" content=\"text/html;charset=gb2312\"><script> alert('".$msg."'); </script></body></html>";
exit();
}
//输出js错误提示并关闭窗口
function alert_and_reload_opener($msg){
echo "<html><head><meta http-equiv=\"content-type\" content=\"text/html;charset=gb2312\"></head><body><script> alert('".$msg."');\n window.opener.location.reload();\n window.close();\n </script></body></html>";
exit();
}
//重定向并post变量
function redirect_and_post($url,$var){
$html="<body onload='document.form1.submit();'><form name=form1 method='post' action=\"".$url."\">";
if(is_array($var)){
foreach($var as $key => $value){
$html.="<input type=hidden name=\"".$key."\" value=\"".urlencode($value)."\">\n";
}
}
$html.="</form></body>";
echo $html;
}
//处理url
function url_add_getvar($url,$arr){
$tmp=str_replace("?","#",$url);
if(ereg("#",$tmp))
$url.="&";
else
$url.="?";
foreach($arr as $key => $value){
$url.=$key."=".$value."&";
}
$url=substr($url,0,-1);
return $url;
}
///////////////////////////////////////////////////////文件操作
//上传文件
function upload_file($original_file,$path,$new_file_name){
make_dir($path);
return copy($original_file,$path."/".$new_file_name);
}
//修改文件名
function modify_file_name($original_file,$new_file_name){
if(is_file($original_file)){
copy($original_file,$new_file_name);
unlink($original_file);
}
}
//创建目录
function make_dir($dir){
if(!is_dir($dir))
mkdir($dir,0777);
}
///删除文件
function del_file($file){
if(is_file($file))
return unlink($file);
}
//写入文件
function write_file($dir,$file_name,$content){
make_dir($dir);
$file=$dir."/".$file_name;
$fp=fopen($file,"w");
if(fwrite($fp,$content))
return true;
else
return false;
}
//写入并覆盖文件
function write_file1($dir,$file_name,$content){
make_dir($dir);
$file=$dir."/".$file_name;
$fp=fopen($file,"w+");
if(fwrite($fp,$content))
return true;
else
return false;
}
//读取文件内容
function read_file($file){
if(is_file($file)){
$fp=fopen($file,"r");
while($buffer=fread($fp,1024)){
$content.=$buffer;
}
fclose($fp);
}
return $content;
}
//取得文件的后缀名
function get_file_name($file_name){
$arr_tmp=explode(".",$file_name);
$num=count($arr_tmp)-1;
$r="";
for($i=0;$i<$num;$i++){
$r.=$arr_tmp[$i].".";
}
if($r)
$r=substr($r,0,-1);
return $r;
}
//取得文件的后缀名
function get_file_ext($file_name){
$arr_tmp=explode(".",$file_name);
$num=count($arr_tmp)-1;
return strtolower($arr_tmp[$num]);
}
//取得文件的图标
function get_file_ext_icon($file_ext,$property){
$ft="";
switch($file_ext){
case "rm":
case "swf":
$ft=$file_ext;
break;
default:
$ft="avi";
break;
}
return "<img src=\"images/f_".$ft.".gif\" border=\"0\"".$property.">";
}
//检查类型
function check_file_type($str,$type){
$r=false;
$tmp=explode("|",$str);
for($i=0;$i<count($tmp);$i++){
if(strtolower($tmp[$i])==strtolower($type)){
$r=true;
break;
}
}
return $r;
}
//检查文件大小
function check_file_size($f_size,$c_size){
$r=false;
if($f_size/1024<$c_size)
$r=true;
return $r;
}
//制作缩略图
function make_mini_picture($srcFile,$dstFile,$size=200){
$data=GetImageSize($srcFile);
switch($data[2]){
case 1:
$im=@ImageCreateFromGIF($srcFile);
break;
case 2:
$im=@ImageCreateFromJPEG($srcFile);
break;
case 3:
$im=@ImageCreateFromPNG($srcFile);
break;
}
$srcW=ImageSX($im);
$srcH=ImageSY($im);
if($srcW<$size && $srcH<$size){
$dstW=$srcW;
$dstH=$srcH;
}else if($srcW>$srcH){
$dstW=$size;
$dstH=intval($srcH*$size/$srcW);
}else{
$dstH=$size;
$dstW=intval($srcW*$size/$srcH);
}
$ni=imagecreatetruecolor($dstW,$dstH);
imagecopyresampled($ni,$im,0,0,0,0,$dstW,$dstH,$srcW,$srcH);
ImageJpeg($ni,$dstFile);
}
///////////////////////////////////////////////////////数据库操作
function _mysql_connect($t=''){
global $dbhost,$dbuser,$dbpw,$dbname;
switch($t){
case "1":
//
break;
default:
$db=new DB_Sql;
$db->connect($dbhost,$dbuser,$dbpw,$dbname);
break;
}
return $db;
}
//取得结果
function get_db_msg($query){
global $db;
$res=$db->query($query);
$msg=$db->fetch_array($res);
return $msg;
}
///////////////////////////////////////////////////////分页相关函数
//
function get_order_reverse_url($tran_var,$order,$value,$url=''){
$url=$url?$url:$_SERVER[PHP_SELF];
foreach($tran_var as $key1=>$value1){
$other_var.="&".$key1."=".urlencode($value1);
}
if($value==str_replace("!","",$order) && !ereg("!",$order))
$other_var="?order=!".$value.$other_var;
else
$other_var="?order=".$value.$other_var;
$r=$url.$other_var;
return $r;
}
//
function get_order_sql($order){
global $arr_order,$arr_order_d;
$arr=ereg("!",$order)?$arr_order_d:$arr_order;
$order=ereg("!",$order)?str_replace("!","",$order):$order;
foreach($arr as $key => $value){
if($key==$order)
$r=$value;
}
return $r;
}
//
function get_pagesize_option($arr){
global $page_size;
for($i=0;$i<count($arr);$i++){
$r.="<option value='".$arr[$i]."'";
if($page_size==$arr[$i])
$r.=" selected";
$r.=">".$arr[$i]."</option>";
}
return $r;
}
//
function get_order_action($self,$order,$url,$tran_var){
$url=$url?$url:$_SERVER[PHP_SELF];
if(is_array($tran_var)){
foreach($tran_var as $key => $value){
$query.=$key."=".urlencode($value)."&";
}
if(str_replace("!","",$order)==$self){
if(substr($order,strlen($order)-1,1)=="!"){
$query.="order=".$self;
$img="order2h.gif";
}else{
$query.="order=".$self."!";
$img="order1h.gif";
}
}else{
$query.="order=".$self;
$img="order1.gif";
}
return "<a href=\"".$url."?".$query."\"><img src=\"images/".$img."\" border=0></a>";
}else{
return ;
}
}
//
///////////////////////////////////////////////////////目录操作
//
function path_cut0($path){
$tmp=explode("-",$path);
for($i=0;$i<count($tmp);$i++){
if($tmp[$i]>0)
$r.=$tmp[$i]."-";
}
$r=substr($r,0,-1);
return $r;
}
///截去前$num层目录
function path_cut($path,$num){
$tmp=explode("-",$path);
for($i=$num;$i<count($tmp);$i++){
$r.=$tmp[$i]."-";
}
$r=substr($r,0,-1);
return $r;
}
//截去后$num层目录
function path_cutb($path,$num){
$tmp=explode("-",$path);
for($i=0;$i<count($tmp)-$num;$i++){
$r.=$tmp[$i]."-";
}
$r=substr($r,0,-1);
return $r;
}
//截去后$num层目录
function dir_cutb($path,$num){
if(ereg("/",$path)){
$flag="/";
}else{
$flag="\\";
}
$tmp=explode($flag,$path);
$r="";
for($i=0;$i<count($tmp)-$num;$i++){
$r.=$tmp[$i].$flag;
}
$r=substr($r,0,-1);
return $r;
}
//缩进
function indent($deep){
if($deep>0){
for($i=0;$i<$deep-1;$i++){
$r.="  ";
}
$r.="";
}
return $r;
}
//取得父目录
function get_parent_id($path){
$tmp=explode("-",$path);
$r=$tmp[count($tmp)-1];
$r=$r?$r:"0";
return $r;
}
//取得最后路径
function get_last_id($path){
$tmp=explode("-",$path);
$r=$tmp[count($tmp)];
$r=$r?$r:"0";
return $r;
}
//检测是否存在下级目录
function check_subpath($path){
global $db,$table_pre,$_m;
$check=false;
$tmp=get_db_msg("select count(*) 'num' from ".$table_pre."path where module='".$_m."' and path='".$path."'");
if($tmp[num]>0)
$check=true;
return $check;
}
//
function get_deep($path){
$arr=explode("-",$path);
return count($arr);
}
//
function op_path($path,$mod){
global $db,$table_pre;
$op_path="";
$res=$db->query("select * from ".$table_pre."path where module='".$mod."' and deep='1' order by ord");
while($msg=$db->fetch_array($res)){
$op_path.="<option value='".$msg["path"]."-".$msg["id"]."'";
if($path==$msg["path"]."-".$msg["id"])
$op_path.=" selected";
$op_path.=">".$msg[title]."</option>";
}
return $op_path;
}
//
function op_path_two($path,$mod){
global $db,$table_pre;
$op_path="";
$res=$db->query("select * from ".$table_pre."path where module='".$mod."' and deep='1' order by ord");
while($msg=$db->fetch_array($res)){
$check=get_db_msg("select count(*) 'num' from ".$table_pre."path where module='".$mod."' and path='".$msg["path"]."-".$msg["id"]."'");
if($check[num]==0){
$op_path.="<option value='".$msg["path"]."-".$msg["id"]."'";
if($path==$msg["path"]."-".$msg["id"])
$op_path.=" selected";
$op_path.=">".$msg[title]."</option>";
}
$r=$db->query("select * from ".$table_pre."path where module='".$mod."' and path='0-".$msg["id"]."' order by ord");
while($m=$db->fetch_array($r)){
$op_path.="<option value='".$m["path"]."-".$m["id"]."'";
if($path==$m["path"]."-".$m["id"])
$op_path.=" selected";
$op_path.=">".$msg[title]." -> ".$m[title]."</option>";
}
}
return $op_path;
}
//
function op_path_two1($path,$mod){
global $db,$table_pre;
$op_path="";
$res=$db->query("select * from ".$table_pre."path where module='".$mod."' and deep='1' order by ord");
while($msg=$db->fetch_array($res)){
$check=get_db_msg("select count(*) 'num' from ".$table_pre."path where module='".$mod."' and path='".$msg["path"]."-".$msg["id"]."'");
$op_path.="<option value='".$msg["path"]."-".$msg["id"]."'";
if($path==$msg["path"]."-".$msg["id"])
$op_path.=" selected";
$op_path.=">".$msg[title]."</option>";
$r=$db->query("select * from ".$table_pre."path where module='".$mod."' and path='0-".$msg["id"]."' order by ord");
while($m=$db->fetch_array($r)){
$op_path.="<option value='".$m["path"]."-".$m["id"]."'";
if($path==$m["path"]."-".$m["id"])
$op_path.=" selected";
$op_path.=">  ".$m[title]."</option>";
}
}
return $op_path;
}
//
function op_course_chapter($cid,$cpath=''){
global $db,$table_pre;
$op_path="";
$q="select * from ".$table_pre."course_chapter where iid='".$cid."' and deep=1 order by ord";
$r=$db->query($q);
while($m=$db->fetch_array($r)){
//$check=get_db_msg("select count(*) 'num' from ".$table_pre."course_chapter where iid='".$cid."' and path='".$m["path"]."-".$m["id"]."'");
$op_path.="<option value='".$m["path"]."-".$m["id"]."'";
if($cpath==$m["path"]."-".$m["id"])
$op_path.=" selected";
$op_path.=">".$m["title"]."</option>";
$q1="select * from ".$table_pre."course_chapter where deep=2 and path='".$m["path"]."-".$m["id"]."' order by ord";
$r1=$db->query($q1);
while($m1=$db->fetch_array($r1)){
$op_path.="<option value='".$m1["path"]."-".$m1["id"]."'";
if($cpath==$m1["path"]."-".$m1["id"])
$op_path.=" selected";
$op_path.=">  ".$m1["title"]."</option>";
}
}
return $op_path;
}
//
function op_path_two_pid($pid,$mod){
global $db,$table_pre;
$op_path="";
$res=$db->query("select * from ".$table_pre."path where module='".$mod."' and deep='1' order by ord");
while($msg=$db->fetch_array($res)){
$check=get_db_msg("select count(*) 'num' from ".$table_pre."path where module='".$mod."' and path='".$msg["path"]."-".$msg["id"]."'");
$op_path.="<option value='".$msg["id"]."'";
if($pid==$msg["id"])
$op_path.=" selected";
$op_path.=">".$msg["title"]."</option>";
$r=$db->query("select * from ".$table_pre."path where module='".$mod."' and path='0-".$msg["id"]."' order by ord");
while($m=$db->fetch_array($r)){
$op_path.="<option value='".$m["id"]."'";
if($pid==$m["id"])
$op_path.=" selected";
$op_path.=">  ".$m["title"]."</option>";
}
}
return $op_path;
}
//
function op_path_three($path,$mod){
global $db,$table_pre;
$op_path="";
$res=$db->query("select * from ".$table_pre."path where module='".$mod."' and deep='1' order by ord");
while($msg=$db->fetch_array($res)){
$check=get_db_msg("select count(*) 'num' from ".$table_pre."path where module='".$mod."' and path='".$msg["path"]."-".$msg["id"]."'");
if($check[num]==0){
$op_path.="<option value='".$msg["path"]."-".$msg["id"]."'";
if($path==$msg["path"]."-".$msg["id"])
$op_path.=" selected";
$op_path.=">".$msg[title]."</option>";
}
$r=$db->query("select * from ".$table_pre."path where module='".$mod."' and path='0-".$msg["id"]."' order by ord");
while($m=$db->fetch_array($r)){
$check=get_db_msg("select count(*) 'num' from ".$table_pre."path where module='".$mod."' and path='".$m["path"]."-".$m["id"]."'");
if($check[num]==0){
$op_path.="<option value='".$m["path"]."-".$m["id"]."'";
if($path==$m["path"]."-".$m["id"])
$op_path.=" selected";
$op_path.=">".$msg[title]." -> ".$m[title]."</option>";
}
$r1=$db->query("select * from ".$table_pre."path where module='".$mod."' and path='".$m["path"]."-".$m["id"]."' order by ord");
while($m1=$db->fetch_array($r1)){
$op_path.="<option value='".$m1["path"]."-".$m1["id"]."'";
if($path==$m1["path"]."-".$m1["id"])
$op_path.=" selected";
$op_path.=">".$msg[title]." -> ".$m[title]." -> ".$m1[title]."</option>";
}
}
}
return $op_path;
}
//
function op_client_dp($path=''){
global $db,$table_pre;
$op_path="";
$res=$db->query("select * from ".$table_pre."client where face='4' order by path, ord");
while($msg=$db->fetch_array($res)){
$op_path.="<option value='".$msg["id"]."'";
if($path==$msg["id"])
$op_path.=" selected";
$op_path.=">".$msg["title"]."(".$msg["username"].")</option>";
}
return $op_path;
}
//
function op_client_dp1($username){
global $db,$table_pre;
$op_path="";
$res=$db->query("select * from ".$table_pre."client where face='4' order by path, ord");
while($msg=$db->fetch_array($res)){
$op_path.="<option value='".$msg["username"]."'";
if($username==$msg["username"])
$op_path.=" selected";
$op_path.=">".$msg["title"]."(".$msg["username"].")</option>";
}
return $op_path;
}
//
function op_client_all_id($cid=''){
global $db,$table_pre;
$op_path="";
$res=$db->query("select * from ".$table_pre."client order by path,ord");
while($msg=$db->fetch_array($res)){
$op_path.="<option value='".$msg["id"]."'";
if($cid==$msg["id"])
$op_path.=" selected";
$op_path.=">".$msg["title"]."(".$msg["username"].")</option>";
}
return $op_path;
}
//
function op_client($path=''){
global $db,$table_pre;
$op_path="";
$res=$db->query("select * from ".$table_pre."client where face=3 or face=9 order by concat(path,'-',id),ord");
while($msg=$db->fetch_array($res)){
$op_path.="<option value='".$msg["path"]."-".$msg["id"]."'";
if($path==$msg["path"]."-".$msg["id"])
$op_path.=" selected";
$op_path.=">".indent($msg["deep"]).$msg["title"]."(".$msg["username"].")</option>";
}
return $op_path;
}
//
function op_client1($path){
global $db,$table_pre;
$op_path="";
$res=$db->query("select * from ".$table_pre."client where deep='1' order by ord");
while($msg=$db->fetch_array($res)){
$check=get_db_msg("select count(*) 'num' from ".$table_pre."client where path='".$msg["path"]."-".$msg["id"]."'");
if($check["num"]==0){
$op_path.="<option value='".$msg["path"]."-".$msg["id"]."'";
if($path==$msg["path"]."-".$msg["id"])
$op_path.=" selected";
$op_path.=">".$msg["title"]."(".$msg["username"].")</option>";
}
$r=$db->query("select * from ".$table_pre."client where path='".$msg["path"]."-".$msg["id"]."' order by ord");
while($m=$db->fetch_array($r)){
$check=get_db_msg("select count(*) 'num' from ".$table_pre."client where path='".$m["path"]."-".$m["id"]."'");
if($check[num]==0){
$op_path.="<option value='".$m["path"]."-".$m["id"]."'";
if($path==$m["path"]."-".$m["id"])
$op_path.=" selected";
$op_path.=">".$msg["title"]."(".$msg["username"].") -> ".$m["title"]."(".$m["username"].")</option>";
}
$r1=$db->query("select * from ".$table_pre."client where path='".$m["path"]."-".$m["id"]."' order by ord");
while($m1=$db->fetch_array($r1)){
$check=get_db_msg("select count(*) 'num' from ".$table_pre."client where path='".$m1["path"]."-".$m1["id"]."'");
if($check[num]==0){
$op_path.="<option value='".$m1["path"]."-".$m1["id"]."'";
if($path==$m1["path"]."-".$m1["id"])
$op_path.=" selected";
$op_path.=">".$msg["title"]."(".$msg["username"].") -> ".$m["title"]."(".$m["username"].") -> ".$m1["title"]."(".$m1["username"].")</option>";
}
$r2=$db->query("select * from ".$table_pre."client where path='".$m1["path"]."-".$m1["id"]."' order by ord");
while($m2=$db->fetch_array($r2)){
$check=get_db_msg("select count(*) 'num' from ".$table_pre."client where path='".$m2["path"]."-".$m2["id"]."'");
if($check[num]==0){
$op_path.="<option value='".$m2["path"]."-".$m2["id"]."'";
if($path==$m2["path"]."-".$m2["id"])
$op_path.=" selected";
$op_path.=">".$msg["title"]."(".$msg["username"].") -> ".$m["title"]."(".$m["username"].") -> ".$m1["title"]."(".$m1["username"].") -> ".$m2["title"]."(".$m2["username"].")</option>";
}
}
}
}
}
return $op_path;
}
//
function get_client_path_title($path,$split='-'){
global $db,$table_pre;
$table=$table_pre."client";
$tmp=explode("-",$path);
$r="";
for($i=0;$i<count($tmp);$i++){
if($tmp[$i]>0){
$t=get_db_msg("select * from ".$table." where id='".$tmp[$i]."'");
$r.=$t["title"].$split;
}
}
$r=substr($r,0,0-strlen($split));
return $r?$r:$path;
}
//
function get_path_title($path,$split='-',$table=''){
global $db,$table_pre;
$table=$table?$table:$table_pre."path";
$tmp=explode("-",$path);
$r="";
for($i=0;$i<count($tmp);$i++){
if($tmp[$i]>0){
$t=get_db_msg("select * from ".$table." where id='".$tmp[$i]."'");
$r.=$t["title"].$split;
}
}
$r=substr($r,0,0-strlen($split));
return $r;
}
//
function get_column_name($table,$id,$column){
global $db;
$msg=get_db_msg("select * from ".$table." where id='".$id."'");
return $msg[$column];
}
//
function parse_deep($deep){
$r="";
for($i=1;$i<$deep;$i++){
$r.="&nbsp;&nbsp;&nbsp;&nbsp;";
}
return $r;
}
///////////////////////////////////////////////////////数学和日期
//
function sizecount($filesize) {
if($filesize >= 1073741824) {
$filesize = round($filesize / 1073741824 * 100) / 100 . ' G';
} elseif($filesize >= 1048576) {
$filesize = round($filesize / 1048576 * 100) / 100 . ' M';
} elseif($filesize >= 1024) {
$filesize = round($filesize / 1024 * 100) / 100 . ' K';
} else {
$filesize = $filesize . ' bytes';
}
return $filesize;
}
//保留小数
function keep_float($f,$num,$thousands_sep=''){
$r=number_format($f,$num,".",$thousands_sep);
return $r;
}
//计算百分比
function deel_bfb($n1,$n2){
if($n2>0 && $n1>0){
$r=round(($n1/$n2)*100);
$r=$r."%";
}else{
$r="0%";
}
return $r;
}
//计算百分比
function deel_bfb1($n1,$n2,$num=2){
if($n2>0 && $n1>0){
$r=keep_float(($n1/$n2)*100,$num);
$r=$r."%";
//$r=$n1.",".$n2;
}else{
$r="0%";
}
return $r;
}
//计算百分比
function deel_bfb3($n1,$num=0){
if($n1>0){
$r=keep_float($n1*100,$num);
$r=$r."%";
//$r=$n1.",".$n2;
}else{
$r="0%";
}
return $r;
}
//
function deel_date1($format,$time){
if($time>0)
return date($format,$time);
else
return "";
}
//处理数字
function deel_num($num){
return $num+1-1;
}
//
function deel_price($price){
if($price==0)
return "";
else
return $price;
}
//
function deel_date_null($date){
$date=str_replace("0000-00-00","",$date);
return $date;
}
//
function format_my_date($date){
$date=str_replace("/","-",$date);
$date=deel_full_date($date);
return $date;
}
//
function get_min_in_array($arr){
if(is_array($arr)){
sort($arr);
return $arr[0];
}else{
return 0;
}
}
//
function check_datetime($datetime){
$datetime=str_replace("-","",$datetime);
$datetime=str_replace(":","",$datetime);
$datetime=str_replace(" ","",$datetime);
$datetime=$datetime+1-1;
return $datetime;
}
//
function day_add($date,$adder){
$tmp=explode("-",$date);
$t=mktime(0,0,0,$tmp[1],$tmp[2]+$adder,$tmp[0]);
return date("Y-n-j",$t);
}
//
function day_add1($date,$adder){
$tmp=explode("-",$date);
$t=mktime(0,0,0,$tmp[1],$tmp[2]+$adder,$tmp[0]);
return date("Y-m-d",$t);
}
//
function day_to_ymd($date){
if(!$date)
return;
$tmp=explode("-",$date);
$t=mktime(0,0,0,$tmp[1],$tmp[2]+$adder,$tmp[0]);
return date("Y-m-d",$t);
}
//日期转化为time()格式
function day_to_time($date){
if(!$date)
return;
$tmp=explode(" ",$date);
$date=explode("-",$tmp[0]);
$time=explode(":",$tmp[1]);
return mktime($time[0],$time[1],$time[2],$date[1],$date[2],$date[0]);
}
//日期转化为time()格式,时间为0:0:0
function day_to_time1($date){
if(!$date)
return;
$date=explode("-",$date);
return mktime(0,0,0,$date[1],$date[2],$date[0]);
}
//日期转化为time()格式,时间为23:59:59
function day_to_time2($date){
$date=explode("-",$date);
return mktime(23,59,59,$date[1],$date[2],$date[0]);
}
//计算天数
function count_day($date1,$date2){
if(!$date2)
return 0;
$Date_List_1=explode("-",$date1);
$Date_List_2=explode("-",$date2);
$d1=mktime(0,0,0,$Date_List_1[1],$Date_List_1[2],$Date_List_1[0]);
$d2=mktime(0,0,0,$Date_List_2[1],$Date_List_2[2],$Date_List_2[0]);
$days=round(($d2-$d1)/3600/24);
return $days;
}
//日期转成yyyy-dd-mm格式
function deel_full_date($date){
$arr=explode("-",$date);
$m=strlen($arr[1])>1?$arr[1]:"0".$arr[1];
$d=strlen($arr[2])>1?$arr[2]:"0".$arr[2];
return $arr[0]."-".$m."-".$d;
}
//
function hb_date($date1,$date2){
$a1=explode("-",$date1);
$a2=explode("-",$date2);
if($date1==$date2){
$r=$a1[0]."".$a1[1]."".$a1[2]."";
}else if($a1[0]==$a2[0]){
if($a1[1]==$a2[1]){
$r=$a1[0]."".$a1[1]."".$a1[2]."日-".$a2[2]."";
}else{
$r=$a1[0]."".$a1[1]."".$a1[2]."日-".$a2[1]."".$a2[2]."";
}
}else{
$r=$a1[0]."".$a1[1]."".$a1[2]."日-".$a2[0]."".$a2[1]."".$a2[2]."";
}
return $r;
}
//
function deel_add_date($add_date){
$arr1=explode(" ",$add_date);
$arr_d=explode("-",$arr1[0]);
$arr_t=explode(":",$arr1[1]);
return $arr_d[2]."".$arr_t[0]."".$arr_t[1]."".$arr_t[2]."";
}
//处理显示的金额方式
function deel_je_show($je){
if($je>=100000000){
$je=keep_float(($je/100000000),2)."亿";
}else if($je>=10000){
$je=keep_float(($je/10000),1)."";
}else{
$je=$je;
}
return $je;
}
///////////////////////////////////////////////////////权限相关
//
function count_priv_channel($cid,$priv){
$p=explode(",",$priv);
$count=0;
for($i=0;$i<count($p);$i++){
$t1=explode("-",$p[$i]);
if($t1[0]==$cid)
$count++;
}
return $count;
}
//
function print_form_priv($priv=''){
global $db,$table_pre,$arr_priv_tran;
$check=split_priv_str($priv);
$r="<table cellpadding=0 cellspacing=1 width=100% border=0 bgcolor=#ffffff>";
$query="select * from ".$table_pre."channel where deep=1 order by ord";
$res=$db->query($query);
$i=0;
while($msg=$db->fetch_array($res)){
$query1="select * from ".$table_pre."channel where path='0-".$msg["id"]."' order by ord";
$t=get_db_msg("select count(*) 'num' from ".$table_pre."channel where path='0-".$msg["id"]."'");
$t=$t["num"];
$r.="<tr><td style='background-color:#f5f5f5;height:18px'><input type=checkbox id='".$i."_main' onclick=\"check_multi(".$t.",'".$i."')\"";
if(count_priv_channel($msg["id"],$priv)==$t)
$r.=" checked";
$r.="><label for=\"".$i."_main\">".$msg[title]."</label></td></tr><tr><td>";
$res1=$db->query($query1);
$j=0;
while($msg1=$db->fetch_array($res1)){
if(trim($msg1["priv"])!=""){
$r.="&nbsp;&nbsp;<input type=hidden name=priv_id[] value=\"".$msg["id"]."-".$msg1["id"]."\">".$msg1["title"].":";
$a=explode(",",$msg1["priv"]);
for($k=0;$k<count($a);$k++){
$r.="<input type=\"radio\" name=\"priv_".$msg["id"]."_".$msg1["id"]."\" id=\"priv_".$msg["id"]."_".$msg1["id"]."_".$a[$k]."\" value=\"".$a[$k]."\"";
if($k==0)
$r.=" checked";
else if(in_array($msg["id"]."-".$msg1["id"]."|".$a[$k],$check[1]))
$r.=" checked";
$r.="><label for=\"priv_".$msg["id"]."_".$msg1["id"]."_".$a[$k]."\">".get_main_value($arr_priv_tran,$a[$k])."</label>";
}
$r.="<br>";
}else{
$r.="&nbsp;&nbsp;<input type=checkbox name=priv_id[] id=\"".$i."_".$j."\" value=\"".$msg["id"]."-".$msg1["id"]."\"";
if(in_array($msg["id"]."-".$msg1["id"],$check[0]))
$r.=" checked";
$r.="><label for=\"".$i."_".$j."\">".$msg1[title]."</label><br>";
}
$j++;
}
$r.="</td></tr>";
$i++;
}
$r.="</table>";
return $r;
}
//
function print_form_priv1($priv=''){
global $arr_priv1;
$check=explode(",",$priv);
$r="";
$i=0;
foreach($arr_priv1 as $k1 => $v1){
$r.="<input type=checkbox id='p1_".$i."' name=\"priv1_".$i."\" value=\"".$k1."\"";
if(in_array($k1,$check))
$r.=" checked";
$r.="><label for=\"p1_".$i."\">".$v1."</label> ";
$i++;
}
return $r;
}
//检查权限
function check_priv1($p,$priv){
$c=explode(",",$priv);
if(in_array($p,$c))
return true;
else
return false;
}
//
function deel_gang($str){
$str=str_replace("-","_",$str);
return $str;
}
//
function deel_0($str){
if($str==0 or $str=="0%")
$str="";
return $str;
}
//
function add_0($str){
if($str>0)
$str=$str;
else
$str="0";
return $str;
}
//
function deel_01($str){
$str=$str==""?"0":$str;
return $str;
}
//
function deel_td($str){
return $str?$str:"&nbsp;";
}
//
function split_priv_str($priv){
$tmp=explode(",",$priv);
$r=array();
for($i=0;$i<count($tmp);$i++){
$tmp1=explode('|',$tmp[$i]);
$r[0][$i]=$tmp1[0];
$r[1][$i]=$tmp[$i];
}
return $r;
}
//
function print_priv_str($priv){
global $db,$table_pre,$arr_priv_tran;
$col_priv="";
$priv1=explode(",",$priv);
for($i=0;$i<count($priv1);$i++){
$priv2=explode("|",$priv1[$i]);
$priv3=explode("-",$priv2[0]);
$msg1=get_db_msg("select * from ".$table_pre."channel where id='".$priv3[0]."'");
$msg2=get_db_msg("select * from ".$table_pre."channel where id='".$priv3[1]."'");
$col_priv.=$msg1["title"]."-&gt;".$msg2["title"];
if($priv2[1])
$col_priv.="|".get_main_value($arr_priv_tran,$priv2[1]);
$col_priv.="<br>";
}
return $col_priv;
}
//
function return_priv($cid,$priv){
global $db,$table_pre;
$mc=get_db_msg("select * from ".$table_pre."channel where id='".$cid."'");
$check=path_cut0($mc["path"]."-".$mc["id"]);
$arr=explode(",",$priv);
$r=array("n","");
for($i=0;$i<count($arr);$i++){
$arr1=explode("|",$arr[$i]);
if($check==$arr1[0]){
$r[0]="y";
$r[1]=$arr1[1];
}
}
return $r;
}
//
function set_log($action='',$remark=''){
global $db,$table_pre,$query,$uid;
$ip=$_SERVER["REMOTE_ADDR"];
$db->query("insert into ".$table_pre."log (uid,ip,action,remark,sql_value,add_date) values ('".$uid."','".$ip."','".$action."','".$remark."','".mysql_escape_string($query)."','".time()."')");
}
///////////////////////////////////////////////////////可选类别
////////////输出cate
//
function out_select_cate($form,$name,$width,$cate,$value=''){
global $db,$table_pre;
$width1=$width+18;
$width2=$width+2;
$d_value=$value;
$r="<DIV style=\"POSITION: relative\"><SPAN style=\"MARGIN-LEFT: ".$width."px; OVERFLOW: hidden; WIDTH: 18px\"> <SELECT style=\"MARGIN-LEFT: -".$width."px; WIDTH: ".$width1."px\" onchange=".$form.".".$name.".value=this.value>";
$query="select * from ".$table_pre."keyword where cate='".$cate."' order by no";
$res=$db->query($query);
$count=0;
$r.="<option value=''></option>";
while($msg=$db->fetch_array($res)){
$r.="<option value=\"".$msg[title]."\"";
if($msg[title]==$d_value)
$r.=" selected";
$r.=">".$msg[title]."</option>";
$count++;
}
$r.="</SELECT></SPAN><INPUT style=\"LEFT: 0px; WIDTH: ".$width2."px; POSITION: absolute;z-index:10000\" value=\"".$d_value."\" name=\"".$name."\"></DIV>";
return $r;
}
//
function out_select_cate1($form,$name,$width,$cate,$value=''){
global $db,$table_pre;
$width1=$width+18;
$d_value=$value;
$r="<input id=\"".$name."\" name=\"".$name."\" value=\"".$d_value."\" type=\"text\" style=\"width:".$width."px;POSITION: absolute\">
<select name=\"".$name."_s_cate\" id=\"".$name."_s_cate\" onchange=\"document.getElementById('".$name."').value=this.options[this.selectedIndex].value\" style=\"width:".$width1."px;CLIP: rect(auto auto auto ".$width."px);\">";
$query="select * from ".$table_pre."keyword where cate='".$cate."' order by no";
$res=$db->query($query);
$count=0;
$r.="<option value=''></option>";
while($msg=$db->fetch_array($res)){
$r.="<option value=\"".$msg[title]."\"";
if($msg[title]==$d_value)
$r.=" selected";
$r.=">".$msg[title]."</option>";
$count++;
}
$r.="</SELECT>";
return $r;
}
////////////更新
function update_cate($cate,$value){
global $db,$table_pre;
if(trim($value)){
$msg=get_db_msg("select count(*) 'num' from ".$table_pre."keyword where title='".$value."' and cate='".$cate."'");
if($msg[num]==0){
$tmp=get_db_msg("select max(ord) 'ord' from ".$table_pre."keyword where cate='".$cate."'");
$ord=$tmp[ord]+1;
$db->query("insert into ".$table_pre."keyword (ord,cate,title) values ('".$ord."','".$cate."','".$value."')");
}
}
}
//
function update_keyword($cate,$value){
global $db,$table_pre;
$value=trim($value);
if(trim($value)){
$msg=get_db_msg("select count(*) 'num' from ".$table_pre."keyword where title='".$value."' and cate='".$cate."'");
if($msg["num"]==0){
$tmp=get_db_msg("select max(ord) 'ord' from ".$table_pre."keyword where cate='".$cate."'");
if($tmp["ord"]>10)
$ord=$tmp[ord]+1;
else
$ord=11;
$db->query("insert into ".$table_pre."keyword (ord,cate,no,title) values ('".$ord."','".$cate."','".$ord."','".$value."')");
}
}
}
//
function update_keyword_color($code,$title){
global $db,$table_pre;
$title=trim($title);
$code=trim($code);
if($title && $code){
$msg=get_db_msg("select count(*) 'num' from ".$table_pre."keyword where title='".$title."' and no='".$code."' and cate='color'");
if($msg["num"]==0){
$tmp=get_db_msg("select max(ord) 'ord' from ".$table_pre."keyword where cate='color'");
if($tmp["ord"]>0)
$ord=$tmp[ord]+1;
else
$ord=1;
$db->query("insert into ".$table_pre."keyword (ord,cate,no,title) values ('".$ord."','color','".$code."','".$title."')");
}
}
}
////////////op
//
function op_select_cate($cate,$value=""){
global $db,$table_pre;
$r=$db->query("select * from ".$table_pre."keyword where cate='".$cate."' order by no");
$op="";
while($m=$db->fetch_array($r)){
$op.="<option value=\"".$m[title]."\"";
if($value==$m[title])
$op.=" selected";
$op.=">".$m[title]."</option>";
}
return $op;
}
//
function op_select_cate1($cate,$value=""){
global $db,$table_pre;
$r=$db->query("select * from ".$table_pre."keyword where cate='".$cate."' order by no");
$op="";
while($m=$db->fetch_array($r)){
$op.="<option value=\"".$m["no"]."\"";
if($value==$m["no"])
$op.=" selected";
$op.=">".$m["no"]."(".$m["title"].")</option>";
}
return $op;
}
//
function op_select_cate2($cate,$value=""){
global $db,$table_pre;
$r=$db->query("select * from ".$table_pre."keyword where cate='".$cate."' order by no");
$op="";
while($m=$db->fetch_array($r)){
$op.="<option value=\"".$m["no"]."\"";
if($value==$m["no"])
$op.=" selected";
$op.=">".$m["title"]."</option>";
}
return $op;
}
//
function op_select_cate3($cate,$value=""){
global $db,$table_pre;
$r=$db->query("select * from ".$table_pre."keyword where cate='".$cate."' order by no");
$op="";
while($m=$db->fetch_array($r)){
$op.="<option value=\"".$m["no"]."\"";
if($value==$m["no"])
$op.=" selected";
$op.=">".$m["title"]."(".$m["no"].")</option>";
}
return $op;
}
//
function get_cate_title_no($cate,$value){
global $db,$table_pre;
$m=get_db_msg("select * from ".$table_pre."keyword where cate='".$cate."' and no='".$value."' limit 0,1");
$r=trim($m["title"])?trim($m["title"]):$value;
return $r;
}
//
function arr_select($cate,$col1="no",$col2="title"){
global $db,$table_pre;
$r=$db->query("select * from ".$table_pre."keyword where cate='".$cate."' order by no");
$arr=array();
while($m=$db->fetch_array($r)){
$arr[$m[$col1]]=$m[$col2];
}
return $arr;
}
///////////////////////////////////////////////////////编辑器分页
//
function get_text_content($text,$page){
$arr=explode("<P>{:newpage:}</P>",$text);
return $arr[$page];
}
//
function get_text_page($text,$page){
global $id;
$arr=explode("<P>{:newpage:}</P>",$text);
$total=count($arr);
$r="";
if($total>1){
if($page>0)
$r.=" <a href=\"".$_SERVER[PHP_SELF]."?id=".$id."&page=".($page-1)."\">上一页</a> ";
for($i=0;$i<$total;$i++){
$list=$i+1;
if($i==$page){
$r.=" [".$list."] ";
}else{
$r.=" <a href=\"".$_SERVER[PHP_SELF]."?id=".$id."&page=".$i."\">[".$list."]</a> ";
}
}
if($page!=$total-1)
$r.=" <a href=\"".$_SERVER[PHP_SELF]."?id=".$id."&page=".($page+1)."\">下一页</a> ";
}
return $r;
}
///////////////////////////////////////////////////////模板相关
//取得tmpl模板
function template($tpl){
$tpl=THIS_FILE_ROOT."/template/".$tpl.".php";
if(is_file($tpl)){
return $tpl;
}else{
exit("找不到相关模板(".$tpl.")!");
}
}
//
function tmpl($tpl){
$tpl=THIS_FILE_ROOT."/tmpl/".$tpl.".php";
if(is_file($tpl)){
return $tpl;
}else{
exit("找不到相关模板(".$tpl.")!");
}
}
//
function _include($inc){
$inc=THIS_FILE_ROOT."/inc/".$inc.".php";
if(is_file($inc)){
return $inc;
}else{
exit("找不到相关模块(".$inc.")!");
}
}
///////////////////////////////////////////////////////数组
function arr_push($arr,$num){
$r=array();
$i=0;
if($num>0){
foreach($arr as $k => $v){
if($i<=$num){
$r[$k]=$v;
}
$i++;
}
}else{
foreach($arr as $k => $v){
if($i>=abs($num)){
$r[$k]=$v;
}
$i++;
}
}
return $r;
}
//
function arr_minus($arr,$v){
$r=array();
for($i=0,$j=0;$i<count($arr);$i++){
if($arr[$i]!=$v){
$r[$j]=$arr[$i];
$j++;
}
}
return $r;
}
//
function arr_part($arr,$arr_ind){
$r=array();
foreach($arr as $key => $value){
if(in_array($key,$arr_ind))
$r[$key]=$value;
}
return $r;
}
//
function arr_str_minus($str,$v){
$r="";
$arr=explode(",",$str);
for($i=0;$i<count($arr);$i++){
if($arr[$i]!=$v){
$r.=$arr[$i].",";
}
}
if($r)
$r=substr($r,0,-1);
return $r;
}
//
function arr_to_str($arr){
$r="";
for($i=0;$i<count($arr);$i++){
$r.=$arr[$i].",";
}
$r=substr($r,0,-1);
return $r;
}
//
function arr_last_key($arr){
$r="";
if(!is_array($arr))
return;
$i=0;
$len=count($arr);
foreach($arr as $key => $value){
if($i==$len-1)
$r=$key;
$i++;
}
return $r;
}
//
function get_main_radio($arr,$name,$v='',$fuc=''){
$op="";
if(!is_array($arr))
return;
$i=1;
foreach($arr as $key => $value){
$op.="<input type='radio' name='".$name."' id='".$name."_".$i."' value='".$key."'".$fuc."";
if($v==$key)
$op.=" checked";
$op.="><label for='".$name."_".$i."'>".$value."</label> ";
$i++;
}
return $op;
}
//
function get_main_radio2($arr,$num,$name,$v='',$fuc=''){
$op="";
if(!is_array($arr))
return;
if($num>0){
$i=1;
foreach($arr as $key => $value){
if($i<=$num){
$op.="<input type='radio' name='".$name."' id='".$name."_".$i."' value='".$key."'".$fuc."";
if($v==$key)
$op.=" checked";
$op.="><label for='".$name."_".$i."'>".$value."</label> ";
}
$i++;
}
}else{
$i=1;
foreach($arr as $key => $value){
if($i>=abs($num)){
$op.="<input type='radio' name='".$name."' id='".$name."_".$i."' value='".$key."'".$fuc."";
if($v==$key)
$op.=" checked";
$op.="><label for='".$name."_".$i."'>".$value."</label> ";
}
$i++;
}
}
return $op;
}
//
function get_main_checkbox($arr,$name,$v='',$fuc=''){
$op="";
if(!is_array($arr))
return;
$i=1;
$check=explode(",",$v);
foreach($arr as $key => $value){
$op.="<input type=\"checkbox\" name=\"".$name."[]\" id=\"".$name."_".$i."\" value=\"".$key."\"".$fuc."";
if(in_array($key,$check))
$op.=" checked";
$op.="><label for='".$name."_".$i."'>".$value."</label> ";
$i++;
}
return $op;
}
//
function get_main_radio1($arr,$name,$v='',$fuc=''){
$op="";
if(!is_array($arr))
return;
$i=1;
foreach($arr as $key => $value){
$op.="<input type='radio' name='".$name."' id='".$name."_".$i."' value='".$value."'".$fuc."";
if($v==$key)
$op.=" checked";
$op.="><label for='".$name."_".$i."'>".$value."</label> ";
$i++;
}
return $op;
}
//
function get_main_op($arr,$v=''){
$op="";
if(!is_array($arr))
return;
foreach($arr as $key => $value){
$op.="<option value='".$key."'";
if($v==$key)
$op.=" selected";
$op.=">".$value."</option>";
}
return $op;
}
//
function get_main_op1($arr,$v=''){
$op="";
if(!is_array($arr))
return;
foreach($arr as $key => $value){
$op.="<option value='".$key."'";
if($v==$key)
$op.=" selected";
$op.=">".$key."(".$value.")</option>";
}
return $op;
}
//
function get_main_op2($arr,$v,$v1='',$v2=''){
$op="";
if(!is_array($arr))
return;
foreach($arr as $key => $value){
$op.="<option value='".$key."'";
if($v==$key)
$op.=" selected";
$op.=">".$v1.$value.$v2."</option>";
}
return $op;
}
//
function get_op_num($num1,$num2,$v=''){
$op="";
for($i=$num1;$i<=$num2;$i++){
$op.="<option value='".$i."'";
if($v==$i)
$op.=" selected";
$op.=">".$i."</option>";
}
return $op;
}
//
function reverse_array($arr){
if(!is_array($arr))
return;
$r=array();
foreach($arr as $key => $value){
$r[$value]=$key;
}
return $r;
}
//
function get_main_value($arr,$k){
if(!is_array($arr))
return;
foreach($arr as $key => $value){
if($key==$k)
return $value;
}
return $k;
}
//
function get_main_value_arr($arr,$str){
if(!is_array($arr))
return;
$tmp=explode(",",$str);
$r="";
for($i=0;$i<count($tmp);$i++){
$r.=get_main_value($arr,$tmp[$i]).",";
}
if($r)
$r=substr($r,0,-1);
return $r;
}
//
function get_main_key($arr,$v){
if(!is_array($arr))
return;
foreach($arr as $key => $value){
if($value==$v)
return $key;
}
return $v;
}
//
function get_main_key1($arr,$v){
for($i=0;$i<count($arr);$i++){
if($arr[$i]==$v)
return $i;
}
return 0;
}
//
function get_key($arr){
if(!is_array($arr))
return;
$arr1=array();
foreach($arr as $key => $value){
$arr1[]=$key;
}
return $arr1;
}
///////////////////////////////////////////////////////远程操作
function get_from_url($url){
$fp=@fopen($url,"r");
if($fp){
while($buffer=fread($fp,1024)){
$content.=$buffer;
}
return $content;
}else{
return false;
}
}
///////////////////////////////////////////////////////ajax
//执行
function ajax_do($url,$method='GET',$arr_success_js=''){
$str="<script>
var xmlhttp=ajaxinit();
var url=\"".$url."\";
xmlhttp.open(\"".$method."\",url,true);
xmlhttp.setRequestHeader(\"Cache-Control\",\"no-cache\");
xmlhttp.onreadystatechange=function(){
if(xmlhttp.readyState==4 && xmlhttp.status==200){
//alert(xmlhttp.responseText);
".$arr_success_js."
}
}
xmlhttp.send(null);
</script>";
return $str;
}
///////////////////////////////////////////////////////其他
//
function get_sex_op($value=1){
global $arr_gender;
$r="";
foreach($arr_gender as $k => $v){
$r.=" <input type=radio name=gender value=\"".$k."\"";
if($k==$value)
$r.=" checked";
$r.=">".$v;
}
return $r;
}
//输出比例图片
function out_good_pic($pic,$width,$height,$property=''){
if(is_file($pic))
$wh=GetImageSize($pic);
else
return "<img src=\"images/blank.gif\" border=\"0\" width=\"".$width."\" height=\"".$height."\" ".$property.">";
$tmp="";
if($width<$wh[0] || $height<$wh[1]){
if(($wh[0]/$width)>($wh[1]/$height))
$tmp=" width=\"".$width."\"";
else
$tmp=" height=\"".$height."\"";
}
return "<img src=\"".$pic."\"".$tmp." border=\"0\" ".$property.">";
}
//
function check_cookie(){
$login_uid=$_COOKIE[THIS_COOKIE];
if($login_uid>0){
return $login_uid;
}else{
url_redirect("./?manage=y");
exit();
}
}
//
function check_cookie_jxs(){
$login_uid=$_COOKIE["izzen_2011w_jxs"];
if($login_uid>0){
return $login_uid;
}else{
url_redirect("./");
exit();
}
}
//
function get_video_url($v){
$max_video_link=200;
$v=explode("\n",$v);
return $v[0];
}
//
function out_answer($type,$answer){
$arr_new_answer=array("y"=>"","n"=>"");
if($type=="1")
$r=get_main_value($arr_new_answer,$answer);
else
$r=$answer;
return $r;
}
//
function format_time_minute($t){
$r=$t?$t."分钟":"--";
return $r;
}
//
function format_num($num){
$num=$num+1-1;
return $num;
}
//取得订单数量
function get_order_num($id,$color,$bx,$size){
global $uid,$db,$table_pre,$_key;
$tmp1=get_db_msg("select * from ".$table_pre."order where _key='".$_key."' and uid='".$uid."' and iid='".$id."' and color='".$color."' and bx='".$bx."'");
$r=$tmp1["num_".strtolower($size)];
$r=$r>0?$r:"";
return $r;
}
//尺码sql脚本
function get_size_sql($t){
global $sys_size_num;
$r="";
switch($t){
case "sum";
for($s1=1;$s1<=$sys_size_num;$s1++){
$r.="num_".$s1."+";
}
if($r)
$r=substr($r,0,-1);
break;
case "suma";
for($s1=1;$s1<=$sys_size_num;$s1++){
$r.="a.num_".$s1."+";
}
if($r)
$r=substr($r,0,-1);
break;
case "sum1";
for($s1=1;$s1<=$sys_size_num;$s1++){
$r.="sum(num_".$s1.") 'num_".$s1."',";
}
if($r)
$r=substr($r,0,-1);
break;
case "update":
for($s1=1;$s1<=$sys_size_num;$s1++){
$v1="num_".$s1;
global $$v1;
$r.=$v1."='".$$v1."',";
}
if($r)
$r=substr($r,0,-1);
break;
case "insert1":
for($s1=1;$s1<=$sys_size_num;$s1++){
$r.="num_".$s1.",";
}
if($r)
$r=substr($r,0,-1);
break;
case "inserta":
for($s1=1;$s1<=$sys_size_num;$s1++){
$r.="a.num_".$s1.",";
}
if($r)
$r=substr($r,0,-1);
break;
case "insert2":
for($s1=1;$s1<=$sys_size_num;$s1++){
$v1="num_".$s1;
global $$v1;
$r.="'".$$v1."',";
}
if($r)
$r=substr($r,0,-1);
break;
case "count_total":
$r=0;
for($s1=1;$s1<=$sys_size_num;$s1++){
$v1="num_".$s1;
global $$v1;
$r+=$$v1;
}
break;
}
return $r;
}
//颜色,尺码sql
function get_color_size_sql($t,$color,$size_arr){
$r="";
switch($t){
case "update":
$k=1;
for($s1=0;$s1<count($size_arr);$s1++){
$v2="num_".$k;
$v1="num_".$color."_".$size_arr[$s1];
global $$v1;
$r.=$v2."='".$$v1."',";
$k++;
}
if($r)
$r=substr($r,0,-1);
break;
}
return $r;
}
//取得款号订单数量
function get_order_num_kh($id){
global $uid,$db,$table_pre;
$r=0;
$tmp1=get_db_msg("select sum(".get_size_sql("sum").") 'num' from ".$table_pre."order where uid='".$uid."' and iid='".$id."'");
$r=$tmp1["num"];
if($r>0)
return $r;
else
return ;
}
//
function get_set($k){
global $db,$table_pre;
$m=get_db_msg("select * from ".$table_pre."set where _k='".$k."'");
if($m["id"]>0)
return $m["_v"];
else
return "";
}
//
function get_set_title($k,$v){
global $db,$table_pre;
$r="";
$m=get_db_msg("select * from ".$table_pre."set where _k='".$k."'");
$tmp=explode(",",$m["_t1"]);
for($i=0;$i<count($tmp);$i++){
$tmp1=explode("|",$tmp[$i]);
if($tmp1[0]==$v)
$r=$tmp1[1];
}
return $r;
}
//
function deel_color($c){
if($c){
$arr=explode(",",$c);
$b="";
for($i=0;$i<count($arr);$i++){
$arr1=explode("-",$arr[$i]);
$b.=$arr1[0].",";
}
if($b)
$b=substr($b,0,-1);
return $b;
}else{
return;
}
}
//
function show_color($c){
global $table_pre,$db;
if($c){
$arr=explode(",",$c);
$b="";
for($i=0;$i<count($arr);$i++){
$arr1=get_cate_title_no("color",$arr[$i]);
$b.=$arr[$i]."-".$arr1.",";
}
if($b)
$b=substr($b,0,-1);
return $b;
}else{
return;
}
}
//
function get_num_je_size($s,$s_group_id){
global $table_pre,$db,$con,$s_key;
$s=strtolower($s);
$m1=get_db_msg("select sum(num_".$s.") 'num',sum(num_".$s."*price) 'je' from ".$table_pre."order where _key='".$s_key."' and size_group_id='".$s_group_id."' ".$con);
return array($m1["num"],$m1["je"]);
}
//
function get_num_je_size_category($s,$no){
global $table_pre,$db,$con,$s_key;
$s=strtolower($s);
$m1=get_db_msg("select sum(num_".$s.") 'num',sum(num_".$s."*price) 'je' from ".$table_pre."order where _key='".$s_key."' and category='".$no."' ".$con);
return array($m1["num"],$m1["je"]);
}
//
function get_num_size($s){
global $table_pre,$db,$uid,$s_key;
$je=0;
$s=strtolower($s);
$m1=get_db_msg("select sum(num_".$s.") 'num' from ".$table_pre."order where uid='".$uid."' and ka<>'y' and _key='".$s_key."'");
return $m1["num"];
}
//
function get_num_color($iid,$color){
global $table_pre,$db,$_key;
$je=0;
$s=strtolower($s);
$m1=get_db_msg("select sum(".get_size_sql("sum").") 'num' from ".$table_pre."order where iid='".$iid."' and color='".$color."' and _key='".$_key."'");
return $m1["num"]>0?$m1["num"]:"0";
}
//
function get_num_client($iid,$uid){
global $table_pre,$db,$_key;
$m1=get_db_msg("select count(distinct uid) 'num' from ".$table_pre."order where iid='".$iid."' and _key='".$_key."'");
return $m1["num"]>0?$m1["num"]:"0";
}
//
function get_kh_picture($no,$main_pic,$color){
$pic="";
if(trim($main_pic)){
$pic="../attachments/design/mini/".$no."_".$main_pic.".jpg";
}
if(!is_file($pic)){
$pic="../attachments/design/mini/".$no.".jpg";
}
if(!is_file($pic)){
$tmp=explode(",",$color);
for($j=0;$j<count($tmp);$j++){
$pic="../attachments/design/mini/".$no."_".$tmp[$j].".jpg";
if(is_file($pic))
break;
}
}
if(!is_file($pic)){
$pic="images/no_pic_80.gif";
}
return $pic;
}
//
function get_kh_color_picture($no,$c){
$pic="../attachments/design/mini/".$no."_".$c.".jpg";
if(!is_file($pic))
$pic="../attachments/design/mini/".$no.".jpg";
if(!is_file($pic))
$pic="images/no_pic_80.gif";
return $pic;
}
//
function get_kh_color_picture_big($no,$c){
$pic="../attachments/design/big/".$no."_".$c.".jpg";
if(!is_file($pic))
$pic="../attachments/design/big/".$no.".jpg";
if(!is_file($pic))
$pic="images/no_pic_big.gif";
return $pic;
}
//
function get_kh_picture_big($no,$main_pic,$color){
$pic="";
if(trim($main_pic)){
$pic="../attachments/design/big/".$no."_".$main_pic.".jpg";
}
if(!is_file($pic)){
$pic="../attachments/design/big/".$no.".jpg";
}
if(!is_file($pic)){
$tmp=explode(",",$color);
for($j=0;$j<count($tmp);$j++){
$pic="../attachments/design/big/".$no."_".$tmp[$j].".jpg";
if(is_file($pic))
break;
}
}
if(!is_file($pic)){
$pic="images/no_pic_big.gif";
}
return $pic;
}
//
function get_kh_dp_big($dph){
$pic="../attachments/dp/big/".$dph.".jpg";
if(!is_file($pic)){
$pic="images/no_pic_big.gif";
}
return $pic;
}
//
function get_kh_dp_mini($dph){
$pic="../attachments/dp/mini/".$dph.".jpg";
if(!is_file($pic)){
$pic="images/no_pic_80.gif";
}
return $pic;
}
//
function get_kh_cl_big($clh){
$pic="../attachments/cl/big/".$clh.".jpg";
if(!is_file($pic)){
$pic="images/no_pic_big.gif";
}
return $pic;
}
//
function get_kh_cl_mini($clh){
$pic="../attachments/cl/mini/".$clh.".jpg";
if(!is_file($pic)){
$pic="images/no_pic_80.gif";
}
return $pic;
}
//
function get_size_merged(){
global $table_pre,$db;
$arr_size_merged=array();
$r1=$db->query("select no from ".$table_pre."size group by no order by no");
while($m1=$db->fetch_array($r1)){
$arr_size_merged[]=$m1["no"];
}
return $arr_size_merged;
}
//
//判断是否买断
function check_md($kh,$color,$bx,$size){
global $db,$table_pre;
$r="n";
$check=get_db_msg("select count(*) 'num' from ".$table_pre."kh_md");
if($check["num"]>0){
//买断款
$check=get_db_msg("select id,price from ".$table_pre."kh_md where kh='".$kh."' and color='' and bx='' and size=''");
if($check["id"]>0)
return $check["price"];
//买断颜色
$check=get_db_msg("select id,price from ".$table_pre."kh_md where kh='".$kh."' and color='".$color."' and bx='' and size=''");
if($check["id"]>0)
return $check["price"];
//买断杯型
$check=get_db_msg("select id,price from ".$table_pre."kh_md where kh='".$kh."' and color='".$color."' and bx='".$bx."' and size=''");
if($check["id"]>0)
return $check["price"];
//买断尺码
$check=get_db_msg("select id,price,size from ".$table_pre."kh_md where kh='".$kh."' and color='".$color."' and bx='".$bx."'");
if($check["id"]>0){
$arr1=explode(",",$check["size"]);
if(in_array($size,$arr1))
return $check["price"];
}
}
return $r;
}
//根据款号,取得结算价
function get_price_zk($id,$uid){
global $db,$table_pre,$zk_type;
$msg_login=get_db_msg("select * from ".$table_pre."client where id='".$uid."'");
$m1=get_db_msg("select * from ".$table_pre."kh where id='".$id."'");
$zk1=100;
$price_zk=$m1["price"];
if(trim($zk_type)){
if($zk_type=="y1"){
$zk=$msg_login["zk"];
$zk1=($zk>0)?$zk:$zk1;
$price_zk=$m1["price"]*$zk1/100;
}else if($zk_type=="y2"){
$zk=get_zk($msg_login["id"],$m1["category"]);
$zk1=($zk>0)?$zk:$zk1;
$price_zk=$m1["price"]*$zk1/100;
}else if($zk_type=="kh"){
$price_zk=$m1["price_zk"]>0?$m1["price_zk"]:$price_zk;
}
}
return $price_zk;
}
//缓存订单表的数量和金额
function cache_order($uid,$khid,$color,$bx){
global $db,$table_pre,$zk_type,$bx_sizegroup_title;
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;
}
$m=get_db_msg("select ".get_size_sql("sum")." 'num',price,color,bx,upath,id,".get_size_sql("insert1")." from ".$table_pre."order where uid='".$uid."' and iid='".$khid."' and color='".$color."' and bx='".$bx."'");
if($m["id"]>0){
//
$num=$m["num"];
$je=$num*$m["price"];
//------计算结算金额
$jsje=$jsje_dl=$mdje=0;
$m_kh=get_db_msg("select * from ".$table_pre."kh where id='".$khid."'");
//取得杯型
if($m_kh["size_group"]==$bx_sizegroup_id){
$tmp=get_db_msg("select size from ".$table_pre."size_bx where no='".$m_kh["no"]."' and bx='".$bx."'");
$arr_size=explode(",",$tmp["size"]);
}else{
$arr_size=explode(",",$m_kh["size"]);
}
//
$dl_uid=get_dl_id($m["upath"]);
$qy_uid=get_qy_id($m["upath"]);
for($i=0;$i<count($arr_size);$i++){
$num_tmp=$m["num_".$arr_size[$i]];
$price_md=check_md($m_kh["no"],$m["color"],$bx,$arr_size[$i]);
$price_zk=get_price_zk($khid,$uid);
//代理商结算金额
if($dl_uid>0){
$price_zk_dl=get_price_zk($khid,$dl_uid);
$price_zk_dl=$price_zk_dl>0?$price_zk_dl:$price_zk;
}
if($price_md!="n"){
$price_zk1=$price_md>0?$price_md:$price_zk;
$price_zk1_dl=$price_md>0?$price_md:$price_zk_dl;
$mdje+=$num_tmp*$price_zk1;
}else{
$price_zk1=$price_zk;
$price_zk1_dl=$price_zk_dl;
}
$jsje+=$num_tmp*$price_zk1;
$jsje_dl+=$num_tmp*$price_zk1_dl;
}
$q1="update ".$table_pre."order set num='".$num."',je='".$je."',jsje='".$jsje."',jsje_dl='".$jsje_dl."',mdje='".$mdje."',qy='".$qy_uid."',dl='".$dl_uid."' where id='".$m["id"]."'";
//echo $q1."---<br>";
$db->query($q1);
}
}
//
function set_order_total($uid){
global $db,$table_pre,$_key;
$order_num=$order_num1=0;
$order_money=$order_money_zk=$order_money1=$order_money1_zk=$order_money_md=0;
$m1=get_db_msg("select id,path,face from ".$table_pre."client where id='".$uid."'");
if($m1["face"]=="3"){
$jsje_title="jsje_dl";
$con_uid="upath like '".$m1["path"]."-".$m1["id"]."-%'";
}else if($m1["face"]=="4"){
$jsje_title="jsje";
$con_uid="uid='".$uid."'";
}else{
$jsje_title="jsje";
$con_uid="upath like '".$m1["path"]."-".$m1["id"]."-%'";
}
//所有
$tmp=get_db_msg("select sum(num) 'num',sum(je) 'je',sum(".$jsje_title.") 'jsje',sum(mdje) 'mdje' from ".$table_pre."order where ka<>'y' and ".$con_uid);
$order_num=$tmp["num"];
$order_money=$tmp["je"];
$order_money_zk=$tmp["jsje"];
$order_money_md=$tmp["mdje"];
//成衣
$tmp=get_db_msg("select sum(num) 'num',sum(je) 'je',sum(".$jsje_title.") 'jsje' from ".$table_pre."order where ka<>'y' and ".$con_uid." and is_sp<>'y'");
$order_num1=$tmp["num"];
$order_money1=$tmp["je"];
$order_money1_zk=$tmp["jsje"];
$db->query("update ".$table_pre."client set order_num='".$order_num."',order_num1='".$order_num1."',order_money='".$order_money."',order_money_zk='".$order_money_zk."',order_money1='".$order_money1."',order_money1_zk='".$order_money1_zk."',order_money_md='".$order_money_md."' where id='".$uid."'");
}
//
function set_order_total_all(){
global $db,$table_pre,$_key;
$q="select * from ".$table_pre."client where face='4'";
$r=$db->query($q);
while($m=$db->fetch_array($r)){
set_order_total($m["id"]);
}
}
//
function get_jgd($price){
global $db,$table_pre;
$re="";
$q="select * from ".$table_pre."keyword where cate='jgd' order by no";
$r=$db->query($q);
while($m=$db->fetch_array($r)){
if(check_jgd($price,$m["title"])){
$re=$m["no"];
}
}
return $re;
}
//
function check_jgd($price,$jgd){
$r=false;
if(strpos($jgd,"以下")){
$p=str_replace("以下","",$jgd);
if($price<$p)
$r=true;
}else if(strpos($jgd,"以上")){
$p=str_replace("以上","",$jgd);
if($price>$p)
$r=true;
}else if(strpos($jgd,"-")){
$p=explode("-",$jgd);
if($price>=$p[0] && $price<=$p[1])
$r=true;
}
return $r;
}
//
function get_client_autocompelete($face='',$face2='',$str_path='',$show_all='y',$face3=''){
global $db,$table_pre;
$str="var clients = [\n";
if($show_all=="y")
$str.="{id:\"all\",t:\"-所有客户-\",u:\"_all_\",p:\"0\"},\n";
//$con=$face?" where face='".$face."'":"";
if($face!="" && $face2 ==""){
$con="where face='".$face."'";
}else if($face=="" && $face2 !=""){
$con="where face='".$face2."'";
}else if($face!="" && $face2 !=""){
$con="where (face='".$face."' or face='".$face2."')";
}else{
$con="";
}
if($face3==3){
$con2=$str_path?" and (path='".$str_path."' or path like '".$str_path."-%')":"";
}else{
$con2=$str_path?" and id='".$str_path."'":"";
}
$q="select id,title,username,path,CONCAT(path,'-',id) 'abs_path' from ".$table_pre."client ".$con.$con2." order by abs_path";
$r=$db->query($q);
$i=0;
while($m=$db->fetch_array($r)){
$str.="{id:\"".$m["id"]."\",t:\"".$m["title"]."\",u:\"".$m["username"]."\",p:\"".$m["path"]."-".$m["id"]."\"},\n";
$i++;
}
if($i>0)
$str=substr($str,0,-2);
$str.="];\n";
return $str;
}
//取得总指标单位
function get_zb_dw($zb_type){
if($zb_type=="js"){
$dw="";
}else{
$dw="";
}
return $dw;
}
//更新指标
function update_zb($cid,$season,$bc,$series,$category,$category1,$num){
global $db,$table_pre,$zbxf;
switch($zbxf){
case "category":
case "category1":
case "season":
case "bc":
$c=get_db_msg("select * from ".$table_pre."client_zb where cid='".$cid."' and ".$zbxf."='".$$zbxf."' limit 0,1");
if($c["id"]>0){
$q1="update ".$table_pre."client_zb set num='".$num."' where id='".$c["id"]."'";
$db->query($q1);
//删除多余记录
$db->query("delete from ".$table_pre."client_zb where id<>'".$c["id"]."' and cid='".$cid."' and ".$zbxf."='".$$zbxf."'");
}else{
$q1="insert into ".$table_pre."client_zb (cid,".$zbxf.",num) values ('".$cid."','".$$zbxf."','".$num."')";
$db->query($q1);
}
//echo $q1."<br>";
break;
case "season_category1":
case "season_category":
case "bc_category1":
case "bc_category":
case "series_category":
case "series_category":
$tmp=explode("_",$zbxf);
$xfzb1=$tmp[0];
$xfzb2=$tmp[1];
$c=get_db_msg("select * from ".$table_pre."client_zb where cid='".$cid."' and ".$xfzb2."='".$$xfzb2."' and ".$xfzb1."='".$$xfzb1."' limit 0,1");
if($c["id"]>0){
$q1="update ".$table_pre."client_zb set num='".$num."' where id='".$c["id"]."'";
$db->query($q1);
//删除多余记录
$db->query("delete from ".$table_pre."client_zb where id<>'".$c["id"]."' and cid='".$cid."' and ".$xfzb2."='".$$xfzb2."' and ".$xfzb1."='".$$xfzb1."'");
}else{
$q1="insert into ".$table_pre."client_zb (cid,".$xfzb1.",".$xfzb2.",num) values ('".$cid."','".$$xfzb1."','".$$xfzb2."','".$num."')";
$db->query($q1);
}
break;
}
}
//取得指标
function get_zb($cid,$season,$bc,$series,$category,$category1){
global $db,$table_pre,$zbxf;
$con="";
if($season)
$con.=" and season='".$season."'";
if($bc)
$con.=" and bc='".$bc."'";
if($series)
$con.=" and series='".$series."'";
if($category)
$con.=" and category='".$category."'";
if($category1)
$con.=" and category1='".$category1."'";
$m=get_db_msg("select * from ".$table_pre."client_zb where cid='".$cid."'".$con."order by id limit 0,1");
$r=$m["num"];
return $r;
}
//取得折扣
function get_zk($cid,$category){
global $db,$table_pre;
$zk=100;
$tmp=get_db_msg("select zk from ".$table_pre."client_zk where cid='".$cid."' and category='".$category."'");
if($tmp["zk"]>0)
$zk=$tmp["zk"];
return $zk;
}
//更新折扣
function update_zk($cid,$no,$num){
global $db,$table_pre,$zkxf;
switch($zkxf){
case "category":
$c=get_db_msg("select * from ".$table_pre."client_zk where cid='".$cid."' and ".$zkxf."='".$no."' limit 0,1");
if($c["id"]>0){
$q1="update ".$table_pre."client_zk set zk='".$num."' where id='".$c["id"]."'";
$db->query($q1);
//删除多余记录
$db->query("delete from ".$table_pre."client_zk where id<>'".$c["id"]."' and cid='".$cid."' and ".$zkxf."='".$no."'");
}else{
$q1="insert into ".$table_pre."client_zk (cid,".$zkxf.",zk) values ('".$cid."','".$no."','".$num."')";
$db->query($q1);
}
//echo $q1."<br>";
break;
}
}
//
function check_arr_select_show($no){
global $db,$table_pre;
$check=get_db_msg("select * from ".$table_pre."keyword where cate='arr_select' and no='".$no."'");
if($check["flag_ka"]=="y")
return true;
else
return false;
}
//更新服务器的连接数
function cache_servers_num(){
global $db,$table_pre;
$q="select * from ".$table_pre."servers";
$r=$db->query($q);
while($m=$db->fetch_array($r)){
$tmp=get_db_msg("select count(*) 'num' from ".$table_pre."servers_online where server_ip='".$m["ip"]."'");
$db->query("update ".$table_pre."servers set num='".$tmp["num"]."' where id='".$m["id"]."'");
}
}
//取得款号的序号,当序号到色或者到款都支持
function get_kh_xh($msg){
global $db,$table_pre,$xh_ms;
if($xh_ms=="2"){
//到色
$m1=get_db_msg("select * from ".$table_pre."kh_xh where kh='".$msg["no"]."' limit 0,1");
if($m1["id"]>0)
$xh=$m1["xh"];
else
$xh=$msg["xh"];
}else{
//到款
$xh=$msg["xh"];
}
return $xh;
}
//处理杯型
function deel_bx($bx){
global $arr_bx;
$bx=strtoupper(trim($bx));
if(in_array($bx,$arr_bx)){
$r=$bx;
}else{
$r="";
}
return $r;
}
//取得上级区域
function get_qy_id($path){
global $db,$table_pre;
$arr_path=explode("-",$path);
for($i=count($arr_path)-1;$i>=0;$i--){
if($arr_path[$i]>0){
$m1=get_db_msg("select id,face from ".$table_pre."client where id='".$arr_path[$i]."'");
if($m1["face"]=="9"){
return $m1["id"];
}
}
}
return "";
}
//取得上级代理
function get_dl_id($path){
global $db,$table_pre;
$arr_path=explode("-",$path);
for($i=count($arr_path)-1;$i>=0;$i--){
if($arr_path[$i]>0){
$m1=get_db_msg("select id,face from ".$table_pre."client where id='".$arr_path[$i]."'");
if($m1["face"]=="3"){
return $m1["id"];
}
}
}
return "";
}
function is_ggk($khid){
global $db,$table_pre,$is_gg;
$r="n";
if($is_gg=="y"){
if(check_table_exist($table_pre."kh_gg")=="y"){
$check_gg=get_db_msg("select count(*) 'num' from ".$table_pre."kh_gg where iid='".$khid."'");
if($check_gg["num"]>0){
$r="y";
}
}
}
return $r;
}
//检查表是否存在
function check_table_exist($t){
global $db,$table_pre,$dbname;
$check=get_db_msg("select count(*) 'num' from information_schema.TABLES where TABLE_SCHEMA='".$dbname."' and TABLE_NAME='".$t."'");
if($check["num"]>0)
return "y";
else
return "n";
}
function get_sx($color){
global $table_pre,$db;
$q="select * from ".$table_pre."sx";
$r=$db->query($q);
while($m=$db->fetch_array($r)){
$arr=explode(",",$m["_v"]);
for($i=0;$i<count($arr);$i++){
if($arr[$i]==$color)
return $m["no"];
}
}
return "";
}
//计算排行表
function count_ph($uid,$iid,$color){
global $db,$table_pre;
$c1=get_db_msg("select count(*) 'num' from ".$table_pre."ph");
if($c1["num"]==0)
cache_ph_first();
$m_kh=get_db_msg("select * from ".$table_pre."kh where id='".$iid."'");
$m_client=get_db_msg("select path,username,in_ph from ".$table_pre."client where id='".$uid."'");
if($m_kh["in_ph"]=="y" && $m_client["in_ph"]=="y"){
$qy_id=get_qy_id($m_client["path"]);
//取得选项
$arr_select_no=array();
$sql1=$sql2="";
$q1="select no from ".$table_pre."keyword where cate='arr_select' and flag_ka='y' and no<>'sx' 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)){
$sql1.=$m1["no"].",";
$sql2.="'".$m_kh[$m1["no"]]."',";
}
//
$check=get_db_msg("select * from ".$table_pre."ph where qy='".$qy_id."' and iid='".$iid."' and color='".$color."'");
//
$m1=get_db_msg("select sum(num) 'num',sum(je) 'je' from ".$table_pre."order where qy='".$qy_id."' and iid='".$iid."' and color='".$color."' group by qy,iid,color");
//
if($check["id"]>0){
if($m1["num"]==0)
$q="delete from ".$table_pre."ph where id='".$check["id"]."'";
else
$q="update ".$table_pre."ph set num='".$m1["num"]."',je='".$m1["je"]."' where id='".$check["id"]."'";
}else{
if($m1["num"]>0)
$q="insert into ".$table_pre."ph (iid,qy,no,color,".$sql1."num,je) values ('".$iid."','".$qy_id."','".$m_kh["no"]."','".$color."',".$sql2."'".$m1["num"]."','".$m1["je"]."')";
}
if($q)
$db->query($q);
}
}
function update_log_hd(){
global $db,$table_pre,$hd_face,$arr_log_hd_action_in,$_m,$_a,$uid,$s_tab,$id,$khid,$khid,$log_hd_old_num,$log_hd_num,$s_is_ordered,$is_hd_log;
//
if($is_hd_log=="n")
return false;
//取得订货模式
$m1=get_db_msg("select _t1 from ".$table_pre."set where _k='sys_ms'");
$sys_ms1=$m1["_t1"];
$arr_ms1=explode(",",$sys_ms1);
$arr_ms2=array();
$default_ms="";
for($i=0;$i<count($arr_ms1);$i++){
$arr_tmp=explode("|",$arr_ms1[$i]);
if($i==0)
$default_ms=$arr_tmp[1];
$arr_ms2[$arr_tmp[0]]=$arr_tmp[1];
}
$log_hd_ms=$_COOKIE["sys_ms"]?get_main_value($arr_ms2,$_COOKIE["sys_ms"]):$default_ms;
//
$ip=$_SERVER["REMOTE_ADDR"];
$add_date=date("Y-m-d H:i:s");
$action=0;
$iid=0;
$num=0;
if($_m=="main_4"){
//店铺界面
}else if($_m=="order_single"){
//订单界面
$iid=$id;
if($_a=="save"){
$num=abs($log_hd_num);
if($log_hd_old_num+$log_hd_num==0){
$action=24;
}else{
if($log_hd_num>0){
if($log_hd_old_num>0)
$action=23;
else
$action=21;
}else if($log_hd_num<0){
$action=22;
}
}
}else if($_a=="del"){
$num=$log_hd_num;
$action=24;
}
}else if($_m=="dp_single"){
global $log_hd_old_num_kh;
//搭配订单界面
$iid=$khid;
if($_a=="save"){
$num=abs($log_hd_num);
if($log_hd_num>0){
//21下单,23加量
if($log_hd_old_num_kh==0)
$action=21;
else
$action=23;
}else if($log_hd_num<0){
//22减量,24删单
if($log_hd_old_num_kh==$num)
$action=24;
else
$action=22;
}
}
}else if($_m=="cc_single"){
global $flag_action;
//橱窗订单界面
$num=abs($log_hd_num);
$iid=$khid;
$action=$flag_action;
}else if($_m=="login"){
//登陆
$action=11;
}else if($_m=="client_pj"){
//评款
$num=$log_hd_num;
$iid=$khid;
if($_a=="save_pj")
$action=61;
else
$action=62;
}else if($_m=="logout"){
//注销
$action=12;
}else if($_m=="main_8"){
//管理员界面
$action=0;
}
if(in_array($action,$arr_log_hd_action_in) && $uid>0){
if($num==0 && ($action!=11 || $action!=12)){
$q="";
}else{
$q="insert into ".$table_pre."log_hd (uid,iid,num,ip,action,ms,hd_type,add_date) values ('".$uid."','".$iid."','".$num."','".$ip."','".$action."','".$log_hd_ms."','".$hd_face."','".$add_date."')";
$db->query($q);
}
}
}
//
function deel_con_u($s_username){
global $db,$table_pre,$con_u_all;
if($s_username){
$s_username=str_replace("",",",$s_username);
//去掉最后一个逗号
if(substr($s_username,strlen($s_username)-1,1)==",")
$s_username1=substr($s_username,0,-1);
else
$s_username1=$s_username;
$arr_username=explode(",",$s_username1);
//去掉重复值
$arr_username=array_unique($arr_username);
$error=$con_u="";
for($i=0;$i<count($arr_username);$i++){
//检查是否存在
$m_client=get_db_msg("select * from ".$table_pre."client where username='".$arr_username[$i]."'");
//
if($m_client["id"]){
if($m_client["face"]=="4"){
$con_u.=" (uid='".$m_client["id"]."') or ";
}else{
$con_u.=" (upath='".$m_client["path"]."-".$m_client["id"]."' or upath like '".$m_client["path"]."-".$m_client["id"]."-%') or ";
}
}else{
$error.=$arr_username[$i].",";
}
}
if($con_u)
$con_u=substr($con_u,0,-3)." and ";
}else{
if($con_u_all)
$con_u=$con_u_all;
else
$con_u="uid=0 and ";
}
if($error){
$error=substr($error,0,-1);
alert_and_back("用户代码有错,请检查(".$error.")");
}
return $con_u;
}
//老版
function get_qj_u_con_all($charge_path){
global $db,$table_pre;
$r="";
$arr_upath=explode(",",$charge_path);
$i2=0;
for($i=0;$i<count($arr_upath);$i++){
$m=get_db_msg("select face,id,title,username from ".$table_pre."client where id='".get_parent_id($arr_upath[$i])."'");
if($m["face"]=="4"){
$r.="uid='".$m["id"]."' or ";
$i2++;
}
}
if($r)
$r="(".substr($r,0,-3).") and ";
return $r;
}
//取得上级代理名称
function get_dl_title($path){
global $db,$table_pre;
$arr_path=explode("-",$path);
for($i=count($arr_path)-1;$i>=0;$i--){
if($arr_path[$i]>0){
$m1=get_db_msg("select id,face,title from ".$table_pre."client where id='".$arr_path[$i]."'");
if($m1["face"]=="3"){
return $m1["title"];
}
}
}
return "";
}
//取得规格编号
function get_gg_id($gg){
global $db,$table_pre;
$ggid="";
if(trim($gg)){
$c=get_db_msg("select id from ".$table_pre."kh_gg_title where title='".$gg."'");
$ggid=$c["id"];
}
return $ggid;
}
//取得规格名称
function get_gg_title($gg){
global $db,$table_pre;
$gg_title="";
if(trim($gg)){
$c=get_db_msg("select title from ".$table_pre."kh_gg_title where id='".$gg."'");
$gg_title=$c["title"];
}
return $gg_title;
}
function get_order_by_client($u_sql){
global $table_pre,$db;
$_tbody="<html xmlns:o=\"urn:schemas-microsoft-com:office:office\"
xmlns:x=\"urn:schemas-microsoft-com:office:excel\"
xmlns=\"http://www.w3.org/TR/REC-html40\">
<head>
<meta http-equiv=Content-Type content=\"text/html; charset=utf-8\">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content=\"Microsoft Excel 11\">
<style>
<!--table
{mso-displayed-decimal-separator:\"\.\";
mso-displayed-thousand-separator:\"\,\";}
@page
{margin:1.0in .75in 1.0in .75in;
mso-header-margin:.5in;
mso-footer-margin:.5in;}
tr
{mso-height-source:auto;
mso-ruby-visibility:none;}
col
{mso-width-source:auto;
mso-ruby-visibility:none;}
br
{mso-data-placement:same-cell;}
.style0
{mso-number-format:General;
text-align:general;
vertical-align:middle;
white-space:nowrap;
mso-rotate:0;
mso-background-source:auto;
mso-pattern:auto;
color:windowtext;
font-size:12.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:宋体;
mso-generic-font-family:auto;
mso-font-charset:134;
border:none;
mso-protection:locked visible;
mso-style-name:常规;
mso-style-id:0;}
td
{mso-style-parent:style0;
padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:windowtext;
font-size:12.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:宋体;
mso-generic-font-family:auto;
mso-font-charset:134;
mso-number-format:General;
text-align:general;
vertical-align:middle;
border:none;
mso-background-source:auto;
mso-pattern:auto;
mso-protection:locked visible;
white-space:nowrap;
mso-rotate:0;}
ruby
{ruby-align:left;}
rt
{color:windowtext;
font-size:9.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:宋体;
mso-generic-font-family:auto;
mso-font-charset:134;
mso-char-type:none;
display:none;}
-->
</style>
<!--[if gte mso 9]><xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:WorksheetOptions>
<x:DefaultRowHeight>285</x:DefaultRowHeight>
<x:Selected/>
<x:ProtectContents>False</x:ProtectContents>
<x:ProtectObjects>False</x:ProtectObjects>
<x:ProtectScenarios>False</x:ProtectScenarios>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
<x:WindowHeight>8640</x:WindowHeight>
<x:WindowWidth>17955</x:WindowWidth>
<x:WindowTopX>720</x:WindowTopX>
<x:WindowTopY>315</x:WindowTopY>
<x:ProtectStructure>False</x:ProtectStructure>
<x:ProtectWindows>False</x:ProtectWindows>
</x:ExcelWorkbook>
</xml><![endif]-->
</head>
<body link=blue vlink=purple><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);
//取得尺码合计sql
$sql_sum_num="";
for($k=0;$k<$num_size_total;$k++){
$sql_sum_num.="sum(num_".$arr_size_merged[$k].") 'num_".$arr_size_merged[$k]."',";
}
//取得尺码表头内容
$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++;
}
//-------------------/处理尺码表头结束
$_tbody.="<tr><td rowspan=\"".$num_size_group."\">&nbsp;</td><td rowspan=\"".$num_size_group."\">&nbsp;</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)){
$_tbody.="<td rowspan=\"".$num_size_group."\">".get_cate_title_no("arr_select",$m["no"])."</td>";
$num_dz++;
}
$_tbody.="<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>";
//$_tbody.="<td rowspan=\"".$num_size_group."\">版型</td>";
$_tbody.=$size_tr[0]."<td rowspan=\"".$num_size_group."\">小计</td><td rowspan=\"".$num_size_group."\">吊牌金额</td>";
$_tbody.="</tr>";
for($i=1;$i<$num_size_group;$i++){
$_tbody.="<tr>".$size_tr[$i]."</tr>";
}
$sql_con="where ka<>'y'".$u_sql;
$q="select * from ".$table_pre."order ".$sql_con." order by uid,no,color,bx";
//echo $q."<br>";
$r=$db->query($q);
$count=0;
$total_num=$total_money=$total_money_zk=0;
while($m=$db->fetch_array($r)){
$m1=get_db_msg("select * from ".$table_pre."kh where id='".$m["iid"]."'");
$m3=get_db_msg("select * from ".$table_pre."client where id='".$m["uid"]."'");
$arr_p=explode("-",$m3["path"]);
//取得区域
$tmp=get_db_msg("select title from ".$table_pre."client where id='".$arr_p[1]."'");
$qy=$tmp["title"];
//取得代理
$tmp=get_db_msg("select title from ".$table_pre."client where id='".$arr_p[count($arr_p)-1]."'");
$dl=$tmp["title"];
$num=0;
$td_size1="";
for($k=0;$k<$num_size_total;$k++){
$num+=$m["num_".$arr_size_merged[$k]];
$td_size1.="<td x:num>".$m["num_".$arr_size_merged[$k]]."</td>";
}
if($num>0){
$money=$m["je"];
$money_zk=$m["jsje"];
$total_num+=$num;
$total_money+=$money;
$total_money_zk+=$money_zk;
$_tbody.="<tr height=\"25\"><td>".$qy."</td><td>".$dl."</td><td>".$m3["title"]."</td><td>".$m3["username"]."</td><td>".$m1["no"]."</td>";
//取得定制选项
$q4="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";
$r4=$db->query($q4);
while($m4=$db->fetch_array($r4)){
if($m4["no"]=="zd1" || $m4["no"]=="zd2" || $m4["no"]=="zd3")
$_tbody.="<td>".$m1[$m4["no"]]."</td>";
else
$_tbody.="<td>".get_cate_title_no($m4["no"],$m1[$m4["no"]])."</td>";
}
//取得评价
$m_pj=get_db_msg("select race,remark from ".$table_pre."client_pj where cid='".$m["uid"]."' and khid='".$m["iid"]."'");
$_tbody.="<td>".$m_pj["race"]."</td><td>".$m_pj["remark"]."</td><td>".$m1["price"]."</td><td>".get_cate_title_no("color",$m["color"])."</td><td>".$m["color"]."</td>";
//取得规格价格
//$tmp=get_db_msg("select price from ".$table_pre."kh_gg where iid='".$m["iid"]."' and gg='".$m["bx"]."'");
//$_tbody.="<td>".deel_td(get_gg_title($m["bx"]))."</td>";
$_tbody.=$td_size1."<td x:num>".$num."</td><td x:num>".$money."</td>";
$_tbody.="</tr>";
$count++;
}
}
//
$_tbody.="</table></body></html>";
return $_tbody;
}
//
function get_order_by_uid($uid,$s_ka){
global $table_pre,$db;
$_tbody="";
$arr_size_merged=get_size_merged();
$num_size_total=count($arr_size_merged);
if($s_ka=="y"){
$sql_con_ka=" ka='y'";
}else{
$sql_con_ka=" ka<>'y'";
}
$q="select * from ".$table_pre."order where ".$sql_con_ka." and uid='".$uid."' order by no,color,bx";
//echo $q."<br>";
$r=$db->query($q);
$count=0;
$total_num=$total_money=$total_money_zk=0;
while($m=$db->fetch_array($r)){
//$m1=get_db_msg("select * from ".$table_pre."kh where id='".$m["iid"]."'");
$m3=get_db_msg("select id,path,title,username from ".$table_pre."client where id='".$m["uid"]."'");
$m_kh=get_db_msg("select xh from ".$table_pre."kh where id='".$m["iid"]."'");
$arr_p=explode("-",$m3["path"]);
//取得区域
$tmp=get_db_msg("select title from ".$table_pre."client where id='".$arr_p[1]."'");
$qy=$tmp["title"];
//取得代理
$tmp=get_db_msg("select title from ".$table_pre."client where id='".$arr_p[count($arr_p)-1]."'");
$dl=$tmp["title"];
$num=0;
$td_size1="";
for($k=0;$k<$num_size_total;$k++){
$num+=$m["num_".$arr_size_merged[$k]];
$td_size1.="<td x:num>".$m["num_".$arr_size_merged[$k]]."</td>";
}
if($num>0){
$money=$m["je"];
$money_zk=$m["jsje"];
$total_num+=$num;
$total_money+=$money;
$total_money_zk+=$money_zk;
$_tbody.="<tr height=\"25\"><td>".$qy."</td><td>".$dl."</td><td>".$m3["title"]."</td><td>".$m3["username"]."</td><td>".$m_kh["xh"]."</td><td>".$m["no"]."</td>";
//取得定制选项
$q4="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";
$r4=$db->query($q4);
while($m4=$db->fetch_array($r4)){
if($m4["no"]=="zd1" || $m4["no"]=="zd2" || $m4["no"]=="zd3")
$_tbody.="<td>".$m[$m4["no"]]."</td>";
else
$_tbody.="<td>".get_cate_title_no($m4["no"],$m[$m4["no"]])."</td>";
}
//取得评价
$m_pj=get_db_msg("select race,remark from ".$table_pre."client_pj where cid='".$m["uid"]."' and khid='".$m["iid"]."'");
$_tbody.="<td>".$m_pj["race"]."</td><td>".$m_pj["remark"]."</td><td>".$m["price"]."</td><td>".get_cate_title_no("color",$m["color"])."</td><td>".$m["color"]."</td>";
//$_tbody.="<td>".deel_td(get_gg_title($m["bx"]))."</td>";
$_tbody.=$td_size1."<td x:num>".$num."</td><td x:num>".$money."</td>";
$_tbody.="</tr>";
$count++;
}
}
return $_tbody;
}
//
function get_execl_html_body(){
return "<html xmlns:o=\"urn:schemas-microsoft-com:office:office\"
xmlns:x=\"urn:schemas-microsoft-com:office:excel\"
xmlns=\"http://www.w3.org/TR/REC-html40\">
<head>
<meta http-equiv=Content-Type content=\"text/html; charset=utf-8\">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content=\"Microsoft Excel 11\">
<style>
<!--table
{mso-displayed-decimal-separator:\"\.\";
mso-displayed-thousand-separator:\"\,\";}
@page
{margin:1.0in .75in 1.0in .75in;
mso-header-margin:.5in;
mso-footer-margin:.5in;}
tr
{mso-height-source:auto;
mso-ruby-visibility:none;}
col
{mso-width-source:auto;
mso-ruby-visibility:none;}
br
{mso-data-placement:same-cell;}
.style0
{mso-number-format:General;
text-align:general;
vertical-align:middle;
white-space:nowrap;
mso-rotate:0;
mso-background-source:auto;
mso-pattern:auto;
color:windowtext;
font-size:12.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:宋体;
mso-generic-font-family:auto;
mso-font-charset:134;
border:none;
mso-protection:locked visible;
mso-style-name:常规;
mso-style-id:0;}
td
{mso-style-parent:style0;
padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:windowtext;
font-size:12.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:宋体;
mso-generic-font-family:auto;
mso-font-charset:134;
mso-number-format:General;
text-align:general;
vertical-align:middle;
border:none;
mso-background-source:auto;
mso-pattern:auto;
mso-protection:locked visible;
white-space:nowrap;
mso-rotate:0;}
ruby
{ruby-align:left;}
rt
{color:windowtext;
font-size:9.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:宋体;
mso-generic-font-family:auto;
mso-font-charset:134;
mso-char-type:none;
display:none;}
-->
</style>
<!--[if gte mso 9]><xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:WorksheetOptions>
<x:DefaultRowHeight>285</x:DefaultRowHeight>
<x:Selected/>
<x:ProtectContents>False</x:ProtectContents>
<x:ProtectObjects>False</x:ProtectObjects>
<x:ProtectScenarios>False</x:ProtectScenarios>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
<x:WindowHeight>8640</x:WindowHeight>
<x:WindowWidth>17955</x:WindowWidth>
<x:WindowTopX>720</x:WindowTopX>
<x:WindowTopY>315</x:WindowTopY>
<x:ProtectStructure>False</x:ProtectStructure>
<x:ProtectWindows>False</x:ProtectWindows>
</x:ExcelWorkbook>
</xml><![endif]-->
</head>
<body link=blue vlink=purple>";
}