<!--#include file="include/conn.asp"-->
<%Call limsss(sQxa,"$$webBook$$")%>
<%
Dim sc,a1,a2,a3

'排列的字段
If a2="" Then
a2 = "Id"
end if
'排列的顺序
If a3 = 0 Then 
sc = "DESC"
Else 
sc = "ASC"
End If


'删除
If Request("ReUrl")="Del" then
		set ors=Server.CreateObject("ADODB.Recordset")
		sSql="delete from [LstBook] WHERE Id = "&Id&" "
		ors.open sSql,oconn,1,3
		set ors=nothing
		Call Backurl("?gaozhen=mylist")
End if


'批量删除
If Request("ReUrl")="AllDel" then
Dim arrdel
arrdel=Request("Id")
sSql="delete from [LstBook] where Id in ("&arrdel&")"
oconn.Execute sSql
	Call Alert("批量删除成功！","?gaozhen=mylist")
set oconn=nothing
End If

%>
<html>
<title>留言管理</title>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../css/lst.css" rel="stylesheet" type="text/css" />
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2"><tr><td height="31"><div class="titlebt">留言管理</div></td></tr></table>
<table border="1" width="100%" cellpadding="2" style="border-collapse: collapse" bordercolor="#B5D0D9" bgcolor="#FFFFFF">
	<tr>
		<td>
<%
select case gaozhen
case "mylist" call mylist()
case "myedit" call myedit()
End select
%>
<%sub myedit%>
<%
oConn.Execute("UPDATE [LstBook] SET state= 1 where Id = "&Id)
set oRs=server.createobject("adodb.recordset")
sSql="Select * FROM [LstBook] where Id = "&Id
oRs.open sSql,oconn,1,1

%>
<table border="1" width="100%" id="table3" bgcolor="#FFFFFF" style="border-collapse: collapse" bordercolor="#F6F6F6" cellspacing="0">


<tr>
<td class="rightbt" height="25" align="right">姓名:</td>
<td class="smltd" height="25"><%=oRs("xm")%></td>
</tr>
<tr>
<td class="rightbt" height="25" align="right">ＱＱ:</td>
<td class="smltd" height="25"><%=oRs("QQ")%></td>
</tr>

<tr>
<td class="rightbt" height="25" align="right">电话:</td>
<td class="smltd" height="25"><%=oRs("sj")%></td>
</tr>


<tr>
<td class="rightbt" height="25" align="right">信箱:</td>
<td class="smltd" height="25"><%=oRs("email")%></td>
</tr>


<tr>
<td class="rightbt" height="25" align="right">地址:</td>
<td class="smltd" height="25"><%=oRs("dz")%></td>
</tr>

<tr>
<td class="rightbt" height="25" align="right">留言:</td>
<td class="smltd" height="25">
<textarea class="conent300" name="ly" rows="6" cols="53"><%=oRs("ly")%></textarea>
</td>
</tr>


<tr>
<td class="rightbt" height="25" align="right">时间:</td>
<td class="smltd" height="25"><%=oRs("time")%></td>
</tr>
</table>
<%end sub%>
<%sub mylist()%>
        <table border="1" width="100%" id="table3" cellpadding="0" style="border-collapse: collapse" bordercolor="#E0EAED">
			<tr>
				<td height="28" class="left_txt" bgcolor="#E0EAED" align="center">
				<b>姓名</b></td>
				<td height="28" class="left_txt" bgcolor="#E0EAED" align="center">
				<b>手机</b></td>
				<td height="28" class="left_txt" bgcolor="#E0EAED" align="center">
				<b>时间</b></td>
				<td height="28" class="left_txt" bgcolor="#E0EAED" align="center">
				<b>是否查看</b></td>
				<td height="28" class="left_txt" bgcolor="#E0EAED" align="center">
				<b>查看</b></td>
				<td height="28" bgcolor="#E0EAED" class="left_txt" align="center">
				<b>删除</b></td>
			</tr>
			
<%
page = request("page") 
Set oRs=server.createobject("adodb.recordset")
sSql="select * from [LstBook] order by Id  desc"
oRs.open sSql,oConn,1,1
if oRs.bof and oRs.eof Then
response.write "暂无数据..."
Else

Dim pagecount,page,pagcount,total,PP  '定义变量
total=oRs.recordcount     '读取信息数目
oRs.PageSize=30      '设置页码 
pagecount=oRs.PageCount    '获取总页码 
page=int(page)       '接收页码 
if page<=0 then page=1     '判断页码
oRs.AbsolutePage=page     '本页页码
PP = total-(page-1)*oRs.PageSize
If PP > oRs.PageSize Then
PP = oRs.PageSize
Else
PP = total-(page-1)*oRs.PageSize
End If
for i=1 to PP 
%>

			<tr>
				<td height="28" class="left_txt3" align="center"><a href=?gaozhen=myedit&Id=<%=oRs(0)%>><%=oRs("xm")%></a></td>
				<td height="28" class="left_txt3" align="center"><%=oRs("sj")%></td>
				<td height="28" class="left_txt3" align="center"><%=oRs("time")%></td>
				<td height="28" class="left_txt3" align="center"><%If oRs("state")= 0 Then%><b><font color="#FF0000">未看</font></b><%else%><b><font color="#88A072">已看</font></b><font color="#00FF00"><%end if%></font></td>
				<td height="28" class="left_txt3" align="center"><a href="?gaozhen=myedit&Id=<%=oRs(0)%>"><img src=../images/ico/look.gif></a></td>
				<td height="28" class="left_txt" align="center">
				<a href="?ReUrl=Del&Id=<%=oRs(0)%>"><img src=../images/ico/del.gif></a></td>
			</tr>
<%
oRs.movenext 
next 
end if
%>
			<tr>
				<td height="28" colspan="8" class="left_txt2">
				<table border="0" width="100%" cellspacing="3" cellpadding="3">
					<tr>
						<td align="center" height="30"><%Call PageUrl("?gaozhen=mylist",30)%></td>
					</tr>
				</table>
				</td>
		 </tr>
     </table>
<%End sub%>


</td>
	</tr>
</table>

</body>
</html>