ASP分页程序解析

王朝asp·作者佚名  2006-11-24
窄屏简体版  字體: |||超大  

<!--#include virtual="/share/config.asp"-->

<html>

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<style type="text/css">

<!--

td {

font-size: 12px;

}

-->

</style>

</head>

<center>

<body>

<table width="400" border="0" cellspacing="0" cellpadding="0">

<form name="form1" method="post" action="showpage_test.asp">

<tr>

<td width="112" height="20"><div align="center">起始日期</div></td>

<td width="288" height="20"><input name="startTime" type="text" id="startTime" onClick="setday(this)" size="20" readonly></td>

</tr>

<tr>

<td height="20"><div align="center">结束日期</div></td>

<td height="20"><input name="endTime" type="text" id="endTime" onClick="setday(this)" size="20" readonly></td>

</tr>

<tr>

<td height="20" colspan="2"><div align="center">

<input type="submit" name="Submit" value="查询">

<input type="submit" name="Submit2" value="我要投诉">

</div></td>

</tr>

</form>

</table>

<br>

<table width="100%" border="0" cellpadding="0" cellspacing="0">

<tr>

<td><div align="center">

<%

const MaxPerPage=1

dim totalPut

dim CurrentPage

dim TotalPages

dim i,j

if request("page")="" then

currentPage=1

else

currentPage=cint(request("page"))'在表单中先强制只能输入数字

'if IsNumeric(request("page")) then

'currentPage=cint(request("page"))

'else

'Response.write "这里提示只能输入数字"

'end if

end if

%>

<%

Set Conn=Server.CreateObject("adodb.Connection")

Conn.Open Application("connStr")

Set Rs=server.createobject("adodb.recordset")

startTime=request("startTime")

endTime=request("endTime")

if startTime<>"" and endTime<>"" then

endTime=dateadd("d",1,endTime)

sql="select * from d_leave_word where ly_Date between '"&startTime&"' and '"&endTime&"'"

endTime=dateadd("d",-1,endTime)

else

sql="select * from d_leave_word"

end if

GoPage="showpage_test.asp"

Condition="&startTime="&startTime&"&endTime="&endTime&""

rs.open sql,conn,1,1

if rs.eof and rs.bof then

response.write "<p align='center'><font color='#000066'>还没任何信息!</font></p>"

else

totalPut=rs.recordcount

if currentpage<1 then

currentpage=1

end if

if (currentpage-1)*MaxPerPage>totalput then

if (totalPut mod MaxPerPage)=0 then

currentpage= totalPut \ MaxPerPage

else

currentpage= totalPut \ MaxPerPage + 1

end if

end if

if currentPage=1 then

showContent

showpage totalput,MaxPerPage,GoPage

elseif (currentPage-1)*MaxPerPage<totalPut then

rs.move (currentPage-1)*MaxPerPage

dim bookmark

bookmark=rs.bookmark

showContent

showpage totalput,MaxPerPage,GoPage

else

currentPage=1

showContent

showpage totalput,MaxPerPage,GoPage

end if

end if

rs.close

set rs=nothing

conn.close

set conn=nothing

%>

<%

sub showContent

dim i

i=0

%>

<table width="96%" border="0" cellpadding="0" cellspacing="1" bgcolor="#4D90AB">

<tr bgcolor="#D7F3FF">

<td width="80" height="21"><div align="center">投诉类别</div></td>

<td width="124" height="21"><div align="center">投诉内容</div></td>

<td width="60" height="21"><div align="center">投诉日期</div></td>

<td width="60" height="21"><div align="center">投诉状态</div></td>

<td width="127" height="21"><div align="center">处理意见</div></td>

<td width="60" height="21"><div align="center">处理时间</div></td>

<td width="40"><div align="center">查看</div></td>

</tr>

<%do while not rs.eof%>

<tr bgcolor="#FFFFFF">

<td width="80" height="20"><div align="center"><%=HTMLdecode(rs("Type_Name"))%></div></td>

<td height="20"><div align="left">

<%if len(HTMLdecode(rs("Content")))>9 then response.write left(HTMLdecode(rs("Content")),9)&"..." else response.write HTMLdecode(rs("Content")) end if%>

</div></td>

<td width="60" height="20"><div align="center"><%=rs("ly_Date")%></div></td>

<td width="60" height="20"><div align="center">

<%if HTMLdecode(rs("Re_Content"))<>"" then response.write "已回复" else response.write "处理中" end if%>

</div></td&

[1] [2] [3] [4] [5] 下一页

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航