?? phbook.asp
字號(hào):
<!--插入html頭部分以及數(shù)據(jù)庫接口-->
<!--#include file="in_conn.asp"-->
<body>
<!--插入網(wǎng)站置頂-->
<% if u_name="" then
Response.Redirect "log_err.asp"
else
%>
<!--#include file="in_topmb.asp"-->
<% end if %>
<%
'判斷用戶權(quán)限
IF u_power=0 THEN
Response.Redirect "resp.asp?cmd=id_wait"
END IF
%>
<Script language="javascript">
function fanye(){
var strfanye;
strfanye='phbook.asp?page='+txtfanye.value;
location.href(strfanye);
}
</Script>
<table align="center" width="700" height="25" border="0" cellspacing="0" cellpadding="0" class="rdbar"><tr>
<td width="25%" height="100%">
<a href="index.asp">[首頁]</a>-<a href="phbook.asp">[班級相冊]</a>
</td>
<td align="right">
跳到:<input type="text" ID="txtfanye" name="txtfanye" size="4" maxlength="5" class="kong" onKeypress="if (event.keyCode < 48 || event.keyCode > 57) event.returnValue=false;">頁
<input type="button" name="btnfan" value=" GO " class="an" onClick="JavaScript:fanye();" style="line-height:12px; font-size:12px; height:15px" align="absmiddle">
<a href="ph_seek.asp"><img src="img/seek.gif" border="0" hspace="0" vspace="0" align="absmiddle" alt="搜索照片"></a>
</td>
</tr></table>
<%
'分頁的統(tǒng)計(jì)
dim rdcount,pgcount,pgsize
pgsize=6
rdcount=conn.Execute("SELECT COUNT(p_ID) FROM tblphoto WHERE p_belong<0",0,1)(0)
pgcount=Abs(Int(rdcount/pgsize*(-1)))
'獲取傳值
dim curpage
curpage=Request.QueryString("page")
IF isNumeric(Request.QueryString("page")) THEN
curpage=CLng(curpage)
if curpage<1 OR curpage>pgcount then
curpage=1
end if
ELSE
curpage=1
END IF
%>
<%
dim colnum,colmid,pg_i
'定義顯示快捷頁個(gè)數(shù)
colnum=5
colmid=colnum\2
'生成快捷頁的函數(shù)
Sub PageQuick()
%>
<% if rdcount>0 then %>
<a href="phbook.asp?page=1"><font face="webdings" title="頭頁">9</font></a>
<% else %>
<font face="webdings" title="頭頁">9</font>
<% end if %>
<% If curpage>1 Then %>
<a href="phbook.asp?page=<% =curpage-1 %>"><font face="webdings" title="上頁">7</font></a>
<% Else %>
<font face="webdings" title="上頁">7</font>
<% End if %>
<%
'前省略號(hào)的使用
if pgcount>colnum AND curpage-colmid>1 then
Response.Write "…"
end if
IF pgcount<colnum THEN
for pg_i=1 to pgcount
if pg_i<>curpage then
response.write "<a href=phbook.asp?"&"page="&pg_i&">["&pg_i&"]</a>"
else
response.Write "["&pg_i&"]"
end if
next
ELSEIF curpage-1>=colmid AND pgcount-curpage>=colmid THEN
for pg_i=curpage-colmid to curpage+colmid
if pg_i<>curpage then
response.write "<a href=phbook.asp?"&"page="&pg_i&">["&pg_i&"]</a>"
else
response.Write "["&pg_i&"]"
end if
next
ELSEIF curpage-1>=colmid AND pgcount-curpage<colmid THEN
for pg_i=pgcount-colnum+1 to pgcount
if pg_i<>curpage then
response.write "<a href=phbook.asp?"&"page="&pg_i&">["&pg_i&"]</a>"
else
response.Write "["&pg_i&"]"
end if
next
ELSE
for pg_i=1 to 5
if pg_i<>curpage then
response.write "<a href=phbook.asp?"&"page="&pg_i&">["&pg_i&"]</a>"
else
response.Write "["&pg_i&"]"
end if
next
END IF
'后省略號(hào)的使用
if pgcount>colnum AND curpage+colmid<pgcount then
Response.Write "…"
end if
%>
<% If curpage<pgcount Then %>
<a href="phbook.asp?page=<% =curpage+1 %>"><font face="webdings" title="下頁">8</font></a>
<% Else %>
<font face="webdings" title="下頁">8</font>
<% End if %>
<% if rdcount>0 then %>
<a href="phbook.asp?page=<% =pgcount %>"><font face="webdings" title="尾頁">:</font></a>
<% else %>
<font face="webdings" title="尾頁">:</font>
<% end if %>
班級相冊共有照片<font color="<% =cohover %>"><% =rdcount %></font>張 分為<font color="<% =cohover %>"><% =pgcount %></font>頁 每頁<font color="<% =cohover %>"><% =pgsize %></font>張 第<font color="<% =cohover %>"><% =curpage %></font>頁
<%
End Sub
%>
<table align="center" width="700" height="25" border="0" cellspacing="0" cellpadding="0" class="rdd">
<tr>
<td width="120" height="100%">
<a href="photoup.asp">[↑上傳照片]</a>
</td>
<td align="right">
<% call PageQuick() %>
</td>
</tr>
</table>
<table align="center" width="700" height="25" border="0" cellspacing="0" cellpadding="0" class="rdkuang">
<%
IF rdcount<1 THEN
%>
<tr><th width="100%" class="rdkuang"><font class="ft1">抱歉,班級相冊里目前沒有照片!</font></th></tr>
<%
ELSE
sqlstr="SELECT m.ID,m.name,m.sex,m.power,p.* FROM tblmates AS m INNER JOIN tblphoto AS p ON m.name=p.p_author WHERE p.p_belong<0 ORDER BY p.p_idfre DESC"
rs.open sqlstr,conn,1,1
'給分頁所需的中間變量賦值
rs.PageSize=pgsize
'當(dāng)前頁轉(zhuǎn)到指定的頁碼
rs.AbsolutePage=curpage
'開始讀取數(shù)據(jù)
dim icn_sex
FOR i=1 to pgsize
If rs.eof Then
if i mod 2=0 then
Response.Write "<th width='50%' class='rdkuang'> </th></tr>"
end if
EXIT FOR
End If
if i mod 2<>0 then
Response.Write "<tr>"
end if
'身份和性別
IF rs("power")>1 THEN
icn_sex="img/icn_adm1.gif"
ELSEIF rs("sex")=True THEN
icn_sex="img/icn_gg.gif"
ELSE
icn_sex="img/icn_mm.gif"
END IF
'總管判斷
if DEF_sysadm=rs("name") then
icn_sex="img/icn_admsys.gif"
end if
%>
<td align="center" valign="top" width="50%" height="200" class="rdkuang" style="padding:6px;">
上傳人:<img src="<% =icn_sex %>" border="0" align="absmiddle"> <a href="viewinfo.asp?id=<% =rs("ID") %>" title="點(diǎn)擊查看該同學(xué)詳細(xì)資料"><% =rs("name") %></a>
日期:<% =rs("p_date") %>
<table align="center" width="255" height="260" border="0" cellpadding="0" cellspacing="0">
<tr><td width="100%" height="100%" align="center" valign="middle">
<a href="photoview.asp?id=<% =rs("p_ID") %>" target="_blank"><img src="<% =rs("p_url") %>" width="<% =rs("p_w") %>" height="<% =rs("p_h") %>" alt="點(diǎn)擊以原尺寸打開照片" vspace="1" border="0"></a>
</td></tr>
</table>
<table align="center" width="100%" height="25" border="0" cellpadding="0" cellspacing="0" class="intbl">
<tr><td width="100%" align="center" valign="top" class="rdbar">
<a href="photoview.asp?id=<% =rs("p_ID") %>" target="_blank">
品頭論足:
<%
if rs("p_belong")=-1 then
%>
<img src="img/phmark/1.gif" align="absmiddle" border="0">(<b>0</b>)
<img src="img/phmark/2.gif" align="absmiddle" border="0">(<b>0</b>)
點(diǎn)擊:<% =rs("p_emo") %>
<%
else
if ABS(rs("p_belong"))<100000 then
phgood=0
phbad=ABS(rs("p_belong"))-1
else
phgood=ABS(rs("p_belong"))\100000
phbad=(ABS(rs("p_belong")) mod 100000)-1
end if
%>
<img src="img/phmark/1.gif" align="absmiddle" border="0">(<b><% =phgood %></b>)
<img src="img/phmark/2.gif" align="absmiddle" border="0">(<b><% =phbad %></b>)
點(diǎn)擊:<% =rs("p_emo") %>
<%
end if
%>
</a>
<a href="photo_del.asp?id=<% =rs("p_ID") %>" title="刪除該照片(前提:你必須是照片上傳人或者班級管理員)" onClick='javaScript:return confirm("你確定要?jiǎng)h除這張照片嗎?");'>[刪除]</a>
</td></tr>
<tr><td width="100%" valign="top" class="rde">
注語:
<%
if rs("p_tip")="" then
Response.Write "無"
else
Response.Write unhtml(rs("p_tip"))
end if
%>
</td></tr>
</table>
</td>
<%
if i mod 2=0 then
Response.Write "</tr>"
end if
rs.MoveNext
Next
rs.close
END IF
%>
</table>
<table align="center" width="700" height="25" border="0" cellspacing="0" cellpadding="0" class="rdd">
<tr>
<td width="120" height="100%">
<a href="photoup.asp">[↑上傳照片]</a>
</td>
<td align="right">
<% call PageQuick() %>
</td>
</tr>
</table>
<!--插入在線統(tǒng)計(jì)-->
<!--#include file="in_online.asp"-->
<!--插入網(wǎng)站置底-->
<!--#include file="in_bottom.asp"-->
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -