<!--#include file="../inchuayuwebrlzywzhyweb/CONN.ASP"-->
<!--#include file="../inchuayuwebrlzywzhyweb/cls_huayuweb()^191563631.asp"-->
<!--#include file="../inchuayuwebrlzywzhyweb/cls_showpage.asp"-->
<!--#include file="../inchuayuwebrlzywzhyweb/cls_filemanagehycs.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<%
oa.chkadmin()

if oa.act<>"" then
dim id,j
id=request("id")
select case oa.act
      case "bestnew"
	    call bestnew(id)
	  case "tj"
	    call tj(id)
	  case "hot"
	     call hot(id)
	  case "del"
	   
	 if instr(id,",")>0 then
       id=split(id,",")
       for j=0 to ubound(id)
        del(id(j))
        next
     else
       del(id)
     end if  
		call oa.msgshowurl("删除成功！",oa.tmpstr)
		
		
end select
End if

sub pl(aid)
set rw=server.CreateObject("ADODB.recordset")
rw.open"select * from Feedback where tid="&aid&"",conn,1,1
if not rw.eof then
response.write""&rw.recordcount&""
else
response.write"0"
end if
rw.close
end sub

Sub bestnew(id)
dim newrs
if id="" or not isnumeric(id) then oa.msgshow("非法操作！")
set newrs=oa.execute("select bestnew from c_article where id="&id)
if newrs.eof then oa.msgshow("该商品不存在或已被删除！请返回重新选择！")
   if newrs(0)=0 then
     oa.execute("update c_article set bestnew=1 where id="&id)
   else
     oa.execute("update c_article set bestnew=0 where id="&id)
   end if
newrs.close
set newrs=nothing
response.redirect(oa.tmpstr)
End Sub

Sub hot(id)
dim tjrs
if id="" or not isnumeric(id) then oa.msgshow("非法操作！")
set tjrs=oa.execute("select hot from c_article where id="&id)
if tjrs.eof then oa.msgshow("该商品不存在或已被删除！请返回重新选择！")
   if tjrs(0)=0 then
     oa.execute("update c_article set hot=1 where id="&id)
   else
     oa.execute("update c_article set hot=0 where id="&id)
   end if
tjrs.close
set tjrs=nothing
response.redirect(oa.tmpstr)
End Sub

Sub tj(id)
dim tjrs
if id="" or not isnumeric(id) then oa.msgshow("非法操作！")
set tjrs=oa.execute("select tj from c_article where id="&id)
if tjrs.eof then oa.msgshow("该商品不存在或已被删除！请返回重新选择！")
   if tjrs(0)=0 then
     oa.execute("update c_article set tj=1 where id="&id)
   else
     oa.execute("update c_article set tj=0 where id="&id)
   end if
tjrs.close
set tjrs=nothing
response.redirect(oa.tmpstr)
End Sub

Sub del(id)
dim prors,sFilepath,file
if id="" or not isnumeric(id) then oa.msgshow("非法操作！")
  set prors=oa.execute("select defaultpicurl,jturl from c_article where id ="&id)
  if prors.eof then oa.msgshow("该商品不存在或已被删除！请返回重新选择！")
     if prors(0)<>"" then
	    set file=new filemanage
	    sFilepath=server.mappath(webdir&prors(0))
		file.deletefile sFilepath
	 end if
	    if prors(1)<>"" then
	    set file=new filemanage
	    sFilepath=server.mappath("../"&prors(1))
		file.deletefile sFilepath
	 end if
  oa.execute("delete from c_article where id="&id)
  prors.close
  set prors=nothing
End Sub









   dim title,dhrootid
  dhrootid=oa.sqlrequest("dhrootid")
  if dhrootid="" or not isnumeric(dhrootid)  then oa.msgshow("非法操作！")
  set rs=oa.execute("select classname from classlist where rootid="&dhrootid&" and Depth=0")
  title=rs(0)
  rs.close
  
  
%>
<link href="../inchuayuwebrlzywzhyweb/style.css" rel="stylesheet" type="text/css">

<style type="text/css">
<!--
.STYLE4 {color: #FF0000}
-->
</style>
<table width="98%" height="21" border="0" align="center" cellpadding="0" cellspacing="0" background="../img/line.gif">
  <tr>
    <td height="35" align="center" bgcolor="#6298E1" style="color:white"><div align="left"><strong>&nbsp;<img src="../img/Explain.gif" width="18" height="18" align="absmiddle" />&nbsp;</strong><strong><%=title%> 管 理</strong><a href="Article_ArticleManage_ys.asp" class="STYLE4"></a></div></td>
  </tr>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#6298E1">
<form id="myform" name="myform" method="get" action="admin_article_manage.asp">
<tr bgcolor="#FFFFFF">
  <td height="22" colspan="6" bgcolor="#EBF2F9" style="padding-left:20px"> 选择栏目：
    <select name="ClassID" id="ClassID">
          <% oa.Class_Option dhclassID,dhrootid %>
      </select>
    标题：
    <input name="title1" type="text" class="wenbenkuang" id="title1" size="20" />
    每页显视
    <input name="num" type="text" class="wenbenkuang" id="num" size="5" />
    条
    <input type="submit" name="Submit" value="提交" />
    <input name="dhrootid" type="hidden" id="dhrootid" value="<%=dhrootid%>" /></td>
  </tr> </form>
  <tr bgcolor="#FFFFFF"> 
      <td width="4%" height="22" align="center" bgcolor="#EBF2F9"><strong>选中</strong></td>
      <td width="53%" align="center" bgcolor="#EBF2F9"><strong>信息名称</strong></td>
      <td width="5%" align="center" bgcolor="#EBF2F9"><strong>排序</strong></td>
      <td width="6%" align="center" bgcolor="#EBF2F9"><strong>点击数</strong></td>
      <td width="24%" align="center" bgcolor="#EBF2F9"><strong>操作</strong></td>
      <%if plxt=1 then%><td width="8%" align="center" bgcolor="#EBF2F9"><span style="font-weight: bold">评论</span></td><%end if%>
  </tr>
  <form id="form1" name="form1" method="post" onsubmit="return check1()" action="admin_article_manage.asp">
  <%
  dim sqlstr,title1,num,classid
classid=oa.sqlrequest("classid")
title1=oa.sqlrequest("title1")
num=oa.sqlrequest("num")
if num="" or not isnumeric(num) then num=30
if classid="" then
sqlstr="classid in (select classid from classlist where rootid="&dhrootid&")"
else
sqlstr="classid="&classid&" or  classid in (select classid from classlist where ParentID="&classid&")"
end if
if title1<>"" then
sqlstr=sqlstr&" and title like '%"&title1&"%'"
end if

dim ors,irs,RecCount,i
if not isobject(conn) then connectiondatabase
set ors=new cls_showopage
with ors
   
	.pagesize=num
	
	.sql="id,classid,title,orderid,hits,tj,bestnew,hot,zy,public,DefaultPicUrl$ from c_article where 0=0 and "&sqlstr&" $orderid,id desc$id"
end with
reccount=ors.reccount
iRs=ors.ResultSet()	
if reccount<1 then
%>

<tr bgcolor="#FFFFFF" onMouseOver="this.style.backgroundColor='#BFDFFF'" onMouseOut="this.style.backgroundColor=''">
  <td height="22" colspan="6" align="center" bgcolor="#EBF2F9">还未添加任何信息</td>
</tr>
<%
 Else
 
     For i=0 To Ubound(iRs,2)
%>
  <tr  bgcolor="#FFFFFF" onMouseOver="this.style.backgroundColor='#BFDFFF'" onMouseOut="this.style.backgroundColor=''"> 
      <td align="center" bgcolor="#EBF2F9"><input name="id" type="checkbox" id="id" value="<%=iRs(0,i)%>"></td>
      <td height="22" bgcolor="#EBF2F9"><font color="#FF0000">[<%=oa.getclassname(irs(1,i))%>]</font><a href='admin_article_<%if request("cid")=48 then%>hf<%else%>mod<%end if%>.asp?dhrootid=<%=dhrootid%>&id=<%=iRs(0,i)%>' title="<%=iRs(2,i)%>" ><%=left(iRs(2,i),30)%></a><%if request("cid")=48 then%><%if irs(8,i)<>"" then%>&nbsp;&nbsp;<span style="font-weight: bold; color: #FF0000">已经回复</span>
      <%else%>&nbsp;&nbsp;[没有回复]<%end if%>&nbsp;&nbsp;<%if irs(9,i)=1 then%>公开<%else%>不公开<%end if%><%end if%><%if iRs(10,i)<>"" then%>
      <span class="STYLE4"><strong>(图)      </strong></span>
      <%else%><%end if%></a></td>
      <td align="center" bgcolor="#EBF2F9"><%=iRs(3,i)%></td>
      <td align="center" bgcolor="#EBF2F9"><%=iRs(4,i)%></td>
      <td align="center" bgcolor="#EBF2F9"><% if irs(7,i)=0 then%>
        <a href="admin_article_manage.asp?action=hot&amp;id=<%=irs(0,i)%>" class="a2">置顶</a>
        <%else%>
        <a href="admin_article_manage.asp?action=hot&amp;id=<%=irs(0,i)%>"><font color="red">置顶</font></a>
        <%end if%>
        <% if irs(5,i)=0 then%>
        <a href="admin_article_manage.asp?action=tj&amp;id=<%=irs(0,i)%>" class="a2">推荐</a>
        <%else%>
        <a href="admin_article_manage.asp?action=tj&amp;id=<%=irs(0,i)%>"><font color="red">推荐</font></a>
        <%end if%>
        <% if irs(6,i)=0 then%>
        <a href="admin_article_manage.asp?action=bestnew&amp;id=<%=irs(0,i)%>" class="a2">热门</a>
        <%else%>
        <a href="admin_article_manage.asp?action=bestnew&amp;id=<%=irs(0,i)%>"><font color="red">热门</font></a>
        <%end if%>
      <a href='<%if request("cid")=48 then%>admin_article_hf.asp?dhrootid=<%=dhrootid%>&amp;id=<%=iRs(0,i)%><%else%>admin_article_mod.asp?dhrootid=<%=dhrootid%>&amp;id=<%=iRs(0,i)%><%end if%>' class='a2'><%if request("cid")=48 then%>回复信息<%else%>修改信息<%end if%></a> <a href="admin_article_manage.asp?action=del&amp;id=<%=iRs(0,i)%>" class="a2" onclick="if(confirm('确定要删除该条信息吗！将不可恢复！')==false){return false}">删除信息</a></td>
     <%if plxt=1 then%> <td align="center" bgcolor="#EBF2F9"> <a href=admin_pl_manage.asp?tid=<%=iRs(0,i)%>>相关评论</a> <font color="ff0000">（<%call pl(iRs(0,i))%>）&nbsp;</td><%end if%>
  </tr>

<%

  Next	
End If
 %>
 <tr bgcolor="#FFFFFF" >
  <td height="22" colspan="6" bgcolor="#EBF2F9"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr> 
            <td width="250" height="30"><input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
              选中本页显示的所有信息 </td>
            <td><input name="submit" type='submit' value='删除选定的信息' onClick="{if(confirm('该操作不可恢复！\n\n确实删除选定的信息？')){this.document.Prodlist.submit();return true;}return false;}"> 
              <input name="action" type="hidden" id="action" value="del"></td>
          </tr>
      </table></td>
</tr>
 </form>
</table>
<table width="98%" border="0" cellspacing="2" cellpadding="2" align="center">
  <tr>
<td><%call ors.ShowPage1("a2")%>
</td>
  </tr>
</table> 

<SCRIPT language=javascript>
<!--
 function check1()//表单判断
  {
   var str="";
   var j=0;
   var el=document.form1.getElementsByTagName("input")
   for(i=0;i<form1.length;i++){
    if(el[i].type=="checkbox"){
     if((el[i].checked)&&(el[i].name.indexOf("id")!='-1')){
      j++;
     }
    }
   }
   if(j > 100 || j<1)
   {
    alert("最少必须选择一项，最多不能超过100项!\r\t你现在选择了"+j+"项");
    return false;
   }
   
     if(!confirm("您确定要删除所选文章吗，并且不能恢复？"))
   {
    return false
   } 
   return true;
}

function unselectall()
{
    if(document.myform.chkAll.checked){
	document.myform.chkAll.checked = document.myform.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>
