<!--#include file="conn.asp"-->
<!--#include file="inc/cook2.asp"-->
<!--#include file="inc/dimflag.asp"-->
<!--#include file="inc/page.asp"-->
<%
tid = int(Request("tid"))

word=trim(request("word"))
xcid=request("xcid")
xcidm=request("xcidm")
canshu1="tid="&tid&""
canshu3="word="&word&"&xcid="&xcid&"&xcidm="&xcidm&"&"&canshu1&""
canshu2="page="&page&"&"&canshu3&""

action=request.QueryString("action")
select case action
case "mb1"
 call editbook("mbok=0")
case "mb2"
 call editbook("mbok=1")
case "po1"
 call editbook("picok=0")
case "po2"
 call editbook("picok=1")
case "cn1"
 call editbook("lookcn=0")
case "cn2"
 call editbook("lookcn=1")
case "en1" 
 call editbook("looken=0")
case "en2"
 call editbook("looken=1")
case "utf1"
 call editbook("lookutf=0")
case "utf2"
 call editbook("lookutf=1")
case "del" 
id=replace(request("id")," ","")
id=split(id,",")
for i=0 to UBound(id)
conn.execute("delete from com_news where id="&id(i))
next
response.Write "<script>location='?"&canshu1&"'</script>"
case "order" 
pi=REQUEST("pi")
pi=REPLACE(pi,", ",",")
SQL5="SELECT * from com_news where id IN ("&pi&")"
SET RS5=SERVER.CREATEOBJECT("ADODB.RECORDSET")
rs5.open sql5,conn,1,3
while not rs5.eof 
RS5("pid")=REQUEST("pid"&RS5("id"))
RS5.UPDATE
RS5.MOVENEXT
wend
response.Write "<script>location='?"&canshu2&"'</script>"
end select
%>
<!--#include file="top.asp"-->
<div id="container">
<div class="top_but">
 <li class="left"></li>
 <li><a href="news_add.asp?tid=<%=tid%>" onClick="parent.frmleft.bb(3,10,'c')"><img src="images/but_1.gif" alt="添加" ></a></li>
 <li><img src="images/but_2.gif" alt="排序" style="cursor:hand"  onclick="form1.action='?action=order&<%=canshu2%>';form1.submit();"></li>
 <li><img src="images/but_3.gif" alt="删除" style="cursor:hand"  onclick="form1.action='?action=del&<%=canshu2%>'; ConfirmDel() "></li>
 <li><a href="?tid=<%=tid%>"><img src="images/but_7.gif" alt="全部" ></a></li>
 <li><img src="images/but_8.gif" alt="刷新" style="cursor:hand" onClick="window.location.reload(true);"></li>
 <li><img src="images/but_9.gif" alt="打印" style="cursor:hand;" onClick="window.print() "/></li>
<form name="form_search" method="post" action="?<%=canshu1%>">
 <li class="right">
   <%
  set rs_c=server.CreateObject("adodb.recordset")
  rs_c.open "select * from com_class where type="&tid&" and Cid=0 and LevelID=0 order by pid asc,id desc",conn,1,1
  %>
   <select name="xcid" size="1" onChange="MM_jumpMenu('this',this,0)" class="s_a">
    <option value="">选择分类</option>
	<%
    do while not rs_c.eof
	%>
    <option value="?xcid=<%=rs_c("ID")%>&<%=canshu1%>"><%=rs_c("ClassNamecn")%></option>
  <%
  set rs2=server.CreateObject("adodb.recordset")
  rs2.open "select * from com_class where Cid="&rs_c("ID")&" and nid=0 order by pid asc,id desc",conn,1,1
  %>
    <%
    do while not rs2.eof
	%>
    <option value="?xcidm=<%=rs2("ID")%>&<%=canshu1%>&">&nbsp;&nbsp;-&nbsp;<%=rs2("ClassNamecn")%></option>
    <%
  set rs3=server.CreateObject("adodb.recordset")
  rs3.open "select * from com_class where Cid="&rs2("cID")&" and  nid="&rs2("id")&" order by pid asc,id desc",conn,1,1
  %>
    <%
    do while not rs3.eof
	%>
    <option value="?xcids=<%=rs3("ID")%>&<%=canshu1%>">&nbsp;&nbsp;--&nbsp;<%=rs3("ClassNamecn")%></option>
    <%
    rs3.movenext
    loop
	%>
    <%
	rs3.close
	set rs3=nothing
	%>
	<%
    rs2.movenext
    loop
	%>
    <%
	rs2.close
	set rs2=nothing
	%>
    <%
    rs_c.movenext
    loop
	%>
    </select>
    <%
	rs_c.close
	set rs_c=nothing
	%>

<input name="word" type="text" id="word" class="s_b"><input type="image" name="Submit22" src="images/ss_b.gif" class="s_c" value="搜索" align="absmiddle"></li>
</form>
</div>
<%
if word<>"" then
sql= "select * from com_news where type="&tid&" and titlecn like'%"&word&"%' and sortid=0  order by pid desc,id desc"
elseif xcidm<>"" then
sql= "select * from com_news where nid="&xcidm&" and type="&tid&" and sortid=0 order by pid desc,nid asc"
elseif xcid<>"" then
sql= "select * from com_news where type="&tid&" and Cid="&xcid&" and sortid=0   order by pid desc,id desc"
else
sql= "select * from com_news where type="&tid&" order by pid desc,id desc"
end if
set rs=server.createobject("adodb.recordset")                     
rs.open sql,conn,1,1                     
if rs.eof and rs.bof then                     
response.write conn_eof
else 
page1("20")
i=1	

set titlecn=rs("titlecn")
set titleen=rs("titleen")
set titleutf=rs("titleutf")
set id=rs("id")
set adminuser=rs("adminuser")
set ck=rs("ck")
set books_date=rs("date")
set pid=rs("pid")
set lookcn=rs("lookcn")
set looken=rs("looken")
set lookutf=rs("lookutf")
set picok=rs("picok")
set cid=rs("cid")
%>
<%if word<>"" then%><div class="tablesearch">您搜索的关键字是：<font color=#ff6600><%=word%></font>，共搜索到 <%=rs.recordcount%> 条信息。 </div><%end if%>

<form id="form1" method="post" action="?<%=canshu2%>">
<div class="tableAll titlebgcolor">
 <li style="width:30px"><input name="chkall" type="checkbox" id="chkall" value="select" onClick="CheckAll(this.form);" ></li>
 <li style="width:50px;">操作</li>
 <li style="width:300px;">名称（点击修改）</li>

<li style="width:80px;">添加者</li>
 <li style="width:80px;">点击</li>
  <li style="width:40px;">例图</li>
 <li style="width:40px;">审核</li>
 <%if Const_webEn =1 then%><li style="width:40px;"><%=language_en%></li><%end if%>
 <%if Const_webUtf =1 then%><li style="width:40px;"><%=language_utf%></li><%end if%>
 <li style="width:100px;">时间</li>
 <li style="width:50px;">排序</li>
</div>
<%
while not rs.eof and i<=rs.pagesize
if titlecn="" then
if titleen="" then
if titleutf="" then
titlename="无标题"
else
titlname=titleutf
end if
else
titlename=titleen
end if
else
titlename=titlecn
end if
titlename=replace(titlename,word,"<font color=#ff6600>"&word&"</font>")
%>
<div class="tableAll trbgcolor">
 <li style="width:30px;"><input type="checkbox" name="ID"  value="<%=id%>"></li>
 <li style="width:50px;"><a href="News_modify.asp?id=<%=id%>&<%=canshu2%>">编辑</a></li>
 <li style="width:300px"><%=titlename%></li>

 <li style="width:80px;"><%=adminuser%></li>
 <li style="width:80px;"><%=ck%></li>
  <li style="width:40px;"><%if picok=1 then%><a href="?action=po1&id=<%=id%>&<%=canshu2%>" title="点击更改显示状态"><font color=green>√</font></a>
 <%else%><a href="?action=po2&id=<%=id%>&<%=canshu2%>" title="点击更改显示状态"><font color=#999999>×</font></a><%end if%></li>
 

 
<li style="width:40px;"><%if lookcn=1 then%><a href="?action=cn1&id=<%=id%>&<%=canshu2%>" title="点击更改显示状态"><font color=green>√</font></a>
 <%else%><a href="?action=cn2&id=<%=id%>&<%=canshu2%>" title="点击更改显示状态"><font color=#999999>×</font></a><%end if%></li>

<%if Const_webEn =1 then%>
 <li style="width:40px;"><%if looken=1 then%><a href="?action=en1&id=<%=id%>&<%=canshu2%>" title="点击更改显示状态"><font color=green>√</font></a>
 <%else%><a href="?action=en2&id=<%=id%>&<%=canshu2%>" title="点击更改显示状态"><font color=#999999>×</font></a><%end if%></li>
 <%end if%>
<%if Const_webUtf =1 then%>
 <li style="width:40px;"><%if lookutf=1 then%><a href="?action=utf1&id=<%=id%>&<%=canshu2%>" title="点击更改显示状态"><font color=green>√</font></a>
 <%else%><a href="?action=utf2&id=<%=id%>&<%=canshu2%>" title="点击更改显示状态"><font color=#999999>×</font></a><%end if%></li>
 <%end if%>
 <li style="width:100px"><%=books_date%></li>
 <li style="width:50px"><input name="pid<%=id%>" type="text" id="pid<%=id%>" value="<%=pid%>" size="3"> 
<input name="pi" type="hidden" id="pi" value="<%=id%>"></li>
</div>
<%i=i+1
rs.movenext
wend%>
</form>
<div id="divStayTop" class="bottom titlebgcolor">
<%call page2(5,""&canshu3&"&")%>
</div>
<%
end if
rs.close
set rs=nothing
%>
	
</div>

<%
function editbook(b_name)
id=request("id")
conn.execute("update com_news set "&b_name&" where id="&id)
'response.Write "<script>location='?"&canshu2&"'</script-->"
End Function
%>
<!--#include file="footer.asp"-->