<!-- #Include File="Include/AMH_onlogin.asp" -->
<!-- #Include File="../Include/Cls_UbbCode.asp" -->
<!-- #Include File="../Include/Cls_IpSys.asp" -->
<%
'=======================================================
' 欢迎使用《阿赛大型门户网站系统V2.0》，简称“AsaiMHV2”
' 技术支持、商业版咨询、官方唯一指定联系QQ“4941172”
' 官方网站：http://77ya.com      程序负责人：阿赛
'=======================================================

Index_Url="BlogData"
call AMH_master(0,0)
Call AMH_Header(1)
%>
<tr><td align=center colspan=2 height=30>
  <table border=0>
  <tr>
  <td width=10></td>
  <td> <a href=AMH_blog.asp>博客列表 </a></td>
  <td width=10></td>
  <td> <a href=AMH_blogdata.asp class=red>内容管理 </a></td>
  <td width=10></td>
  <td> <a href=AMH_blogbook.asp>留言管理</a></td>
  <td width=10></td>
   <td> <a href=AMH_Review.asp?ChannelIDs=10>评论管理</a></td>
  <td width=10></td>
  <td> <a href=AMH_BlogSkin.asp>用户模板管理</a></td>
  <td width=10></td>
  <td> <a href=AMH_BlogSkin2.asp>模板导入导出</a></td>
   <td width=10></td>
  </tr>
  </table>
</td></tr>
</table>
<%
call AMH_table(1)
if action="handle" then call AsaiMHBD_Handle()


call AsaiMHChk_Main()
 
Call AMH_Ender(tit)

Sub AsaiMHBD_Handle()
  dim s_type,sel_type,seltype
  sel_type=trim(request.form("sel_type"))
  select case sel_type
  case "审核"
    seltype="gk"
  case "待审核"
    seltype="qxgk"
  case "删除"
    seltype="delete"
  case else
    sel_type=""
    seltype=""
  end select
  if  sel_type="" or seltype="" then
   Response.Write "<script>alert('您在提交用户操作时出现非法的数据');</script>"
    exit sub
  end if
  dim sel_id,sel_cid,hdim,hnum,brs
  sel_id=trim(request.form("sel_id"))
  sel_id=replace(sel_id," ","")
  hdim=split(sel_id,",")
  hnum=ubound(hdim)
  for i=0 to hnum
    id=hdim(i)
    if isnumeric(id) then
		set brs=Cls.exec("select top 1 id,cid,username,type,hidden from  AsaiMHblogdata where id="&id,1)
      select case seltype
      case "delete"
	 	call cls.exec("update AsaiMHblog set count"&brs("type")&"=count"&brs("type")&"-1 where username='"&brs("username")&"'",0)
	    if brs("cid")<>0 then call cls.exec("update AsaiMHblogsort set count=count-1 where id="&brs("cid"),0)
		call cls.exec("delete from AsaiMHblogdata where  id="&id,0)
      case "gk"
        sql="update AsaiMHblogdata  set hidden=1 where id="&id
		if brs("hidden")=false then
		   call cls.exec("update AsaiMHblog set count"&brs("type")&"=count"&brs("type")&"+1 where username='"&brs("username")&"'",0)
		   if brs("cid")<>0 then call cls.exec("update AsaiMHblogsort set count=count+1 where id="&brs("cid"),0)
		end if
        conn.execute(sql)
      case "qxgk"
        sql="update AsaiMHblogdata  set hidden=0 where id="&id
		if brs("hidden")=true then
		   call cls.exec("update AsaiMHblog set count"&brs("type")&"=count"&brs("type")&"-1 where username='"&brs("username")&"'",0)
		   if brs("cid")<>0 then call cls.exec("update AsaiMHblogsort set count=count-1 where id="&brs("cid"),0)
		end if
        conn.execute(sql)
      case else

      end select
	  brs.close
    end if
  next
  erase hdim
  action=""
  call AMH_event(sel_type&" "&(hnum+1)&"条（"&tit_fir&"）记录")
  Response.Write vbcrlf&"<script language=javascript>alert(""已成功（"&sel_type&"）操作了"&(hnum+1)&"条记录！"");</script>"
End Sub

sub AsaiMHChk_Main()
  dim topic,tim,c_id,hidden,dtype
%>
<form name=sel_form action='?AsaiMHMod=<%Response.Write AsaiMHMod%>&action=handle' method=post>
<tr align=center>
<td class=td width='5%'>序号</td>
<td class=td width='35%'><%Response.Write tit_fir%>主题</td>
<td class=td width='15%'><%Response.Write tit_fir%>用户</td>
<td class=td width='15%'>留言时间</td>
<td class=td width='10%'>状态</td>
<td class=td width='5%'><input type=checkbox name=sel_all value='yes' onclick="javascript:select_all(this.form);"></td>
</tr>
<%
  dim obj_page
  set obj_page=new Cls_PageCute
  obj_page.pageurl=pageurl			
  obj_page.nummer=nummer						
  obj_page.page_t=1									
  obj_page.page_p=5									
  obj_page.page_unit="篇"
  obj_page.page_tit=tit_fir
  obj_page.v_id="id"
  call obj_page.p_init("*",Data_Name,sql_add,"id desc")
  sql=obj_page.sql_count
  set rs=Cls.exec(sql,1)
  obj_page.rssum=rs(0)
  rs.close
  call obj_page.p_main("*",Data_Name,sql_add,"id desc")
  for i=1 to obj_page.page_num
    id=rs("id")
    topic=rs("topic")
    tim=rs("tim")
	c_id=rs("cid")
	dtype=rs("type")
    if rs("hidden")=true then
       hidden="yes"
    else
       hidden="no"
    end if%>
<tr align=center>
<td class=tims><%Response.Write obj_page.page_now+i%></td>
<td align="left">
<%if rs("type")=1 then
Response.Write "<font color=blue>[日志]</font> "
else
Response.Write "<font color=orange>[相片]</font> "
end if
Response.Write "<a href='../Blog/View/?"&rs("id")&"' target=_blank>"&rs("topic")&"</a>"%></td>
<td><%Response.Write "<a href='../User/View.asp?username="&rs("username")&"' target=_blank>"&rs("username")&"</a>"%></td>
<td><font class=tims alt='<%Response.Write Cls.time_type(tim,2)%>'><%Response.Write Cls.time_type(tim,4)%></font></td>
<td>
<%
if rs("hidden") then 
response.write " 正常" 
else 
response.write " <font color=red>未审核</font>" 
end if 
%>
</td>
<td><input type=checkbox name=sel_id value='<%Response.Write id%>'></td>
</tr>
<%
    rs.movenext
  next
  rs.close
%>
<tr class=tr1>
<td colspan=4>
  <table border=0>
  <tr class=tr1>
  <td></td>
  <td><%Response.Write obj_page.page_var%></td>
  <td width=3></td>
  <td>分页：</td>
  <td><%Response.Write obj_page.page_cute%></td>
  </tr>
  </table>
</td>
<td colspan=4 align=center>
<select name=sel_type size=1>
<option value='审核'>审核</option>
<option value='待审核'>待审核</option>
<option value='删除'>删除</option>
</select>
<input type=submit value='操作' onclick="return sel_click(this.form);" class=btn>
</td>
</tr>
<%
end sub
%>
