photo_show.asp

来自「这是一个学生毕业时做的教务系统」· ASP 代码 · 共 164 行

ASP
164
字号
<%@ ENABLESESSIONSTATE = FALSE %>
<!--#include file=include/conn.asp-->

<html>
<head>
<title><%=redcaff%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
a {  font-family: "宋体"; font-size: 9pt; font-style: normal; line-height: 13pt; font-weight: normal; font-variant: normal; text-transform: none; color: <%=fontcolor%>; text-decoration: none}
a:hover {  font-family: "宋体"; font-size: 9pt; font-style: normal; line-height: 13pt; font-weight: normal; font-variant: normal; text-transform: none; color: <%=fontcolor%>; text-decoration: underline}
td {  font-family: "宋体"; font-size: 9pt; font-style: normal; line-height: 13pt; font-weight: normal; font-variant: normal; text-transform: none; color: <%=fontcolor%>}
br {  font-family: "宋体"; font-size: 9pt; font-style: normal; line-height: 13pt; font-weight: normal; font-variant: normal; text-transform: none; color: <%=fontcolor%>}
.bk { font-size: 9pt; border: 1px <%=xcolor%> solid}
body {  font-family: "宋体"; font-size: 9pt; font-style: normal; line-height: 13pt; font-weight: normal; font-variant: normal; text-transform: none}
.an {  font-family: "宋体"; font-size: 9pt; background-color: <%=bgcolor%>; border: 1px <%=xcolor%> solid; color: <%=fontcolor%>}
.xzy {  border: <%=xcolor%> solid; border-width: 0px 1px 1px}
.zx {  border: <%=xcolor%> solid; border-width: 0px 0px 1px 1px}
.sxz {  border: <%=xcolor%> solid; border-width: 1px 0px 1px 1px}
.s {  border: <%=xcolor%>; border-style: solid; border-top-width: 1px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px}
.y {  border: <%=xcolor%>; border-style: solid; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px}
.font {  font-family: "Arial Black"; font-size: 14pt; color: <%=fontcolor%>}
.x {  border: <%=xcolor%>;
	border-top-width: 0px;
	border-right-width: 0px;
	border-bottom-width: 1px;
	border-left-width: 0px;
	border-top-style: solid;
	border-right-style: solid;
	border-bottom-style: solid;
	border-left-style: solid;
	border-top-color: #CCCCCC;
	border-right-color: #CCCCCC;
	border-bottom-color: #CCCCCC;
	border-left-color: #CCCCCC;
}
.z {  border: <%=xcolor%>; border-style: solid; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 1px}
.sx {  border: <%=xcolor%>; border-style: solid; border-top-width: 1px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px}
.bk1 {
	border: 1px solid #D8D8D8;
	color: #CCCCCC;
}
-->
</style>
<link href="news.css" rel="stylesheet" type="text/css">
</head>

<!--#include file=include/top.asp-->
<body link="#FFFFFF" alink="#FFFFFF" topmargin="0">
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="5" background="images/bgimg_left.gif">&nbsp;</td>
    <td><table width="768" border="0" cellspacing="0" cellpadding="5" align="center" height="400" bgcolor="#FFFFFF">
        <tr> 
          <td width="551" height="500" valign="top"> 
            <%  
    type_id=request.querystring("id") 
   Set rs = Server.CreateObject("ADODB.Recordset")
sql= "SELECT * FROM photo_type where id=" &type_id 
rs.open sql,conn,1,1
%>
            <table width='100%' border='0' cellspacing='0' cellpadding='0' class='x'>
              <tr> 
                <td>当前位置:<a class=bai1 href="default.asp">首页</a>>><a  class=bai1 href="photo.asp">学校影集</a>>> 
                  <%=rs("name")%></td>
              </tr>
            </table>
            <% rs.close %>
            <%
Response.Write"<table width='100%' border='0' cellspacing='0' cellpadding='16'>"

