<%
if Request.Cookies("admindj")<>"1" then
   Response.Write "<BR><BR><BR><BR><center>权限不足，你没有此功能的管理权限"
   Response.end
end if
%>
<!--#include file = admin_chk.asp -->
<!--#include file = admin_conn.asp -->
<!--#include file = titleb.asp -->
<%



%>
<head>
<!--#include file = language.asp -->
<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;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;}
option       {FONT-SIZE: 9pt;}
textarea     {FONT-SIZE: 9pt;}
-->
</STYLE>
</head>
<BR>
<%
viewid=trim(request("viewid"))
delid=trim(request("delid"))
hyid=trim(request("hyid"))
shid=trim(Request("shid"))
sh=trim(Request("sh"))
content=trim(request("content"))
addtime=date()

if shid<>"" and sh<>"" then
	conn.Execute "update [ly] set [sh]="&sh&" where id="&clng(shid)
end if
if hyid<>"" and content<>"" then
  userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
  If userip = "" Then userip = Request.ServerVariables("REMOTE_ADDR")
  Set rs2 = Server.CreateObject("ADODB.RecordSet")
  rs2.Open "select * from [lyhf] where lyid="&hyid&" order by id desc",conn,1,3
  if rs2.recordcount=0 then
    conn.Execute "insert into [lyhf] ([lyid],[content],[addtime],[tx],[ip]) values('"&hyid&"','"&content&"','"&addtime&"','../images/ly-00.gif','"&userip&"')"
  else
    rs2("content")=content
    rs2("addtime")=now()
    rs2.update
  end if
end if
if delid<>"" then
   conn.Execute "delete from [ly] where ID="&CInt(delid)
   conn.Execute "delete from [lyhf] where lyID="&CInt(delid)
end if  
if viewid<>"" then

Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "select * from [ly] where id="&viewid&" order by id desc",conn,1,1
if rs.recordcount<>0 then

set rs2 = Server.CreateObject("ADODB.RecordSet")
rs2.Open "select * from [lylb] where id="&rs("lb")&" order by id desc",conn,1,1
while not rs2.eof
	lb=rs2("lb")
rs2.movenext
wend
rs2.close:set rs2=nothing

%>
	<table align=center border="1" cellpadding="5" width="700" id="table2" style="border-collapse: collapse" bordercolor="#C0C0C0" bgcolor="#FFFFFF">
		<tr>
			<td width="700" align="center" background="../images/bg1.gif" colspan="2">
			　<font color="#FFFFFF"><%=rs("title")%></font><font color="#FFFF00">(<%=lb%>)</font></td>
		</tr>
		<tr>
			<td width="201" align="center" style="line-height: 150%" valign="top"><img border=1 src=<%=rs("tx")%>>
			<div align="center">
			<table border="0" cellpadding="2" cellspacing="0" width="201" id="table3">
			<tr>
			<td width="74" align="right">姓名：</td>
			<td width="127"><%=rs("adduser")%></td>
			</tr>
			<tr>
			<td width="74" align="right">来自：</td>
			<td width="127"><%=rs("ip")%></td>
			</tr>
			<tr>
			<td width="74" align="right">邮箱：</td>
			<td width="127"><a href="mailto:<%=rs("email")%>"><img border="0" src="../images/lymail.gif" width="16" height="16"></a></td>
			</tr>
			<tr>
			<td width="74" align="right">时间：</td>
			<td width="127"><%=rs("addtime")%></td>
			</tr>
			</table>
	</div>
			</td>
			<td width="476" valign="top"><%=rs("content")%></td>
		</tr>
		<!--webbot BOT="GeneratedScript" PREVIEW=" " startspan --><script Language="VBScript" Type="text/vbscript"><!--
function FrontPage_Form1_onsubmit()
  Set theForm = document.FrontPage_Form1

  If (theForm.content.value = "") Then
    MsgBox "请在 回复 域中输入值。", 0, "有效性验证错误"
    theForm.content.focus()
    FrontPage_Form1_onsubmit = False
    Exit Function
  End If

  If (Len(theForm.content.value) < 1) Then
    MsgBox "在 回复 域中，请至少输入 1 个字符。", 0, "有效性验证错误"
    theForm.content.focus()
    FrontPage_Form1_onsubmit = False
    Exit Function
  End If
  FrontPage_Form1_onsubmit = True 
End Function
--></script><!--webbot BOT="GeneratedScript" endspan --><form method="POST" action="admin_ly.asp?hyid=<%=viewid%>" name="FrontPage_Form1"><tr>
			<td width="677" align="center" style="line-height: 150%" valign="top" colspan="2">
			<%
			Set rs2 = Server.CreateObject("ADODB.RecordSet")
			rs2.Open "select * from [lyhf] where lyid="&viewid&" order by id desc",conn,1,1
			if rs2.recordcount<>0 then
			  content=rs2("content")
			end if
			%>
				<p>
				&nbsp;<!--webbot bot="Validation" s-display-name="回复" b-value-required="TRUE" i-minimum-length="1" --><textarea rows="9" name="content" cols="96"><%=content%></textarea><br>
				<input type="submit" value="提交" name="B1">&nbsp;&nbsp;&nbsp;&nbsp; <input type="reset" value="重置" name="B2"></p>
			
			</td>
		</tr></form>
	</table>
<%
end if 

end if
%>
<BR>
<div align="center">
	<table border="1" cellpadding="2" width="700" id="table5" style="border-collapse: collapse" bordercolor="#C0C0C0" background="../images/bj3.jpg" height="25">
		<tr>
			<td width="139" align="center"><a href="admin_ly_lb.asp">留言类别管理</a></td>
			<td width="139" align="center"><a target="_blank" href="../ly.asp">ly.asp页面链接</a></td>
			<td width="140" align="center">　</td>
			<td width="140" align="center">　</td>
			<td width="140" align="center">　</td>
		</tr>
	</table>
</div>
<BR></p>
<div align="center">
	<table border="1" cellpadding="4" width="700" id="table1" style="border-collapse: collapse" bordercolor="#C0C0C0">
		<tr>
			<td background="../images/bj5.jpg" align="center" width="362">
			<font color="#FFFFFF">标&nbsp;&nbsp; 题</font></td>
			<td background="../images/bj5.jpg" align="center" width="199">
			<font color="#FFFFFF">发布者和时间</font></td>
			<td background="../images/bj5.jpg" align="center" width="111">
			<font color="#FFFFFF">操&nbsp; 作</font></td>
		</tr>
<%
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "select * from [ly]  order by id desc",conn,1,1

if rs.recordcount<>0 then

page=int(request("page"))
rs.PageSize=20
pagecount=rs.pagesize
if page<=0 then page=1
if request("page")="" then page=1
rs.AbsolutePage=page

for i=1 to pagecount
sh=rs("sh")
%>
		<tr>
			<td width="362">
			<%
			  if rs("bm")="1" then Response.Write "[保密]"
			
			Response.Write titleb(rs("title"),30)
						
			set rs2 = Server.CreateObject("ADODB.RecordSet")
			rs2.Open "select * from [lylb] where id="&rs("lb")&" order by id desc",conn,1,1
			if rs2.recordcount<>0 then
				Response.Write "<font color=red>("&rs2("lb")&")</font>"
			end if
			rs2.close:set rs2=nothing
			%>
			<br>
			<font color="#C0C0C0"><%=titleb(glhtml(rs("content")),50)%></font></td>
			<td width="199"><%=rs("adduser")%>&nbsp;<a href=# onclick='window.open("admin_ip.asp?iP=<%=rs("ip")%>","newsplview","width=380,height=200,top=190,left=150,scrollbars=no" )'><%=rs("IP")%>(查看来源)</a><br><%=rs("addtime")%></td>
			<td width="111" align=center>
			<%
			Set rs2 = Server.CreateObject("ADODB.RecordSet")
			rs2.Open "select * from [lyhf] where lyid="&rs("id")&" order by id desc",conn,1,1
			if rs2.recordcount<>0 then
			   Response.Write "已经回复&nbsp;"
			else
			   Response.Write "没有回复&nbsp;"
			end if
			rs2.close:set rs2=nothing
			
				if sh=1 then Response.Write "<a href=admin_ly.asp?shid="&rs("id")&"&sh=0>已经审核</a>"
				if sh=0 then Response.Write "<a href=admin_ly.asp?shid="&rs("id")&"&sh=1>没有审核</a>"
			%>
			<BR>
			<a href="admin_ly.asp?viewid=<%=rs("id")%>">查看回复</a>  

			<a onclick='{if(confirm("您确定删除吗?此操作将不能恢复!")){return true;}return false;}' href="admin_ly.asp?delid=<%=rs("id")%>">删除</a></td>
		</tr>
<%
rs.movenext
if rs.eof then exit for
next
else
  Response.Write "<tr><td colspan=3>暂无信息</td></tr>"
end if
%>
	</table>
</div>
<BR>
<center>
<%if rs.recordcount<>0 then
  if page>1 then
    response.write "<a href="&request.servervariables("URL")&"?page=1&lm="&trim(request("lm"))&"&lb="&trim(request("lb"))&"&word="&trim(request("word"))&">首页</a>　"
    response.write "<a href="&request.servervariables("URL")&"?page="&page-1&"&lm="&trim(request("lm"))&"&lb="&trim(request("lb"))&"&word="&trim(request("word"))&">上一页</a>　"
  end if
  if page<rs.pagecount then
    response.write "<a href="&request.servervariables("URL")&"?page="&page+1&"&lm="&trim(request("lm"))&"&lb="&trim(request("lb"))&"&word="&trim(request("word"))&">下一页</a>　"
    response.write "<a href="&request.servervariables("URL")&"?page="&rs.pagecount&"&lm="&trim(request("lm"))&"&lb="&trim(request("lb"))&"&word="&trim(request("word"))&">尾页</a>　"
  end if
    response.write "共"&rs.recordcount&"条　每页显示"&pagecount&"条　共"&rs.pagecount&"页　"
  %>
  <script language="JavaScript">
  <!--
  function FP_jumpMenu(el,frm,sel) {//v1.0
    var href=el.options[el.selectedIndex].value; if(sel) el.selectedIndex=0;
    if('_new'==frm) open(href); else eval(frm+".location='"+href+"'");
    }
    // -->
  </script>
  <select size="1" onchange="FP_jumpMenu(this,'window',false)" id="id1" name="D1" style="font-size: 9pt; border-style: solid; border-width: 1px">
   <%for i=1 to rs.pagecount%>
   <option value="<%=request.servervariables("URL")%>?page=<%=i%>&lm=<%=trim(request("lm"))%>&lb=<%=trim(request("lb"))%>&word=<%=trim(request("word"))%>" <%if page=i then response.write "selected"%> style="font-size: 9pt">第<%=i%>页</option>
    <%next%>
   </select>
<%end if%>

<br><br>　<div align="center">
	<table border="1" cellpadding="3" width="700" id="table4" style="border-collapse: collapse" bordercolor="#C0C0C0">
		<tr>
			<td background="../images/bj6.jpg">留言调用：<br>
			&lt;script TYPE=&quot;text/javascript&quot; language=&quot;javascript&quot; src=&quot;<%=finddir(request.servervariables("URL"))%>js-ly.asp?list=10&amp;font=9&amp;color=000000&amp;n=30&amp;lb=0&quot;&gt;&lt;/script&gt;</td>
		</tr>
		<tr>
			<td>list　　　　显示留言的条数，默认是10条。<br>
			font　　　　标题的字号，默认是9pt。<br>
			color　　　 标题的颜色，默认是黑色，切记不要加#。<br>
			n　　　 　　标题显示的字符数，默认是30个字符！</td>
		</tr>
		</table>
</div>
<br><br></p>
<center>
<%
if xuasmdb<>"" then
%>
<iframe name="I45341" src="http://www.xuas.com/Google728x90.asp" height="95" width="735" scrolling="no" border="0" frameborder="0" marginwidth="1" marginheight="1"></iframe>
<%
end if
%>
</center>