变态重口极致另类在线-波多久久夜色精品国产-波多野结衣在线观看一区-波多野结衣在线观看一区二区-污污的网站免费阅读-污污视频网址

當前位置:首頁文章首頁 IT學院 IT技術

ASP分頁程序的詳細說明

作者:  來源:  發布時間:2011-6-11 11:48:34  點擊:

 本文主要給大家介紹到的是關于ASP分頁程序的詳細解析,希望能給大家帶來幫助或啟發。

<!--#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>
              <td height="20"><div align="left">
                  <%if len(rs("Re_Content"))>9 then response.write left(rs("Re_Content"),9)&"..." else response.write rs("Re_Content") end if%>
                </div></td>
              <td width="60" height="20"><div align="center"><%=HTMLdecode(rs("Re_Date"))%></div></td>
              <td width="40"><div align="center"><a href="leave_word.asp?sType=查看&id=<%=rs("id")%>">查看</a></div></td>
            </tr>
            <%i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop%>
          </table>
          <%end sub%>
        </div></td>
    </tr>
  </table>
  </body></center>
</html>
<%
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
 n= totalnumber \ maxperpage
else
 n= totalnumber \ maxperpage+1
end if
response.write "<form method=Post action='"&GoPage&"?z=1"&Condition&"'>" 
' response.write "<p align='left' vAlign='bottom'>&nbsp;&nbsp;&gt;&gt;信息分頁&nbsp;"
response.write "<p align='center' vAlign='center'>&nbsp;&nbsp;"
if CurrentPage<2 then
 response.write "<font color='#648ECE'>首頁 上一頁</font>&nbsp;"
else
 response.write "<a href="&filename&"?page=1"&Condition&">首頁</a>&nbsp;"
 response.write "<a href="&filename&"?page="&CurrentPage-1&""&Condition&">上一頁</a>&nbsp;"
end if
if n-currentpage<1 then
 response.write "<font color='#648ECE'>下一頁 尾頁</font>"
else
 response.write "<a href="&filename&"?page="&CurrentPage+1&""&Condition&">下一頁</a>&nbsp;"
 response.write "<a href="&filename&"?page="&n&""&Condition&">尾頁</a>"
end if
response.write "&nbsp;頁次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>頁 "
response.write "&nbsp;共<b>"&totalnumber&"</b>個信息 <b>"&maxperpage&"</b>個信息/頁 "
response.write "&nbsp;轉到:<input class=TextBorder style='FONT-SIZE:8pt;width:20;HEIGHT:18px;' type='text' name='page' size=2 maxlength=10 class=smallInput value="&currentpage&" onkeydown='onlyNum();'>"
response.write "&nbsp;&nbsp;<input name='submit' type='submit' value='提交'>"
response.write "</span></p></form>"
end function
%>
<script language=java script>
function onlyNum()
{if(!((event.keyCode>=48&&event.keyCode<=57)||(event.keyCode>=96&&event.keyCode<=105)))
event.returnValue=false;}
</script>
<!--  <script language="java script" src="...js"></script>  用來調用JS文件-->
<script language="java script">
<!--

首頁 上一頁 [1] [2] [3] [4] [5]  下一頁 尾頁

相關軟件

相關文章

文章評論

軟件按字母排列: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
主站蜘蛛池模板: 生活片一级播放免费 | 国产97视频在线 | 欧美国产激情二区三区 | 日韩天天摸天天澡天天爽视频 | h在线视频 | 国产第四页 | 精品女同一区二区三区免费播放 | 青青草国产一区二区三区 | 国产成人精品视频午夜 | 欧美va免费大片 | 欧美另类高清xxxxx | 伊人99在线| 成年黄网站 | 欧美激情二区 | 亚洲精品高清中文字幕 | 狠狠躁狠狠躁 | 久久久久综合一本久道 | 最近韩国日本高清免费观看 | 奇米伊人 | 天天摸天天躁天天添天天爽 | 国产中文99视频在线观看 | 亚洲aⅴ在线 | 色综合色狠狠天天综合色hd | 一本大道香蕉最新在线视频 | 一级毛片在线免费播放 | 九九夜夜| 97狠狠干| 毛片a级三毛片免费播放 | 久久久久久国产精品视频 | 国产精品视频网 | 午夜xxxx| 成人美女隐私免费 | 黄色小网站在线观看 | 日韩高清成人毛片不卡 | 在线播放你懂得 | 国产高清自产拍av在线 | 黄色片免费网址 | 中文亚洲日韩欧美 | 中文字幕成人免费高清在线视频 | 亚洲第一第二区 | aa毛片免费全部播放完整 |