Dim ipagecount
Dim ipagecurrent
Dim strorderBy
Dim irecordsshown  
if request.querystring("page")="" then
ipagecurrent=1
else
ipagecurrent=cint(request.querystring("page"))
end if
type_id=request.querystring("id") 
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "SELECT minipic,ck,name,id FROM photo_show where typeid="&type_id&" ORDER BY id DESC" 
rs.pagesize = 16
rs.cachesize = 16
rs.open sql,conn,1,1
ipagecount = rs.pagecount
If ipagecurrent > ipagecount Then ipagecurrent = ipagecount
If ipagecurrent < 1 Then ipagecurrent = 1
if ipagecount=0 then
response.write "<tr><td align='center'>没有任何文件</tr></td>" 
else
rs.absolutepage = ipagecurrent
irecordsshown = 0
do while irecordsshown<16 and NOT rs.EOF
Response.Write"<tr align='center'>"
Response.Write"<td width='25%'>"
if not rs.eof then
Response.Write" <table align=center bgcolor='#ffffff' border=0 cellpadding=5 cellspacing=0 class='bk1'><tbody><td><a class=bai1 href='photo_display.asp?id="&rs("id")&"' target='_blank'><img src='"&rs("minipic")&"' border='0' width=141 height=105 class='bk'></a></td></tbody></table><br>"&rs("name")&"| 人次:"&rs("ck")&"</td>"
irecordsshown = irecordsshown +1
rs.movenext 
end if

Response.Write"<td width='25%'>"
if not rs.eof then
Response.Write"<table align=center bgcolor='#ffffff' border=0 cellpadding=5 cellspacing=0 class='bk1'><tbody><td><a class=bai1 href='photo_display.asp?id="&rs("id")&"' target='_blank'><img src='"&rs("minipic")&"' border='0' width=141 height=105 class='bk'></a></td></tbody></table><br>"&rs("name")&" | 人次:"&rs("ck")&"</td>"
irecordsshown = irecordsshown +1
rs.movenext 
end if

Response.Write"<td width='25%'>"
if not rs.eof then
Response.Write"<table align=center bgcolor='#ffffff' border=0 cellpadding=5 cellspacing=0 class='bk1'><tbody><td><a class=bai1 href='photo_display.asp?id="&rs("id")&"' target='_blank'><img src='"&rs("minipic")&"' border='0' width=141 height=105 class='bk'></a></td></tbody></table><br>"&rs("name")&"| 人次:"&rs("ck")&"</td>"
irecordsshown = irecordsshown +1
rs.movenext 
end if

Response.Write"<td width='25%'>"
if not rs.eof then
Response.Write"<table align=center bgcolor='#ffffff' border=0 cellpadding=5 cellspacing=0 class='bk1'><tbody><td><a class=bai1 href='photo_display.asp?id="&rs("id")&"' target='_blank'><img src='"&rs("minipic")&"' border='0' width=141 height=105 class='bk'></a></td></tbody></table><br>"&rs("name")&"| 人次:"&rs("ck")&"</td>"
irecordsshown = irecordsshown +1
rs.movenext 
end if

Response.Write"</tr>"
loop
end if
rs.Close
set rs=nothing
Response.Write"</table>"

Response.Write"<table width='100%' border='0' cellspacing='0' cellpadding='5' class='s'><tr><td height='20'>每页显示 16 个文件 共有 "&ipagecount&" 页 当前为第 "&ipagecurrent&" 页 "
if ipagecurrent=1 then
Response.Write"首页 | "
else
Response.Write"<a class=bai1 href='photo_show.asp?id="&type_id&"&page=1'>首页</a> | "
end if
if ipagecurrent=1 then
Response.Write"上一页 | "
else
Response.Write"<a class=bai1 href='photo_show.asp?id="&type_id&"&page="&ipagecurrent-1&"'>上一页</a> | "
end if
if ipagecount>ipagecurrent then
Response.Write"<a class=bai1 href='photo_show.asp?id="&type_id&"&page="&ipagecurrent+1&"'>下一页</a> "
else
Response.Write"下一页" 
end if
if ipagecount>ipagecurrent then
Response.Write"| <a class=bai1 href='photo_show.asp?id="&type_id&"&page="&ipagecount&"'>末页</a> "
else
Response.Write"| 末页 "
end if
Response.Write"</td></tr></table>"
%>
          </td>
        </tr>
      </table></td>
    <td width="5" background="images/bgimg_right.gif">&nbsp;</td>
  </tr>
</table>
<!--#include file=include/bottom.asp -->
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?