<%@ LANGUAGE=VBScript CodePage=65001%>
<% response.charset="utf-8" %>
<% session.codepage=65001 %>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--#include file="../LyricInc/access.asp"  -->
<!-- #include file="LyricInc/functions.asp" -->
<!-- #include file="page_next.asp" -->
<!-- #include file="../LyricInc/x_to_html/index_to_html.asp" -->


<!-- 三级联动菜单 开始 -->
<script language="JavaScript">
<!--
<%
'二级数据保存到数组
Dim count2,rsClass2,sqlClass2
set rsClass2=server.createobject("adodb.recordset")
sqlClass2="select id,pid,ppid,name from category where ppid=2 and ClassType=4 order by [Order] " 
rsClass2.open sqlClass2,cn,1,1
%>
var subval2 = new Array();
//数组结构：一级根值,二级根值,二级显示值
<%
count2 = 0
do while not rsClass2.eof
%>
subval2[<%=count2%>] = new Array('<%=rsClass2("pID")%>','<%=rsClass2("ID")%>','<%=rsClass2("Name")%>')
<%
count2 = count2 + 1
rsClass2.movenext
loop
rsClass2.close
%>

<%
'三级数据保存到数组
Dim count3,rsClass3,sqlClass3
set rsClass3=server.createobject("adodb.recordset")
sqlClass3="select id,pid,ppid,name from category where ppid=3 and ClassType=4 order by [Order]" 
rsClass3.open sqlClass3,cn,1,1
%>
var subval3 = new Array();
//数组结构：二级根值,三级根值,三级显示值
<%
count3 = 0
do while not rsClass3.eof
%>
subval3[<%=count3%>] = new Array('<%=rsClass3("pID")%>','<%=rsClass3("ID")%>','<%=rsClass3("Name")%>')
<%
count3 = count3 + 1
rsClass3.movenext
loop
rsClass3.close
%>

function changeselect1(locationid)
{
    document.form1.pid.length = 0;
    document.form1.pid.options[0] = new Option('选择二级分类','');
    document.form1.ppid.length = 0;
    document.form1.ppid.options[0] = new Option('选择三级分类','');
    for (i=0; i<subval2.length; i++)
    {
        if (subval2[i][0] == locationid)
        {document.form1.pid.options[document.form1.pid.length] = new Option(subval2[i][2],subval2[i][1]);}
    }
}

function changeselect2(locationid)
{
    document.form1.ppid.length = 0;
    document.form1.ppid.options[0] = new Option('选择三级分类','');
    for (i=0; i<subval3.length; i++)
    {
        if (subval3[i][0] == locationid)
        {document.form1.ppid.options[document.form1.ppid.length] = new Option(subval3[i][2],subval3[i][1]);}
    }
}
//-->
</script><!-- 三级联动菜单 结束 -->
<% '搜索模块
act=request.querystring("act")
keywords=trim(request("keywords"))
if act="search" then
cidx=request("cid")
pidx=request("pid")
ppidx=request("ppid")

if cidx="" and pidx="" and  ppidx="" then
s_sql="select * from web_info where [PetID] = '"&keywords&"' or [title] like '%"&keywords&"%'   order by time desc"
elseif pidx="" and ppidx="" then
search_sql="and cid='"&cidx&"'"
s_sql="select * from web_info where [PetID] = '"&keywords&"' or [title] like '%"&keywords&"%'"&search_sql&"   order by time desc"
elseif ppidx="" then
search_sql="and pid='"&pidx&"'"
s_sql="select * from web_info where [PetID] = '"&keywords&"' or [title] like '%"&keywords&"%'"&search_sql&"   order by time desc"
else
search_sql="and ppid='"&ppidx&"'"
s_sql="select * from web_info where [PetID] = '"&keywords&"' or [title] like '%"&keywords&"%'"&search_sql&"   order by time desc"
end if
else
s_sql="select * from web_info   order by time desc"

end if

%>
<script language="JavaScript">
<!--
function ask(msg) {
	if( msg=='' ) {
		msg='警告：删除后将不可恢复，可能造成意想不到后果？';
	}
	if (confirm(msg)) {
		return true;
	} else {
		return false;
	}
}
//-->
</script>
<script language="javascript">

//全选JS
function unselectall(){
if(document.form2.chkAll.checked){
document.form2.chkAll.checked = document.form2.chkAll.checked&0;
}
}
function CheckAll(form){
for (var i=0;i<form.elements.length;i++){
var e = form.elements[i];
if (e.Name != 'chkAll'&&e.disabled==false)
e.checked = form.chkAll.checked;
}
}
</script>	<%
Call header()
%>
	<link rel="stylesheet" href="css/PetEasyBox.css">
	<script src="js/es6-shim.min.js"></script>
	<script src="js/jquery-3.3.1.min.js"></script>
	<script src="js/jquery.transit.min.js"></script>
	<script src="js/PetEasyBox.min.js"></script>
	<table cellpadding='3' cellspacing='0' border='0' class='tableBorder' align=center>
	<tr>
	  <th width="100%" height=25 class='tableHeaderText'>留言列表</th>
	
	<tr><td height="400" valign="top"  class='forumRow'><br>
	    

 <form name="form2" method="post" action="info_Del.asp?action=AllDel&page=<%=page%>&act=<%=act%>&keywords=<%=keywords%>">
 	    <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="2%" height="30" class="TitleHighlight">&nbsp;</td>
            <td width="3%" class="TitleHighlight"><div align="center" style="font-weight: bold;color:#ffffff">编号</div></td>
            <td width="5%" class="TitleHighlight"><div align="center" style="font-weight: bold;color:#ffffff">信件编号</div></td>
            <td width="5%" class="TitleHighlight"><div align="center" style="font-weight: bold;color:#ffffff">姓名</div></td>
            <td width="20%" height="30" class="TitleHighlight"><div align="center" style="font-weight: bold;color:#ffffff">主题</div></td>
            <td width="11%" class="TitleHighlight"><div align="center" style="font-weight: bold;color:#ffffff">发布时间</div></td>
            <td width="6%" class="TitleHighlight"><div align="center" style="font-weight: bold;color:#ffffff">IP/PV</div></td>
            <td width="5%" class="TitleHighlight"><div align="center" style="font-weight: bold;color:#ffffff">回复</div></td>
            <td width="5%" class="TitleHighlight"><div align="center" style="font-weight: bold;color:#ffffff">审核</div></td>
            <td width="10%" class="TitleHighlight"><div align="center" style="font-weight: bold;color:#ffffff">操作</div></td>
          </tr>
<% '留言列表模块
strFileName="info_list.asp" 
pageno=25
set rs = server.CreateObject("adodb.recordset")
rs.Open (s_sql),cn,1,1
rscount=rs.recordcount
if not rs.eof and not rs.bof then
call showsql(pageno)
rs.move(rsno)
for p_i=1 to loopno
%>
<% if p_i mod 2 =0 then
class_style="forumRow"
else
class_style="forumRowHighLight"
end if%>
<%
rs_url=""
rs_url=FeedContent_FolderName&"/"&rs("file_path")

%>
          <tr >
            <td   height="30" class='<%=class_style%>'><div align="center"><input type="checkbox" name="Selectitem" id="Selectitem" value="<%=rs("id")%>"></div></td>
            <td   height="30" class='<%=class_style%>'><div align="center"><%=rs("id")%></div></td>
            <td   height="30" class='<%=class_style%>'><div align="center"><%=rs("PetID")%></div></td>
            <td   height="30" class='<%=class_style%>'><div align="center"><%=rs("PetName")%></div></td>
            <td class='<%=class_style%>' ><% '分类显示
			
            sid=cint(rs("cid"))
			if rs("pid")<>"" then
            sid=cint(rs("pid"))
			end If
			set rs1=server.createobject("adodb.recordset")
			sql="select name from category where id="&sid&""
			rs1.open(sql),cn,1,1
			if not rs1.eof and not rs1.bof then
			response.write "["&rs1("name")&"]"
			end if
			rs1.close
			set rs1=nothing
			
			%> <a href="<% =rs_url %>" target="_blank"><%=left(rs("title"),15)%>...</a><%if rs("index_push")=1 then%>&nbsp;[<span style="color: #FF0000">荐</span>]<%end if%></td>
            <td class='<%=class_style%>' ><div align="center"><%=rs("time")%></div></td>
            <td class='<%=class_style%>' ><div align="center"><%=rs("ip")%>/<%=rs("hit")%></div></td>
            <td class='<%=class_style%>' ><div align="center"><%if rs("ReContent")<>"" then%>已回复<%else%><span style="color: #FF0000">未回复</span><% end if%></div></td>
            <td class='<%=class_style%>' ><div align="center"><a href="info_view_yes.asp?id=<%=rs("id")%>&cid=<%=cidx%>&pid=<%=pidx%>&ppid=<%=ppidx%>&page=<%=page%>&act=<%=act%>&keywords=<%=keywords%>"><%if rs("view_yes")=1 then%>已审核<%else%><span style="color: #FF0000">未审核</span><% end if%></a></div></td>
            <td class='<%=class_style%>' >
            <div align="center"><span id="dialog-<%=p_i%>" class='PetView'>查看</span> | <a href="info_edit.asp?id=<%=rs("id")%>&cid=<%=cidx%>&pid=<%=pidx%>&ppid=<%=ppidx%>&page=<%=page%>&act=<%=act%>&keywords=<%=keywords%>">回复</a> | <a href="javascript:if(ask('警告：删除后将不可恢复，可能造成意想不到后果？')) location.href='info_del.asp?id=<%=rs("id")%>&cid=<%=cidx%>&pid=<%=pidx%>&ppid=<%=ppidx%>&page=<%=page%>&act=<%=act%>&keywords=<%=keywords%>';">删除</a>            </div></td>
          </tr>
	<script>
		$( "#dialog-<%=p_i%>" ).on("click", function () {
			Helper.ui.dialog({
				title: "<% '分类显示
			if rs("pid")<>"" then
            pid=cint(rs("pid"))
			set rs1=server.createobject("adodb.recordset")
			sql="select name from category where id="&pid&""
			rs1.open(sql),cn,1,1
			if not rs1.eof and not rs1.bof then
			response.write "["&rs1("name")&"]"
			end if
			rs1.close
			set rs1=nothing
			end if
			%> <%=rs("Title")%><p><span>姓名: <%=rs("PetName")%> </span><span>电话: <%=rs("PetTel")%> </span><span>电子邮件: <%=rs("PetEmail")%></span></p>",
				content: "<%=rs("Content")%>",
				yesText: "回复",
				noText: "关闭",
				draggable: true,
				width: 600,
				yesCallback: function () {
					location.href='info_edit.asp?id=<%=rs("id")%>&cid=<%=cidx%>&pid=<%=pidx%>&ppid=<%=ppidx%>&page=<%=page%>&act=<%=act%>&keywords=<%=keywords%>';
				},
			});
		})
	</script>
		  		  <%
		  rs.movenext
		  next
		  else
response.write "<div align='center'><span style='color: #FF0000'>暂无留言！</span></div>"
		  end if 
		  rs.close
		  set rs=nothing
		  %>
		          <tr  >
		            <td height="35"  colspan="9" >&nbsp;<input name='chkAll' type='checkbox' id='chkAll' onclick='CheckAll(this.form)' value='checkbox'>
                    全选/全不选&nbsp;<input type="submit" name="Submit" value="删除选中"></td>
          </tr>
            <tr  >
              <td height="35"  colspan="9" ><div align="center">
                <%call showpage(strFileName,rscount,pageno,false,true,"")%>
           </div></td>
		    </tr>
      </table> 
 </form>  
	    <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td height="20" class='forumRow'>&nbsp;</td>
          </tr>
          <tr>
            <td height="25" class='forumRowHighLight'>&nbsp;| 留言搜索</td>
          </tr>
          <tr>
            <td height="70"><form name="form1" method="post" action="?act=search">
              <div align="center"><%
Dim count1,rsClass1,sqlClass1
set rsClass1=server.createobject("adodb.recordset")
sqlClass1="select id,pid,ppid,name from category where ppid=1 and ClassType=4 order by [Order]" 
rsClass1.open sqlClass1,cn,1,1
%>
            <select name="cid" id="cid" onChange="changeselect1(this.value)">
              <option value="">选择一级分类</option>
              <%
count1 = 0
do while not rsClass1.eof
response.write"<option value="&rsClass1("ID")&">"&rsClass1("Name")&"</option>"
count1 = count1 + 1
rsClass1.movenext
loop
rsClass1.close
%>
            </select>
            &nbsp;&nbsp;
            <select name="pid" id="pid"  onchange="changeselect2(this.value)">
              <option value="">选择二级分类</option>
            </select>
            &nbsp;&nbsp;
            <select name="ppid" id="ppid">
              <option value="">选择三级分类</option>
            </select>&nbsp;
            <label>
<input name="keywords" type="text"  size="35" maxlength="40" >
              
                       &nbsp;
                       <input type="submit" name="Submit" value="搜 索" >
                </label>
              </div>
            </form>
            </td>
          </tr>
      </table>
	    <br></td>
	</tr>
	</table>

<%
Call DbconnEnd()
 %>