📄 manageshequ.asp
字号:
<!--#include file="conn.asp"-->
<%call time_out()%>
<%
if instr(session("proview"),"s4")=0 then
response.Write "<script language=javascript>alert('您无权操作!');window.location.href='index.asp';</script>"
response.end
end if%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<%sq_title=trim(request("sq_title"))
sqid=trim(request("sqid"))
action=trim(request("action"))
id=trim(request("id"))
if action="del" then
conn.execute("delete from shequ where id="&id)
response.redirect("manageshequ.asp")
end if
%>
<form name="form1" method="post" action="manageshequ.asp?action=search">
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#f0f0f0" bordercolordark="#FFFFFF">
<tr>
<td width="15%" height="25"> </td>
<td>文章标题:</td>
<td><input name="sq_title" type="text" size="20"></td>
<td>所属类别:</td>
<td><select name="sqid">
<option value="">请选择</option>
<%sql="select * from shequ_big"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then%>
<option value="">暂无类别</option>
<%else
do while not rs.eof%>
<option value="<%=rs("sqid")%>" <%If trim(rs("sqid"))=sqid then%>selected<%end if%>><%=rs("sqname")%></option>
<%rs.movenext
loop
end if
rs.close:set rs=nothing%>
</select></td>
<td>
<input type="submit" name="Submit" value="查询"> </td>
<td width="15%"> </td>
</tr>
</table></form>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr align="center" bgcolor="6699cc">
<td width="40%" height="25">标题</td>
<td>发表人</td>
<td>联系电话</td>
<td>所属类别</td>
<td>回复</td>
<td>删除</td>
</tr>
<%
set rs=server.createobject("adodb.recordset")
if action="search" then
sql="select * from shequ where 1=1"
if sq_title<>"" then
sql=sql & " and sq_title like '%"&sq_title&"%'"
end if
if sqid<>"" then
sql=sql & " and sqid = "&sqid
end if
sql = sql & " order by addtime,sqid DESC"
else
sql="select * from shequ order by addtime,sqid DESC"
end if
rs.open sql,conn,1,1
if rs.eof and rs.bof then%>
<tr><td colspan="6" height="25">暂无记录</td></tr>
<%
else
rs.pagesize=18
page = cint(request("page"))
if page = "" then page = 1
if not(isnumeric(page)) then page=1
if page<1 then page=1
if page >= rs.pagecount then page = rs.pagecount
rs.absolutepage = page
for j=1 to rs.PageSize
if (j mod 2)<>0 then
bgcolor="ffffff"
else
bgcolor="CBDDE7"
end if
%>
<tr align="center" bgcolor="<%=bgcolor%>">
<td height="25"><%=rs("sq_title")%></td>
<td><%=rs("link_man")%></td>
<td><%=rs("link_tel")%></td>
<td>
<%set rsg=server.createobject("adodb.recordset")
rsg.open"select * from shequ_big where sqid="&trim(rs("sqid")),conn,1,1
response.write (rsg("sqname"))
rsg.close:set rsg=nothing%>
</td>
<td>
<a href="javascript:;" onClick="javascript:window.open('huifu.asp?id=<%=rs("id")%>','','width=450,height=400,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;">
回复</a>
<%if trim(rs("replay"))<>"" then
response.write("[已回复]")
else
response.write("<font color=red>[未回复]</font>")
end if%>
</td>
<td><a href="manageshequ.asp?action=del&id=<%=rs("id")%>" onClick="return confirm('确定删除?')">删除</a></td>
</tr>
<%rs.movenext
if rs.eof then exit for
next
%>
<tr>
<td height="25" colspan="6" align="center">
<p align="center">共有记录<%=rs.recordcount%>条
<%=page%>/<%=rs.pagecount%> <A href="<%request.servervariables("document_name")%>?page=<%=page-1%>&action=<%=action%>&sq_title=<%=sq_title%>&sqid=<%=sqid%>">上一页</A> <A href="<%request.servervariables("document_name")%>?page=<%=page+1%>&action=<%=action%>&sq_title=<%=sq_title%>&sqid=<%=sqid%>">下一页</A> 转到第 <SELECT onChange="window.location='?action=<%=action%>&sq_title=<%=sq_title%>&sqid=<%=sqid%>&page='+this.value" name=gopage>
<%for x=1 to rs.pagecount%>
<OPTION <%if x=page then%>selected<%end if%> value=<%=x%>><%=x%></OPTION>
<%next%>
</SELECT> 页 </td>
</tr>
<%
end if
rs.close
set rs=nothing
%>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -