📄 viewinfo.asp
字号:
<%
if session("admin_name")="" then
response.write "<script LANGUAGE='javascript'>alert('对不起,登陆超时!');</script>"
response.end
end if
%>
<!--#include file="conn.asp"-->
<!--#include file="../function.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>中国人民大学二手交易网-信息管理</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK
href="../css.css" type=text/css rel=STYLESHEET>
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY>
<%
action=request.QueryString("action")
if action="del" then
infoid=request("Infoid")
set rs=server.createobject("adodb.recordset")
rs.open "select * from info where info_id="&infoid&"",conn,1,1
if not rs.eof then
file=rs("info_pic")
FiLePaTh=Server.MapPath(".")&"\..\"&file
deletefiles(FiLePaTh)
end if
rs.close
sql="delete from info where info_id="&infoid&""
conn.execute(sql)
message="删除成功!"
end if
%>
<DIV align=center>
<TABLE width=601 height="140" border=0 cellPadding=0 cellSpacing=0>
<!--DWLayoutTable-->
<TBODY>
<TR>
<TD width=10 height=38> </TD>
<TD width=579><font color="#FF0000"><%=message%></font></TD>
<TD width=12> </TD></TR>
<TR>
<TD height=75> </TD>
<TD vAlign=top>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<!--DWLayoutTable-->
<TBODY>
<TR>
<TD vAlign=top height=20> <TABLE cellSpacing=1 cellPadding=1 width="100%" bgColor=#00ffff
border=0>
<!--DWLayoutTable-->
<TBODY>
<TR>
<TD width=57 height=20 align="middle" vAlign="center" bgColor="#66CCFF">发布人</TD>
<TD width=194 align="middle" vAlign="center" bgColor=#66ccff>信息标题</TD>
<TD width=107 align="center" vAlign="middle" bgColor=#66CCFF>联系电话</TD>
<TD width=92 align="middle" vAlign="center" bgColor=#66ccff>剩余有效天</TD>
<TD width=60 align="middle" vAlign="center" bgColor=#66ccff>状态</TD>
<TD width=50 align="middle" vAlign="center" bgColor=#66ccff>操作</TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
<%
page=request.querystring("page")
if page="" then page=1
if not(isnumeric(page)) then page=1
if page<1 then page=1
page=int(page)
set rs=server.createobject("adodb.recordset")
sql="select * from [info] order by info_id desc"
rs.open sql,conn,1,1
if rs.eof then
%>
<TR>
<td >暂且没有任何信息</td>
</TR>
<%else
set rs1=server.createobject("adodb.recordset")
rs.pagesize=30
totalrec=rs.recordcount
totalpage=rs.pagecount
if page>totalpage then page=totalpage
rs.absolutepage=page
rs.cachesize=rs.pagesize
i=0
dim info_id(),info_user(),info_title(),info_phone(),info_expiredays(),info_status(),info_kind(),info_date()
do while not rs.eof and (i<rs.pagesize)
i=i+1
redim preserve info_id(i),info_user(i),info_title(i),info_phone(i),info_expiredays(i),info_status(i),info_kind(i),info_date(i)
info_id(i)=rs("info_id")
info_user(i)=rs("info_user")
info_title(i)=rs("info_title")
info_phone(i)=rs("info_phone")
info_expiredays(i)=rs("info_expiredays")
info_status(i)=rs("info_status")
info_kind(i)=rs("info_kind")
info_date(i)=rs("info_date")
rs.movenext
loop
rs.close
for i=1 to ubound(info_id)
%>
<TR>
<TD vAlign=top height=20> <TABLE cellSpacing=1 cellPadding=1 width="100%" bgColor=#00ffff border=0>
<!--DWLayoutTable-->
<TBODY>
<TR>
<TD width=57 height=20 align=middle vAlign=center bgColor=#ffffff><%=info_user(i)%></TD>
<TD width=194 align=left vAlign=center bgColor=#ffffff>[<font color="#FF0000"><%=info_kind(i)%></font>]<%=gotTopic(info_title(i),15)%></TD>
<TD width=107 align=center vAlign=middle bgColor=#FFFFFF><%=info_phone(i)%></TD>
<TD width=92 align=middle vAlign=center bgColor=#ffffff><%if info_status(i)<>"有效" then
response.Write("-")
else
response.write info_expiredays(i)-datediff("d",info_date(i),date())
end if%></TD>
<TD width=60 align=middle vAlign=center bgColor=#ffffff><%=info_status(i)%></TD>
<TD width=50 align=middle vAlign=center bgColor=#ffffff><a href="viewinfo.asp?action=del&Infoid=<%=info_id(i)%>">删除</a></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
<%next
end if%>
<TR>
<TD height=21 valign="top"><table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#00CCFF">
<!--DWLayoutTable-->
<tr>
<td width="211" height="21">#按发布时间倒序排列</td>
<td width="55" align="center" valign="middle">第<%=page%>页</td>
<td width="55" align="center" valign="middle">共<%=totalpage%>页</td>
<td width="55" align="center" valign="middle"><%if page>1 then%><a href="viewinfo.asp?page=<%=page-1%>">上一页</a><%end if%></td>
<td width="55" align="center" valign="middle"><%if page<totalpage then%><a href="viewinfo.asp?page=<%=page+1%>">下一页</a><%end if%></td>
<td width="101" align="center" valign="middle">转到
<select name="menu1" onChange="MM_jumpMenu('self',this,0)">
<%for i=1 to totalpage%>
<option value="viewinfo.asp?page=<%=i%>"><%=i%></option>
<%next
%>
</select>
页 </td>
</tr>
</table></TD>
</TR>
<TR>
<TD height=14> </TD>
</TR>
</TBODY>
</TABLE></TD>
<TD> </TD></TR>
</TBODY></TABLE></DIV>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -