<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="admin.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/function.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>评论管理</title>
<link href="style/style.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="style/js.js"></script>
</head>
<body id="page">
<%
'//批量操作
if request("action")=3 then
 select case request("sub")
   case 3
     conn.execute("update cw_comment set ispass=1 where id in("&request("id")&")")
   case 6
     conn.execute("update cw_comment set ispass=0 where id in("&request("id")&")")
   case 9
	 conn.execute("delete from cw_comment where id in("&request("cid")&")")
   end select
end if

%>
<h2 class="title">评论管理</h2>
<table width="99%" border="0" align="center" class="nav">
  <tr>
    <td height="20">&nbsp;网站后台管理 &gt;&gt; <a href="cw_comment.asp">评论管理</a></td>
  </tr>
</table>

<form action="cw_comment.asp?action=3" method="post" name="form">
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
      <tr>
        <td width="4%" align="center" bgcolor="#F0F3F5">&nbsp;</td>
        <td width="7%" align="center" bgcolor="#F0F3F5">ID</td>
        <td width="40%" align="center" bgcolor="#F0F3F5">标题</td>
        <td width="8%" align="center" bgcolor="#F0F3F5">用户</td>
        <td width="10%" align="center" bgcolor="#F0F3F5">类型</td>
        <td width="12%" align="center" bgcolor="#F0F3F5">时间</td>
	    <td width="8%" align="center" bgcolor="#F0F3F5">状态</td>
        <td width="11%" align="center" bgcolor="#F0F3F5">管理</td>
      </tr>
    <%
		set rs1=server.CreateObject("adodb.recordset")
		sql="select * from cw_comment order by id desc"
		rs1.open sql,conn,1,1
		if not rs1.eof then
		         page_count=15
  				 if Request("page")="" or Request("page")="0" then
   				  page=1
  				 else
    				 page=cint(Request("page"))
  				 End if 
					 totalcount=rs1.RecordCount
   				  totalpage=int(totalcount/page_count+(page_count-1)/page_count)
  				 if page>totalpage then page=totalpage
  				 if rs1.EOF then    
   				  else
   				  for i = 1 to (page-1)*page_count
    				   rs1.MoveNext
   				  Next
   				  if page<totalpage then
    				   psize=page_count
   				  else
   				    psize=totalcount-(page-1)*page_count
   				  End if
   				  for i = 1 to psize
				  select case rs1("classid")
				  case "cw_news"
				  types="新闻资讯"
				  case "cw_info"
				  types="分类信息"
				  case "cw_bbs"
				  types="论坛"
				  case "cw_hous"
				  types="房产信息"
				  case "cw_job"
				  types="招聘信息"
				  case "cw_shop"
				  types="商家黄页"
				  case else
				  types="其它"
				  end select
				  cid=cw_class("classid",rs1("classid"),rs1("showid"))				  
				  curl=cw_class("html",rs1("classid")&"_class",cid)
		%>
      <tr>
        <td align="center" bgcolor="#FFFFFF"><input type="checkbox" name="cid" id="cid" value="<%=rs1("id")%>" /></td>
        <td align="center" bgcolor="#FFFFFF"><%=rs1("id")%></td>
        <td bgcolor="#FFFFFF">&nbsp;<a href="<%=cf_root&curl&rs1("id")%>.html" target="_blank"><%=rs1("content")%></a></td>
        <td align="center" bgcolor="#FFFFFF"><%=cw_class("user","cw_user",rs1("userid"))%></td>
        <td align="center" bgcolor="#FFFFFF"><%=types%></td>
        <td align="center" bgcolor="#FFFFFF" ><%=cw_date(rs1("adddate"),"yyyy/mm/dd")%></td>
        <td align="center" bgcolor="#FFFFFF" ><%if rs1("ispass")=1 then%><a href="cw_comment.asp?action=3&sub=6&id=<%=rs1("id")%>" class="action">己审核</a><%else%><a href="cw_comment.asp?action=3&sub=3&id=<%=rs1("id")%>">未审核</a><%end if%></td>
	<td align="center" bgcolor="#FFFFFF" ><a href="cw_comment.asp?sub=9&id=<%=rs1("id")%>&action=3" onclick="return confirm('你确定要删除？')">删除</a></td>
      </tr>
	   <%
		rs1.MoveNext
 		next
		end if
		end if
		rs1.close
		set rs1=nothing
		%>
      <tr >
        <td colspan="8" align="center" bgcolor="#FFFFFF">
		<div style="float:left">
		<input name="button" type="button" onclick="qxbox(this.form.cid)" value="全 选" />
        &nbsp;&nbsp;
        <input name="button" type="button"  onclick="fxbox(this.form.cid)" value="反 选" />
        &nbsp;&nbsp;
        <select name="sub" id="sub">
          <option value="">请选择操作</option>
		  <option value="3">通过审核</option>
		  <option value="6">取消审核</option>
		  <optgroup label="&nbsp;&nbsp;"></optgroup>
		  <option value="9">批量删除</option>
        </select>
        <input type="submit" name="Submit" value="批量执行操作" onclick="return confirm('你确定要执行？')" />
		</div>
		<!--#include file="../inc/page.asp"--></td>
        </tr>
    </table>
</form>
<%call closes()%>
</body>
</html>
