📄 ph_seek_out.asp
字号:
<!--插入html头部分以及数据库接口-->
<!--#include file="in_conn.asp"-->
<body>
<!--插入网站置顶-->
<% if u_name="" then
Response.Redirect "log_err.asp"
else
%>
<!--#include file="in_topmb.asp"-->
<% end if %>
<%
'判断用户权限
IF u_power=0 THEN
Response.Redirect "resp.asp?cmd=id_wait"
END IF
%>
<table align="center" width="700" height="25" border="0" cellspacing="0" cellpadding="0" class="rdbar"><tr>
<td width="100%" height="60%">
<a href="index.asp">[首页]</a>-<a href="phbook.asp">[班级相册]</a>-[搜索结果]
</td>
<td align="right">
<a href="ph_seek.asp"><img src="img/seek.gif" border="0" hspace="0" vspace="0" align="absmiddle" alt="搜索照片"></a>
</td>
</tr></table>
<%
'分页的统计
dim rdcount,pgcount,pgsize
pgsize=6
'获取传值
dim curpage
dim curowner,fndtip,fndowner
fndtip=""
fndowner=""
curpage=Request.QueryString("page")
curowner=trim(CStr(Request.QueryString("owner")))
dim vvvsql,vvvhttp,tipseek,vvvand
IF curowner<>"" THEN
vvvhttp="ph_seek_out.asp?owner="&curowner&"&"
vvvsql="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 AND p.p_author='"&curowner&"' ORDER BY p.p_idfre DESC"
'统计
rdcount=conn.Execute("SELECT COUNT(p.p_ID) FROM tblphoto AS p WHERE p.p_belong<0 AND p.p_author='"&curowner&"'",0,1)(0)
pgcount=Abs(Int(rdcount/pgsize*(-1)))
tipseek="以下列出:<b>"&curowner&"</b>上传的所有照片,共有<font color=red>"&rdcount&"</font>张"
ELSE
if trim(Request.QueryString("fjer"))="" AND trim(Request.QueryString("fjtip"))="" then
fndtip=trim(Request.Form("txttip"))
fndowner=trim(Request.Form("txtowner"))
else
fndtip=trim(Request.QueryString("fjtip"))
fndowner=trim(Request.QueryString("fjer"))
end if
if fndtip="" AND fndowner="" then
Response.Redirect("resp.asp?cmd=seeknotkey")
elseif Len(fndtip)>0 AND Len(fndowner)>0 then
vvvand=" p.p_author LIKE '%"&stryin(fndowner)&"%' AND p.p_tip LIKE '%"&stryin(fndtip)&"%' "
elseif Len(fndtip)>0 then
vvvand=" p.p_tip LIKE '%"&stryin(fndtip)&"%' "
elseif Len(fndowner)>0 then
vvvand=" p.p_author LIKE '%"&stryin(fndowner)&"%' "
end if
vvvhttp="ph_seek_out.asp?fjer="&fndowner&"&fjtip="&fndtip&"&"
vvvsql="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 AND "&vvvand&" ORDER BY p.p_idfre DESC"
'统计
rdcount=conn.Execute("SELECT COUNT(p.p_ID) FROM tblphoto AS p WHERE p.p_belong<0 AND "&vvvand,0,1)(0)
pgcount=Abs(Int(rdcount/pgsize*(-1)))
tipseek="以下列出:注语关键字'<b>"&fndtip&"</b>'、上传者关键字'<b>"&fndowner&"</b>' 的所有相关照片,共有<font color=red>"&rdcount&"</font>张"
END IF
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
'定义显示快捷页个数
colnum=5
colmid=colnum\2
'生成快捷页的函数
Sub PageQuick()
%>
<% if rdcount>0 then %>
<a href="<% =vvvhttp %>page=1"><font face="webdings" title="头页">9</font></a>
<% else %>
<font face="webdings" title="头页">9</font>
<% end if %>
<% If curpage>1 Then %>
<a href="<% =vvvhttp %>page=<% =curpage-1 %>"><font face="webdings" title="上页">7</font></a>
<% Else %>
<font face="webdings" title="上页">7</font>
<% End if %>
<%
'前省略号的使用
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="&vvvhttp&"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="&vvvhttp&"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="&vvvhttp&"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="&vvvhttp&"page="&pg_i&">["&pg_i&"]</a>"
else
response.Write "["&pg_i&"]"
end if
next
END IF
'后省略号的使用
if pgcount>colnum AND curpage+colmid<pgcount then
Response.Write "…"
end if
%>
<% If curpage<pgcount Then %>
<a href="<% =vvvhttp %>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="<% =vvvhttp %>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">
<tr><td width="100%">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" class="rde">
<tr>
<td width="100%" height="25">
<% =tipseek %>
</td>
</tr>
</table>
</td></tr>
</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>
<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>
<br><a href='javascript:history.go(-1);'>[点击这里<Font color=red>返回</Font>]</a><br>
</th></tr>
<%
ELSE
sqlstr=vvvsql
rs.open sqlstr,conn,1,1
'给分页所需的中间变量赋值
rs.PageSize=pgsize
'当前页转到指定的页码
rs.AbsolutePage=curpage
'开始读取数据
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="点击查看该同学详细资料"><% =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="点击以原尺寸打开照片" 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>)
点击:<% =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>)
点击:<% =rs("p_emo") %>
<%
end if
%>
</a>
<a href="photo_del.asp?id=<% =rs("p_ID") %>" title="删除该照片(前提:你必须是照片上传人或者班级管理员)" onClick='javaScript:return confirm("你确定要删除这张照片吗?");'>[删除]</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>
<!--插入在线统计-->
<!--#include file="in_online.asp"-->
<!--插入网站置底-->
<!--#include file="in_bottom.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -