📄 contactlist.php
字号:
<?
include_once("inc/auth.php");
include_once("inc/utility_all.php");
?>
<script>
function set_page()
{
PAGE_START=PAGE_NUM.value;
location="contactlist.php?CUSTOMER_ID=<?=$CUSTOMER_ID?>&CUR_PAGE="+PAGE_START;
}
</script>
<html>
<head>
<title>客户服务安排查询</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body topmargin="5">
<?
//-----------先组织SQL语句-----------
$CUSTOMER_COUNT=0;
$query="SELECT count(*) from CONTACT 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($CUR_PAGE>$PAGE_COUNT)
$CUR_PAGE=$PAGE_COUNT;
$query1="SELECT b.CODE_NAME as CONTACT_TYPE,a.CONTACT_DATE as CONTACT_DATE,a.CONTACT_CONTENT as CONTACT_CONTENT,a.SELLER as SELLER
from CONTACT a LEFT OUTER JOIN SYS_CODE b
ON a.CONTACT_TYPE=b.CODE_NO AND b.PARENT_NO = 'CONTACT_TYPE'
where CUSTOMER_ID='$CUSTOMER_ID' ";
$offest=($CUR_PAGE-1)*5;
$query1=$query1." LIMIT ". $offest." ,".$PER_PAGE;
$cursor1 = exequery($connection, $query1);
if($CUSTOMER_COUNT==0)
{
Message("<br>提示","没有服务记录");
exit;
}
else
{
?>
<table border="0" cellspacing="1" width="95%" class="small" cellpadding="3">
<tr>
<td align="left">
<a href="contactlist.php?CUR_PAGE=1&CUSTOMER_ID=<?=$CUSTOMER_ID?>"><img src='/images/first02.gif' width='24' border='0' height='15' alt='首页'></a>
<a href="contactlist.php?CUR_PAGE=<?=$CUR_PAGE-1?>&CUSTOMER_ID=<?=$CUSTOMER_ID?>"><img src='/images/first01.gif' width='24' border='0' height='15' alt='上一页'></a>
<a href="contactlist.php?CUR_PAGE=<?=$CUR_PAGE+1?>&CUSTOMER_ID=<?=$CUSTOMER_ID?>"><img src='/images/last01.gif' width='24' border='0' height='15' alt='下一页' style="cursor:hand"></a>
<a href="contactlist.php?CUR_PAGE=<?=$PAGE_COUNT?>&CUSTOMER_ID=<?=$CUSTOMER_ID?>"><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">
<?=$CUR_PAGE?>/<?=$PAGE_COUNT?>页 共 <?=$CUSTOMER_COUNT?> 条
</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 align="center" width="150">服务内容</td>
<td nowrap align="center">销售员</td>
</tr>
<?
$CUSTOMER_COUNT=0;
while($ROW=mysql_fetch_array($cursor1))
{
$CUSTOMER_COUNT++;
$CONTACT_ID1=$ROW["CONTACT_ID"];
$CONTACT_TYPE1=$ROW["CONTACT_TYPE"];
$CONTACT_DATE1=$ROW["CONTACT_DATE"];
$CONTACT_CONTENT1=$ROW["CONTACT_CONTENT"];
$SELLER1=$ROW["SELLER"];
$query2="select * from USER where USER_ID='$SELLER1'";
$cursor2 = exequery($connection, $query2);
if($ROW=mysql_fetch_array($cursor2))
$SELLER1=$ROW["USER_NAME"];
if($CUSTOMER_COUNT%2==1)
$TableLine="TableLine1";
else
$TableLine="TableLine2";
?>
<tr class="<?=$TableLine?>">
<td nowrap align="center"><?=$CONTACT_TYPE1?></td>
<td nowrap align="center"><?=$CONTACT_DATE1?></td>
<td align="left" width="150"><?=$CONTACT_CONTENT1?></td>
<td nowrap align="center"><?=$SELLER1?></td>
</tr>
<?
}
}
?>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -