<%
if Request.Cookies("admindj")<>"1" then
   Response.Write "<BR><BR><BR><BR><center>权限不足，你没有此功能的管理权限"
   Response.end
end if
%>
<html>
<!--#include file = admin_chk.asp -->
<!--#include file = admin_conn.asp -->
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE type="text/css">
<!--
a:link {text-decoration: none; font-family: AdobeSm; color: #000000 }
a:visited {text-decoration: none; color: #000000 }
A:hover {COLOR: green; FONT-FAMILY: "宋体,MingLiU"; TEXT-DECORATION: underline}
body {font-size: 9pt; font-family: 宋体,MingLiU, Arial;color: #000000}
TD {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000;line-height: 120%;table-layout:fixed;word-break:break-all}
p {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000}
input {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000}
body {margin-top: 0; margin-bottom: 0;margin-left:0;margin-right:0; color: #000000}
select {FONT-SIZE: 9PT;font-family: 宋体}
option {FONT-SIZE: 9pt;font-family: 宋体}
textarea {FONT-SIZE: 9pt;font-family: 宋体}
-->
</STYLE>
</head>
<%
editid=trim(Request("editid"))
delid=trim(Request("delid"))
saveid=trim(Request("saveid"))
lb=trim(Request("lb"))

if delid<>"" then
	conn.Execute "delete from [lylb] where ID="&CInt(delid)
end if

if editid="" and saveid="" and lb<>"" then
	conn.Execute "insert into [lylb] ([lb]) values('"&lb&"')"
	Response.Redirect "admin_ly_lb.asp"
elseif editid<>"" and lb="" then
	set rs = Server.CreateObject("ADODB.RecordSet")
	rs.Open "select * from [lylb] where id="&editid&" order by id desc",conn,1,1
	if rs.recordcount<>0 then
		elb=rs("lb")
	end if
	rs.close:set rs=nothing
elseif saveid<>"" and lb<>"" then
	conn.Execute "update [lylb] set [lb]='"&lb&"' where id="&clng(saveid)
	Response.Redirect "admin_ly_lb.asp"
end if
%>
<body>
<br><center>
<form method="POST" action="admin_ly_lb.asp?saveid=<%=editid%>">
	<p><input type="text" name="lb" value='<%=elb%>' size="20">
	<input type="submit" value="提交" name="B1">　　<a href="admin_ly.asp">留言管理</a></p>
</form>
</center>
<div align="center">
	<table border="1" cellpadding="2" cellspacing="0" width="700" id="table1" style="border-collapse: collapse" bordercolor="#C0C0C0">
		<tr>
			<td background="../images/bj3.jpg" height="25" width="334" align="center">
			类别名称</td>
			<td background="../images/bj3.jpg" height="25" width="229" align="center">
			留言数量</td>
			<td background="../images/bj3.jpg" height="25" width="126" align="center">
			操作</td>
		</tr>
<%
set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "select * from [lylb] order by id asc",conn,1,1
while not rs.eof
%>
		<tr>
			<td width="334"><%=rs("lb")%></td>
			<td width="229" align=center>
				<%
					set rs2 = Server.CreateObject("ADODB.RecordSet")
					rs2.Open "select id,lb from [ly] where lb="&rs("id")&" order by id desc",conn,1,1
					Response.Write rs2.recordcount
					rs2.close:set rs2=nothing
				%>
			</td>
			<td width="126" align=center>
			<a href="admin_ly_lb.asp?editid=<%=rs("id")%>">修改</a>　<a onclick='{if(confirm("您确定删除吗?此操作将不能恢复!")){return true;}return false;}' href="admin_ly_lb.asp?delid=<%=rs("id")%>">删除</a></td>
		</tr>
<%
rs.movenext
wend
rs.close:set rs=nothing
%>
		</table>
</div>
</body>

</html>

<%
conn.close
set conn=nothing
%>