📄 view_copy1.asp
字号:
<% if session("sysop")<>True then
response.redirect "adminpass.asp"
end if
%>
<%
response.buffer=true
Response.Expires=0
keys=Request("keys")
if keys="DeleteID" then
delete_user_list
end if
%>
<%
sub delete_user_list()
'chk_admin_password
UserID=Request.Form("UserID")
Set conn = Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("data/feedback.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
Set rs = Server.CreateObject("ADODB.Recordset")
currentPage=Session("currentPage")
sql="DELETE * from feedbackinfo where ID="+UserID
rs.open sql,conn,3,2
response.write "<script language='javascript'>" & chr(13)
response.write "alert('已经成功删除该留言!');" & Chr(13)
response.write "window.document.location.href='view.asp?page=" & currentPage & "';"&Chr(13)
response.write "</script>" & Chr(13)
End sub
%>
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>查看反馈信息</title>
<style>
<!--
.p9 { font-size: 9pt}
.p11 { font-size: 11pt}
TD { FONT-SIZE: 12px}
A:link {
COLOR: #ff0000; FONT-SIZE: 12px; LINE-HEIGHT: 17px; TEXT-DECORATION: none
}
A:hover {
COLOR: #0000ff; FONT-SIZE: 12px; LINE-HEIGHT: 17px; TEXT-DECORATION: none
}
A:active {
COLOR: #00ff00; FONT-SIZE: 12px; LINE-HEIGHT: 17px; TEXT-DECORATION: none
}
A:visited {
COLOR: #ff0000; FONT-SIZE: 12px; LINE-HEIGHT: 17px; TEXT-DECORATION: none
}
-->
</style>
</head>
<%
const MaxPerPage=5
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim typename
typename="messages"
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0">
<table align=center border=0 cellpadding=0 cellspacing=0 height=70 width=724>
<tbody> </tbody>
</table>
<table align=center border=0 cellpadding=0 cellspacing=0 width=720>
<tbody>
<tr bgcolor=#333333>
<td height=1 width="36%"></td>
<td height=1 width="64%"></td>
</tr>
<tr bgcolor="#30b574">
<td height=16 valign=bottom width="36%"><b><font color=#ffffff style="font:11pt">查看、管理反馈信息
</font></b> </td>
<td height=16 valign=bottom width="64%" align=right>请选择显示信息类型
<select name="select">
<option selected>所有类型</option>
<option>简单的留言</option>
<option>对网站的意见</option>
<option>给公司的建议</option>
<option>购买及合作意向</option>
<option>产品投诉</option>
<option>服务投诉</option>
</select>
</td>
</tr>
<tr bgcolor=#333333>
<td height=1 width="36%"></td>
<td height=1 width="64%"></td>
</tr>
</tbody>
</table>
<table border="0" width="92%" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="100%">
<% if Request("lx")<>"" then
session("lx")=request("lx")
end if
if Session("lx")="" then
Session("lx")="all"
end if %><font color=blue style="font:11pt">
<br>反馈信息类型:<% select case Session("lx")
case "A1"
Response.Write "简单的留言 "
case "A2"
Response.Write "对网站的意见 "
case "A3"
Response.Write "给公司的建议 "
case "A4"
Response.Write "购买及合作意向 "
case "A5"
Response.Write "产品投诉 "
case "A6"
Response.Write "服务投诉 "
case "all"
response.write "所有类型"
End select
%></font>
<%
if Request.QueryString("searchname")<>null or Request.QueryString("searchname")<>"" then
searchname=Request.QueryString("searchname")
end if
'response.write lx
'response.write searchname
sql="SELECT * FROM feedbackinfo "
if searchname<>"" then
if searchname<>"reset" then
sql=sql & " where title LIKE "
sql=sql & "'%"
sql=sql & searchname
sql=sql & "%'"
sql=sql & " or "
sql=sql & " name LIKE "
sql=sql & "'%"
sql=sql & searchname
sql=sql & "%'"
sql=sql & " or "
sql=sql & " comment LIKE "
sql=sql & "'%"
sql=sql & searchname
sql=sql & "%'"
else
searchname=null
end if
if Session("lx")="all" then
sql = sql & "order by ID DESC"
else
sql = sql & "where leixing=" & Session("lx") &" order by ID DESC"
end if
else
if Session("lx")="all" then
sql = sql & "order by ID DESC"
else
sql = sql & "where leixing='" & session("lx") &"' order by ID DESC"
end if
end if
'Response.Write sql
%>
<%
dim sql
dim rs
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'> 还 没 有 任 何 相 关 信 息 </p>"
else
totalPut=rs.recordcount
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPage,"view.asp"
showContent
showpage totalput,MaxPerPage,"view.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,"view.asp"
showContent
showpage totalput,MaxPerPage,"view.asp"
else
currentPage=1
showpage totalput,MaxPerPage,"view.asp"
showContent
showpage totalput,MaxPerPage,"view.asp"
end if
end if
Session("currentPage")=currentPage
rs.close
end if
set rs=nothing
conn.close
set conn=nothing
sub showContent
dim i
i=0
%>
<% if searchname<>null or searchname<>"" then
Response.write("搜索关键字<font color=red>" & searchname & "</font>的结果如下:")
end if
%>
<div align="center">
<table border="0" cellspacing="1" width="720" cellpadding="1" bgcolor="#666666">
<tr>
<td width="53" align="center" height="20" bgcolor="#30b574">编号</td>
<td width="208" align="center" bgcolor="#30b574">主题<font color=blue>[点击主题查看详细信息]</font></td>
<td width="100" align="center" bgcolor="#30b574">类型</td>
<td width="70" align="center" bgcolor="#30b574">留言者</td>
<td width="121" align="center" bgcolor="#30b574">电子邮件</td>
<td width="143" align="center" bgcolor="#30b574">日期</td>
</tr>
<% do while not rs.eof %>
<tr>
<td height="23" width="53" bgcolor="ffffec">
<p align="center"><%=rs("ID")%>
</td>
<td width="208" bgcolor="ffffec">
<p align="left">
<a href="#" onclick="javascript:window.open('viewdetail.asp?info_id=<% =rs("ID") %>','InfoDetail','toolbar=no,scrollbars=yes,resizable=yes,top=0,left=0,width=460 height=360');"><%=rs("title")%></a>
</td>
<td width="100" align=center bgcolor="ffffec"><font color=ff0000><b>
<%
select case rs("leixing")
case "A1"
Response.Write "简单的留言 "
case "A2"
Response.Write "对网站的意见 "
case "A3"
Response.Write "给公司的建议 "
case "A4"
Response.Write "购买及合作意向 "
case "A5"
Response.Write "产品投诉 "
case "A6"
Response.Write "服务投诉 "
End select
%></b></font> </td>
<td width="70" align=center bgcolor="ffffec"> <%=rs("name")%> </td>
<td width="121" bgcolor="ffffec">
<p align="center"><%=rs("email")%>
</td>
<td width="143" bgcolor="ffffec">
<p align="center"><%=rs("mess_date")%>  <%=rs("mess_time")%>
</td>
</tr>
<tr>
<td width="53" bgcolor="ffffff"> </td>
<td colspan=5 bgcolor="ffffff">信息内容:<br>
<br>
<font color=green><% =rs("comment") %> </font>
<p align=right><form action="view.asp" method="post">
<input name="keys" type="hidden" value="DeleteID">
<input name="UserID" type="hidden" value="<%=rs("ID")%>">
<input type="submit" style="background-color: rgb(255,255,224);border:1px double rgb(88,88,88);font-size: 9pt" value="=删 除=" name="B3">
</form> </td>
</tr>
<% i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
</div>
<%
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<form method=Get action="&filename&"><table align=center width=720 height=18 border=0 bgcolor=rgb(255,255,220) style=""border:1px double rgb(255,153,0)"">"
response.write "<tr><td width=10 align=center></td><td><p align=center><font color='#000080'></font> "
if CurrentPage<2 then
response.write "<font color='#000080'>首页 上一页</font> "
else
response.write "<a href="&filename&"?page=1&>首页</a> "
response.write "<a href="&filename&"?page="&CurrentPage-1&">上一页</a> "
end if
if n-currentpage<1 then
response.write "<font color='#000080'>下一页 尾页</font>"
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)
response.write ">下一页</a> <a href="&filename&"?page="&n&">尾页</a>"
end if
response.write "<font color='#000080'> 页次:</font><strong><font color=red>"&CurrentPage&"</font><font color='#000080'>/"&n&"</strong>页</font> "
response.write "<font color='#000080'> 共<b>"&totalnumber&"</b>条信息 <b>"&maxperpage&"</b>篇/页</font></span><td> "
response.write "<td><font color='#000080'>转到:</font><input type='text' name='page' size=4 maxlength=10 style=""background-color: rgb(255,255,255);border:1px double rgb(88,88,88);"" value="¤tpage&">"
response.write "<font color='#000080'>搜索:</font><input type='text' name='searchname' size=10 maxlength=10 style=""background-color: rgb(255,255,255);border:1px double rgb(88,88,88);""><input type=""submit"" value=""提交/返回"" style=""background-color: rgb(255,255,220);font:12px"">"
response.write "</td></tr></table></form>"
end function
%>
</td>
</tr>
</table>
<br>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -