📄 contractlist.php
字号:
<?php
include_once( "inc/auth.php" );
include_once( "inc/utility_all.php" );
$PAGE_SIZE = 10;
echo "<script>\r\nfunction set_page()\r\n{\r\n PAGE_START=PAGE_NUM.value;\r\n location=\"contractlist.php?CUSTOMER_ID=";
echo $CUSTOMER_ID;
echo "&CUR_PAGE=\"+PAGE_START;\r\n}\r\nfunction show_detail(CONTRACT_ID)\r\n{\r\n URL=\"contract/showdetail.php?CONTRACT_ID=\"+CONTRACT_ID;\r\n myleft=(screen.availWidth-650)/2;\r\n window.open(URL,\"formul_edit\",\"height=500,width=550,status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left=\"+myleft+\",resizable=yes\");\r\n}\r\nfunction show_line(CONTRACT_ID)\r\n{\r\n URL=\"contract/linelist.php?CONTRACT_ID=\"+CONTRACT_ID;\r\n myleft=(screen.availWidth-650)/2;\r\n window.open(URL,\"formul_edit\",\"height=500,width=550,status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left=\"+myleft+\",resizable=yes\");\r\n}\r\nfunction show_histroy(CONTRACT_ID)\r\n{\r\n URL=\"contract/historylist.php?CONTRACT_ID=\"+CONTRACT_ID;\r\n myleft=(screen.availWidth-650)/2;\r\n window.open(URL,\"formul_edit\",\"height=500,width=550,status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left=\"+myleft+\",resizable=yes\");\r\n}\r\n</script>\r\n<html>\r\n<head>\r\n<title>合同快速搜索 </title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n</head>\r\n";
$CUSTOMER_COUNT = 0;
$query = "SELECT count(*)\r\n from CONTRACT where CUSTOMER_ID='".$CUSTOMER_ID."'";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$CUSTOMER_COUNT = $ROW[0];
}
$PER_PAGE = 5;
$PAGE_COUNT = ceil( $CUSTOMER_COUNT / $PER_PAGE );
if ( $CUR_PAGE <= 0 || $CUR_PAGE == "" )
{
$CUR_PAGE = 1;
}
if ( $PAGE_COUNT < $CUR_PAGE )
{
$CUR_PAGE = $PAGE_COUNT;
}
$query1 = "SELECT a.CONTRACT_ID as CONTRACT_ID,a.CONTRACT_NAME as CONTRACT_NAME,a.CONTRACT_NO as CONTRACT_NO,\r\n b.CODE_NAME as CONTRACT_TYPE,a.CONTRACT_LINKMAN2,a.SELLER as SELLERID,\r\n g.USER_NAME as SELLER,sum(IFNULL(c.TOTAL_PRICE, 0)) as TOTALPRICE,a.CREATE_DATE as CREATE_DATE,\r\n a.BEGIN_DATE as BEGIN_DATE,a.END_DATE as END_DATE,sum(IFNULL(c.PAYMENT, 0)) as PAYMENT\r\n from CONTRACT a\r\n LEFT OUTER JOIN SYS_CODE b ON a.CONTRACT_TYPE = b.CODE_NO AND b.PARENT_NO = 'CONTRACT_TYPE'\r\n LEFT OUTER JOIN CONTRACT_LINE c ON a.CONTRACT_ID = c.CONTRACT_ID\r\n LEFT OUTER JOIN USER g ON a.SELLER=g.USER_ID\r\n where a.CUSTOMER_ID='".$CUSTOMER_ID."' group by a.CONTRACT_ID ";
$offest = ( $CUR_PAGE - 1 ) * 5;
$query1 = $query1." LIMIT ".$offest." ,".$PER_PAGE;
$cursor1 = exequery( $connection, $query1 );
if ( $CUSTOMER_COUNT == 0 )
{
message( "<br>提示", "没有合同信息" );
exit( );
}
echo "<table border=\"0\" cellspacing=\"1\" width=\"95%\" class=\"small\" cellpadding=\"3\">\r\n <tr>\r\n <td align=\"left\">\r\n <a href=\"contractlist.php?CUR_PAGE=1&CUSTOMER_ID=";
echo $CUSTOMER_ID;
echo "\"><img src='/images/first02.gif' width='24' border='0' height='15' alt='首页'></a>\r\n <a href=\"contractlist.php?CUR_PAGE=";
echo $CUR_PAGE - 1;
echo "&CUSTOMER_ID=";
echo $CUSTOMER_ID;
echo "\"><img src='/images/first01.gif' width='24' border='0' height='15' alt='上一页'></a>\r\n <a href=\"contractlist.php?CUR_PAGE=";
echo $CUR_PAGE + 1;
echo "&CUSTOMER_ID=";
echo $CUSTOMER_ID;
echo "\"><img src='/images/last01.gif' width='24' border='0' height='15' alt='下一页' style=\"cursor:hand\"></a>\r\n <a href=\"contractlist.php?CUR_PAGE=";
echo $PAGE_COUNT;
echo "&CUSTOMER_ID=";
echo $CUSTOMER_ID;
echo "\"><img src='/images/last02.gif' width='24' border='0' height='15' alt='末页' style=\"cursor:hand\"></a>\r\n\r\n 到\r\n <input type=\"text\" name=\"PAGE_NUM\" size=\"3\" maxlength=\"4\" class=\"SmallInput\">\r\n 页\r\n <img id=\"btnGotoPage\" src=\"/images/menu/book.gif\" onclick=\"set_page()\" border=\"0\" WIDTH=\"19\" HEIGHT=\"17\" style=\"cursor:hand\" alt=\"转到相应页面\">\r\n </td>\r\n <td align=\"right\">\r\n ";
echo $CUR_PAGE;
echo "/";
echo $PAGE_COUNT;
echo "页 共 ";
echo $CUSTOMER_COUNT;
echo " 条\r\n </td>\r\n </tr>\r\n</table>\r\n<table class=\"TableList\" width=\"95%\">\r\n <tr class=\"TableHeader\">\r\n <td nowrap align=\"center\">合同编号</td>\r\n <td nowrap align=\"center\">合同名称</td>\r\n <td nowrap align=\"center\">合同总价</td>\r\n <td nowrap align=\"center\">已付款数</td>\r\n <td nowrap align=\"center\">生效日期</td>\r\n <td nowrap align=\"center\">终止日期</td>\r\n <td nowrap align=\"center\">创建日期</td>\r\n <td nowrap align=\"center\">创建人</td>\r\n <td nowrap align=\"center\">操作</td>\r\n </tr>\r\n";
$CUSTOMER_COUNT = 0;
while ( $ROW = mysql_fetch_array( $cursor1 ) )
{
++$CUSTOMER_COUNT;
$SIGN = "";
$CONTRACT_ID1 = $ROW['CONTRACT_ID'];
$CONTRACT_NO1 = $ROW['CONTRACT_NO'];
$CONTRACT_NAME1 = $ROW['CONTRACT_NAME'];
$CONTRACT_TYPE1 = $ROW['CONTRACT_TYPE'];
$TOTALPRICE1 = $ROW['TOTALPRICE'];
$PAYMENT = $ROW['PAYMENT'];
$BEGIN_DATE1 = $ROW['BEGIN_DATE'];
$END_DATE1 = $ROW['END_DATE'];
$CREATE_DATE1 = $ROW['CREATE_DATE'];
$SELLER1 = $ROW['SELLER'];
$SELLERID = $ROW['SELLERID'];
$CONTRACT_LINKMAN2 = $ROW['CONTRACT_LINKMAN2'];
if ( $SELLERID == $LOGIN_USER_ID || $CONTRACT_LINKMAN2 == $LOGIN_USER_ID )
{
$SIGN = "1";
}
if ( $CUSTOMER_COUNT % 2 == 1 )
{
$TableLine = "TableLine1";
}
else
{
$TableLine = "TableLine2";
}
echo " <tr class=\"";
echo $TableLine;
echo "\">\r\n <td nowrap align=\"center\">";
echo $CONTRACT_NO1;
echo "</td>\r\n <td nowrap align=\"center\">";
echo $CONTRACT_NAME1;
echo "</td>\r\n <td nowrap align=\"center\"><a href=\"javascript:show_line(";
echo $CONTRACT_ID1;
echo ");\">";
echo $TOTALPRICE1;
echo "</a></td>\r\n <td nowrap align=\"center\"><a href=\"javascript:show_histroy(";
echo $CONTRACT_ID1;
echo ");\">";
echo $PAYMENT;
echo "</a></td>\r\n <td nowrap align=\"center\">";
echo $BEGIN_DATE1;
echo "</td>\r\n <td nowrap align=\"center\">";
echo $END_DATE1;
echo "</td>\r\n <td nowrap align=\"center\">";
echo $CREATE_DATE1;
echo "</td>\r\n <td nowrap align=\"center\">";
echo $SELLER1;
echo "</td>\r\n <td nowrap align=\"center\">\r\n <a href=\"javascript:show_detail(";
echo $CONTRACT_ID1;
echo ");\"> 详细信息 </a> \r\n </td>\r\n </tr>\r\n";
}
echo "</table>\r\n</body>\r\n</html>\r\n";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -