28,391
社区成员
发帖
与我相关
我的任务
分享
<form name="form1" method="post" action="">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#6699ff">
<tr>
<td height="20" align="center"><font color="#FFFFFF"><%=schORmodify%></font></td>
</tr>
<tr>
<td height="100" bgcolor="#FFFFFF">
<%
Const MaxPerPage=10
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end If
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [ProjectItem] where Menu_ZH like '%"&selectkey&"%' order by ID desc",conn,1,1
if rs.eof And rs.bof then
Response.Write "<p align='center' class='contents'> No data!</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,"index.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"index.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"index.asp"
end if
end if
end if
sub showContent
dim i
i=0%>
<table width="95%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
<tr bgcolor="#FFFFFF" align="center" height="20">
<td width="20%"><font color='red'><B><%=txtId%></B></font></td>
<td width="30%"><font color='red'><B><%=txtName%>Menu_ZH</B></font></td>
<td width="40%"><font color='red'><B><%=txtName%>Menu_EN</B></font></td>
<td width="10%"><font color='red'><B><%=selectBt%></B></font></td>
</tr>
<%do while not rs.eof%>
<tr bgcolor="#FFFFFF" align="center">
<td><%=rs("ID")%></td>
<td align="left"><a href=edit.asp?id=<%=rs("ID")%>><%=rs("Menu_ZH")%></a></td>
<td align="left"><a href=edit.asp?id=<%=rs("ID")%>><%=rs("Menu_EN")%></a></td>
<td><input name="selectid" type="checkbox" id="selectid" value="<%=rs("ID")%>"></td>
</tr>
<%i=i+1
if i>=MaxPerPage then Exit Do
rs.movenext
loop
rs.close
set rs=nothing%>
<tr bgcolor="#FFFFFF">
<td height="30" colspan="3" align="right"><%=selectAll%> <input type="checkbox" name=chkall onClick="CheckAll(this.form)"> <input type="submit" name="action" class="button"value="<%=delBt%>" onClick="{if(confirm('Are you sure delete?')){this.document.Prodlist.submit();return true;}return false;}"></td>
</tr>
<tr bgcolor="#EEEEEE">
<td colspan="3">
<%
End Sub
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="&filename&"?selectm="&selectm&"&selectkey="&selectkey&" >"
Response.Write "<p align='center' class='contents'> "
If CurrentPage<2 Then
Response.Write "<font class='contents'>首頁 上頁</font> "
Else
Response.Write "<a href="&filename&"?page=1&selectm="&selectm&"&selectkey="&selectkey&" class='contents'>首頁</a> "
Response.Write "<a href="&filename&"?page="¤tPage-1&"&selectm="&selectm&"&selectkey="&selectkey&" class='contents'>上頁</a> "
End If
If n-currentpage<1 Then
Response.Write "<font class='contents'>下頁 尾頁</font>"
Else
Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&"&selectm="&selectm&"&selectkey="&selectkey&" class='contents'>"
Response.Write "下頁</a> <a href="&filename&"?page="&n&"&selectm="&selectm&"&selectkey="&selectkey&" class='contents'>尾頁</a>"
End If
Response.Write "<font class='contents'> 當前</font><font class='contents'>"¤tPage&"</font><font class='contents'>/"&n&"頁</font> "
Response.Write "<font class='contents'> 總記錄("&totalnumber&") "
Response.Write "<font class='contents'> 跳至</font><input type='text' name='page' size=2 maxlength=10 class=smallInput value="¤tpage&">"
Response.Write " <input type='submit' class='button' value='翻轉分頁' name='cndok' ></form>"
End Function
%>
</td>
</tr>
</table>
</td>
</tr>
</table></form>