?? gbook.asp
字號:
<!--#include file=conn.asp-->
<!--#include file=cookies.asp-->
<%
dim sql,rs,Allrecord,Pagesize,Allpage,ThisPage,id
if request("page")="" then
ThisPage=1
else
ThisPage=request("page")
end if
if request("del")="ok" then
id=trim(request("id"))
if not isnumeric(id) or id="" then
response.write "<li>參數錯誤!"
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="delete from [gbook] where id="&cstr(id)
rs.open sql,conn,1,3
response.write "<li>刪除成功!"
response.redirect "gbook.asp"
else%>
<script>
function loadThreadFollow(t_id,b_id){
var targetImg =eval("document.all.followImg" + t_id);
var targetDiv =eval("document.all.follow" + t_id);
if ("object"==typeof(targetImg)){
if (targetDiv.style.display!='block'){
targetDiv.style.display="block";
}else{
targetDiv.style.display="none";
}
}
}
</script>
<meta http-equiv="Content-Language" content="zh-cn">
<link href="inc_style.css" rel="stylesheet" type="text/css">
<p align="center">
<img src="img/list_bo.gif"></p>
<div align="center">
<table border="1" cellspacing="0" style="border-collapse: collapse" bordercolor="#CCCCCC" width="76%" cellpadding="0">
<tr>
<td width="88%" height="25" colspan="5" bgcolor="#FEEEBC">
<p align="center"><b>留言反饋信息管理</b></td>
</tr>
<tr>
<td width="88%" height="23" colspan="5"> <b> <a href="?cnmai=3">
列出所有留言</a> <a href="?cnmai=1">列出投訴留言</a>
<a href="?cnmai=2">列出普通留言</a> <a href="?cnmai=4">
沒有回復的留言</a></b></td>
</tr>
<%
dim k,cnmai
cnmai=trim(request("cnmai"))
set rs=server.createobject("adodb.recordset")
Select Case cnmai
Case "1"
sql = "select * from gbook where lx=1 order by id desc"
Case "2"
sql = "select * from gbook where lx=0 order by id desc"
Case "4"
sql = "select * from gbook where hf=0 order by id desc"
Case Else
sql = "select * from gbook order by id desc"
End Select
rs.open sql,conn,1,1
if rs.eof then
response.write "還沒有留言內容!"
response.end
end if
rs.Pagesize=10
Pagesize=rs.Pagesize
Allrecord=rs.Recordcount
Allpage=rs.Pagecount
if ThisPage<1 then
ThisPage=1
end if
On Error Resume Next
rs.move (ThisPage-1)*Pagesize
k=0
%>
<tr>
<td height="25" bgcolor="#FEEEBC" align="center">編號</td>
<td bgcolor="#FEEEBC" align="center">內容</td>
<td align="center" bgcolor="#FEEEBC"> </td>
<td align="center" bgcolor="#FEEEBC"> </td>
<td align="center" bgcolor="#FEEEBC">是否回復</td>
</tr>
<%
do while not rs.eof
%>
<tr>
<td width="4%" height="23" bgcolor="#FFF9EE">
<p align="center"><%=k+1%></td>
<td width="69%" height="23" bgcolor="#FFF9EE"><%=rs("gbook1")%><br>〈<font color="#999999"><%=rs("username")%></font> <font color="#999999"><%=rs("fbsj")%></font>〉</td>
<td width="6%" height="23" align="center" bgcolor="#FFF9EE"><a href="#" ONCLICK="window.open('gbookedit.asp?id=<%=rs("id")%>&chk=2','Sample','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=300,height=150,left=300,top=100')">
<font color="#FF0000">修改</font></a></td>
<td width="6%" height="23" align="center" bgcolor="#FFF9EE"><a href="gbook.asp?del=ok&id=<%=rs("id")%>">
<font color="#FF0000">刪除</font></a></td>
<td width="13%" height="23" align="center" bgcolor="#FFF9EE"><%if rs("hf")=1 then%><span id="followImg<%=k%>" style="CURSOR: hand" onclick="loadThreadFollow(<%=k%>,5)">查看回復</span><%else%><a href="#" ONCLICK="window.open('gbookhf.asp?id=<%=rs("id")%>','Sample','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=200,height=150,left=300,top=100')"><font color="#FF0000">回復留言</font></a><%end if%></td>
</tr>
<tr style="display:none" id="follow<%=k%>">
<td width="88%" height="23" colspan="5">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td width="4%"> </td>
<td width="76%"><font color="#FF6600"><%=rs("gbook2")%></font> 〈<%=rs("hfsj")%>〉[<a href="#" ONCLICK="window.open('gbookhf.asp?id=<%=rs("id")%>&chk=2','Sample','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=200,height=150,left=300,top=100')">修改</a>]</td>
<td width="4%"> </td>
<td width="16%"> </td>
</tr>
</table>
</td>
</tr>
<%
rs.movenext
k=k+1
if k>=Pagesize then exit do
loop
rs.close
set rs=nothing
closedb
%>
</table>
<table border="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111" width="76%" height="20">
<tr>
<td height="20" width="151" align="center" bgcolor="#FEEEBC">
共有 <font color="#CC5200"><%=Allrecord%></font> 條記錄</td>
<td width="181" align="center" bgcolor="#FEEEBC">
共 <font color="#CC5200"><%=Allpage%></font> 頁</td>
<td width="237" align="center" bgcolor="#FEEEBC">
現在是第
<font color="#CC5200"><%=ThisPage%></font> 頁</td>
<td width="198" align="center" bgcolor="#FEEEBC">
<%
if ThisPage<2 then
response.write "<font color=""#808080"">首頁</font> "
response.write "<font color=""#808080"">上一頁</font> "
else
response.write "<a href=?page=1>首頁</a> "
response.write "<a href=?page="&ThisPage-1&">上一頁</a> "
end if
if Allpage-ThisPage<1 then
response.write "<font color=""#808080"">下一頁</font> "
response.write "<font color=""#808080"">尾頁</font> "
else
response.write "<a href=?page="&(ThisPage+1)&">下一頁</a> "
response.write "<a href=?page="&Allpage&">尾頁</a> "
end if
%></td></tr></table></center>
</div>
<%end if%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -