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