⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 list.php

📁 泛微协同办公系统标准版E-office V5.5的源代码内含泛微办公系统V5.5自动注册文件。
💻 PHP
字号:
<?php

include_once( "inc/auth.php" );
include_once( "inc/function_page_01.php" );
if ( $_REQUEST['cur_page'] == "" )
{
	$cur_page = 1;
}
else
{
	$cur_page = $_REQUEST['cur_page'];
}
echo "\r\n<html>\r\n<head>\r\n<title>销售记录查询结果 </title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n";
echo "<s";
echo "cript>\r\nfunction customer_detail(customer_id)\r\n{\r\n\tvar url\t= \"../../../crm/customer/detail.php?CUSTOMER_ID=\"+customer_id;\r\n\twindow.open(url,\"\",\"height=600,width=800,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=50,left=100,resizable=yes\");\r\n}\r\n\r\nfunction product_detail(product_id)\r\n{\r\n\tvar url\t= \"../detail.php?product_id=\"+product_id;\r\n\twindow.open(url, '', 'height=600,width=800,to";
echo "p=50, left=100,toolbar=no,menubar=no,scrollbars=no, resizable=yes,location=no, status=yes');\r\n}\r\n</script>\r\n</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n<form action=\"list.php\"  method=\"post\" name=\"form1\" >  \r\n<table border=\"0\" width=\"100%\" cellspacing=\"1\" cellpadding=\"0\" >\r\n  <tr class=\"tablehead1\">\r\n    <td ><img src=\"/images/notify_new.gif\" align=\"absmiddle\">销售记录查询结果</td>\r\n  </tr>\r\n  <tr cla";
echo "ss=\"tablehead2\">\r\n   <td><BUTTON class=btn onClick=\"window.close();\" title=\"关闭窗口\"><table><tr valign=top ><td><img src=\"/images/littlegif/b_u.gif\" align=\"center\"></td> <td>";
echo "<s";
echo "pan id=\"showallid\">关闭</span></td></tr></table></BUTTON></td>\r\n  </tr>\r\n</table>\r\n<br>\r\n";
$connection = openconnection( );
$query = "SELECT s.*, c.CUSTOMER_NAME, c.CUSTOMER_ID, p.PRODUCT_NAME, p.PRODUCT_ID from sale_history as s, customer as c, product as p where s.CUSTOMER_ID=c.CUSTOMER_ID and s.PRODUCT_ID=p.PRODUCT_ID and s.CUSTOMER_ID=".$_REQUEST['CUSTOMER_ID2']."";
$where_str = "";
if ( $_REQUEST['CUSTOMER_NAME'] != "" )
{
	$where_str .= " and c.CUSTOMER_NAME like '%".$_REQUEST['CUSTOMER_NAME']."%'";
}
if ( $_REQUEST['PRODUCT_ID'] != "" )
{
	$where_str .= " and p.PRODUCT_ID=".$_REQUEST['PRODUCT_ID']."";
}
if ( $_REQUEST['DATE'] != "" )
{
	$where_str .= " and to_days(s.DATE) >= to_days('".$_REQUEST['DATE']."')";
}
if ( $_REQUEST['DATE2'] != "" )
{
	$where_str .= " and to_days(s.DATE) <= to_days('".$_REQUEST['DATE2']."')";
}
if ( $_REQUEST['AMT'] != "" )
{
	$where_str .= " and s.AMT >= ".$_REQUEST['AMT']."";
}
if ( $_REQUEST['AMT2'] != "" )
{
	$where_str .= " and s.AMT <= ".$_REQUEST['AMT2']."";
}
if ( $_REQUEST['PRICE'] != "" )
{
	$where_str .= " and s.PRICE >= '".$_REQUEST['PRICE']."'";
}
if ( $_REQUEST['PRICE2'] != "" )
{
	$where_str .= " and s.PRICE <= '".$_REQUEST['PRICE2']."'";
}
if ( $_REQUEST['DISCOUNT'] != "" )
{
	$where_str .= " and s.DISCOUNT >= '".$_REQUEST['DISCOUNT']."'";
}
if ( $_REQUEST['DISCOUNT2'] != "" )
{
	$where_str .= " and s.DISCOUNT <= '".$_REQUEST['DISCOUNT2']."'";
}
if ( $_REQUEST['SALESMAN'] != "" )
{
	$where_str .= " and s.SALESMAN like '%".$_REQUEST['SALESMAN']."%'";
}
if ( $_REQUEST['MEMO'] != "" )
{
	$where_str .= " and s.MEMO like '%".$_REQUEST['MEMO']."%'";
}
$query .= $where_str;
switch ( $_REQUEST['order'] )
{
case "customer_name" :
	$query .= " order by c.CUSTOMER_NAME";
	break;
case "product_name" :
	$query .= " order by p.PRODUCT_NAME";
	break;
case "date" :
	$query .= " order by s.DATE";
	break;
case "amt" :
	$query .= " order by s.AMT";
	break;
case "price" :
	$query .= " order by s.PRICE";
	break;
case "discount" :
	$query .= " order by s.DISCOUNT";
	break;
case "salesman" :
	$query .= " order by s.SALESMAN";
	break;
default :
	$query .= " order by s.HISTORY_ID";
	break;
}
$query .= $_REQUEST['sens'] ? " DESC" : " ASC";
$query = page( $query, 15 );
$cursor = exequery( $connection, $query );
$count = 0;
echo "<table border=\"0\" cellspacing=\"1\" width=\"100%\" cellpadding=\"5\" class=\"small\">\r\n";
while ( $row = mysql_fetch_array( $cursor ) )
{
	++$count;
	$history_id = $row['HISTORY_ID'];
	$customer_name = $row['CUSTOMER_NAME'];
	$customer_id = $row['CUSTOMER_ID'];
	$product_id = $row['PRODUCT_ID'];
	$product_name = $row['PRODUCT_NAME'];
	$date = $row['DATE'];
	$amt = $row['AMT'];
	$price = $row['PRICE'];
	$salesman = $row['SALESMAN'];
	$discount = $row['DISCOUNT'];
	$memo = $row['MEMO'];
	$sale_history_create_user = $row['SALE_HISTORY_CREATE_USER'];
	if ( $count % 2 == 1 )
	{
		$TableLine = "TableLine1";
	}
	else
	{
		$TableLine = "TableLine2";
	}
	echo "<tr class=\"";
	echo $TableLine;
	echo "\">\r\n\t\t<td title=\"";
	echo $customer_name;
	echo "\"><a href=\"#\" onClick=\"customer_detail('";
	echo $customer_id;
	echo "');\">";
	echo strlen( $customer_name ) <= 50 ? $customer_name : substr( $customer_name, 0, 50 ).chr( 0 )."...";
	echo "</a></td>\r\n\t\t<td title=\"";
	echo $product_name;
	echo "\"><a href=\"#\" onClick=\"product_detail('";
	echo $product_id;
	echo "');\">";
	echo strlen( $product_name ) <= 25 ? $product_name : substr( $product_name, 0, 25 ).chr( 0 )."...";
	echo "</a></td>\r\n\t\t<td>";
	echo $date;
	echo "</td>\r\n\t\t<td>";
	echo $amt;
	echo "</td>\r\n\t\t<td title=\"";
	echo $price;
	echo "\">";
	echo strlen( $price ) <= 10 ? $price : substr( $price, 0, 10 ).chr( 0 )."...";
	echo "</td>\r\n\t\t<td title=\"";
	echo $discount;
	echo "\">";
	echo strlen( $discount ) <= 10 ? $discount : substr( $discount, 0, 10 ).chr( 0 )."...";
	echo "</td>\r\n\t\t<td title=\"";
	echo $salesman;
	echo "\">";
	echo strlen( $salesman ) <= 8 ? $salesman : substr( $salesman, 0, 8 ).chr( 0 )."...";
	echo "</td>\r\n\t</tr>\r\n";
}
echo "<center>";
if ( $count == 0 )
{
	message( "提示", "暂无记录" );
	exit( );
}
echo "</center>";
$sens = $_REQUEST['sens'] ? 0 : 1;
$sensimg = $_REQUEST['sens'] ? "arrow_up.gif" : "arrow_down.gif";
$sensimg = "/images/".$sensimg;
$sufurl = $_SERVER['PHP_SELF']."?sens=".$sens;
echo "\t<thead class=\"TableHeader\">\r\n\t\t<td><a href=\"";
echo $sufurl;
echo "&order=customer_name&cur_page=";
echo $cur_page;
echo "&CUSTOMER_ID2=";
echo $customer_id;
echo "\">所属客户";
if ( $_REQUEST['order'] == "customer_name" )
{
	echo "<img src='".$sensimg."' border='0'>";
}
echo "</a></td>\r\n\t\t<td><a href=\"";
echo $sufurl;
echo "&order=product_name&cur_page=";
echo $cur_page;
echo "&CUSTOMER_ID2=";
echo $customer_id;
echo "\">产品";
if ( $_REQUEST['order'] == "product_name" )
{
	echo "<img src='".$sensimg."' border='0'>";
}
echo "</a></td>\r\n\t\t<td><a href=\"";
echo $sufurl;
echo "&order=date&cur_page=";
echo $cur_page;
echo "&CUSTOMER_ID2=";
echo $customer_id;
echo "\">销售日期";
if ( $_REQUEST['order'] == "date" )
{
	echo "<img src='".$sensimg."' border='0'>";
}
echo "</a></td>\r\n\t\t<td><a href=\"";
echo $sufurl;
echo "&order=amt&cur_page=";
echo $cur_page;
echo "&CUSTOMER_ID2=";
echo $customer_id;
echo "\">数量";
if ( $_REQUEST['order'] == "amt" )
{
	echo "<img src='".$sensimg."' border='0'>";
}
echo "</a></td>\r\n\t\t<td><a href=\"";
echo $sufurl;
echo "&order=price&cur_page=";
echo $cur_page;
echo "&CUSTOMER_ID2=";
echo $customer_id;
echo "\">价格";
if ( $_REQUEST['order'] == "price" )
{
	echo "<img src='".$sensimg."' border='0'>";
}
echo "</a></td>\r\n\t\t<td><a href=\"";
echo $sufurl;
echo "&order=discount&cur_page=";
echo $cur_page;
echo "&CUSTOMER_ID2=";
echo $customer_id;
echo "\">折扣";
if ( $_REQUEST['order'] == "discount" )
{
	echo "<img src='".$sensimg."' border='0'>";
}
echo "</a></td>\r\n\t\t<td><a href=\"";
echo $sufurl;
echo "&order=salesman&cur_page=";
echo $cur_page;
echo "&CUSTOMER_ID2=";
echo $customer_id;
echo "\">销售员";
if ( $_REQUEST['order'] == "salesman" )
{
	echo "<img src='".$sensimg."' border='0'>";
}
echo "</a></td>\r\n\t</thead>\r\n</table>\r\n<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"5\">\r\n\t<tr>\r\n\t\t<td class=\"TableLine1\" nowrap align=\"right\">";
disp( "sens=".$_REQUEST['sens']."&order=".$_REQUEST['order'] );
echo "</td>\r\n\t</tr>\r\n</table>\r\n";
if ( 0 < ( $n = $_REQUEST['cur_page'] - $total_page_nums ) )
{
	$cur_page = $_REQUEST['cur_page'] - $n;
	header( "location:".$_SERVER['PHP_SELF']."?&order=".$_REQUEST['order']."&sens=".$_REQUEST['sens']."&cur_page=".$cur_page );
}
echo "</body>\r\n</html>";
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -