<!--#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"))
pt=request("pt")
tuij=request("tuij")
sortpath=request("sortpath")
canshu1="tid="&tid&""
canshu3="word="&word&"&sortpath="&sortpath&"&pt="&pt&"&tuij="&tuij&"&"&canshu1&""
canshu2="page="&page&"&"&canshu3&""

select case action
case "tj"
 call editbook("bestbook=1","com_books")
case "pt"
 call editbook("bestbook=0","com_books")
case "cn1"
 call editbook("lookcn=0","com_books")
case "cn2"
 call editbook("lookcn=1","com_books")
case "en1" 
 call editbook("looken=0","com_books")
case "en2"
 call editbook("looken=1","com_books")
case "utf1"
 call editbook("lookutf=0","com_books")
case "utf2"
 call editbook("lookutf=1","com_books")
case "del" 
 id=replace(request("id")," ","")
 id=split(id,",")
 for i=0 to UBound(id)
 conn.execute("delete from com_books where id="&id(i))
 next
 response.Write "<script>location='?"&canshu1&"'</script>"
case "order" 
 pi=REQUEST("pi")
 pi=REPLACE(pi,", ",",")
 SQL5="SELECT * from com_books 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>"
 response.end
case "inputedit"
 attrKey = split(Trim(Request("id")), "$")(0) 
 index = split(Trim(Request("id")), "$")(1) 
 set rs=server.CreateObject("adodb.recordset")
 sql="select titlecn from com_books where id="&index
 rs.open sql,conn,1,3
 rs("titlecn")=Trim(Request("value"))
 rs.update
 rs.close
 set rs=nothing
 Response.Write(Trim(Request("value"))) 
 Response.end()  
end select
%>
<!--#include file="top.asp"-->
<div id="container">

<div class="top_but">
 <li class="left">&nbsp;</li>
 <li><a href="book_add_wx.asp?tid=<%=tid%>" onClick="parent.frmleft.bb('2_2')"><img src="images/but_1.gif" alt="添加" ></a></li>
 <li><img src="images/but_2.gif" alt="排序" onclick="form1.action='?action=order&<%=canshu2%>';form1.submit();"></li>
 <li><img src="images/but_3.gif" alt="删除" onclick="form1.action='?action=del&<%=canshu2%>';ConfirmDel();"></li>
 <li><a href="book_pl_wx.asp?tid=<%=tid%>" onClick="parent.frmleft.bb('2_3')"><img src="images/but_4.gif" alt="批量上传"></a></li>
 <li><a href="?pt=yes&<%=canshu1%>"><img src="images/but_5.gif" alt="普通" ></a></li>
 <li><a href="?tuij=yes&<%=canshu1%>"><img src="images/but_6.gif" alt="推荐" ></a></li>
 <li><a href="?tid=<%=tid%>"><img src="images/but_7.gif" alt="全部" ></a></li>
 <li><img src="images/but_8.gif" alt="刷新" onClick="window.location.reload(true);"></li>
 <li><img src="images/but_9.gif" alt="打印" onClick="window.print() "/></li>
<form name="form_search" method="post" action="?<%=canshu1%>">
 <li class="right">
<select name='Cid' size='1' class="s_a" onChange="MM_jumpMenu('this',this,0)"><option "">请选择</option><% call ListSort(0,"yes","","",tid)%></select>
<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_books where titlecn like'%"&word&"%' and type="&tid&" and sortid<>0 order by pid asc,id desc"
elseif request("pt")<>"" then
sql= "select * from com_books where bestbook=0 and type="&tid&" and sortid<>0 order by pid asc,id desc"
elseif request("tuij")<>"" then
sql= "select * from com_books where bestbook=1 and type="&tid&" and sortid<>0 order by pid asc,id desc"
elseif sortpath<>"" then
sql= "select * from com_books where Instr(sortpath,'"&sortpath&"')>0 and type="&tid&"  and sortid<>0order by pid asc,id desc"
else
sql= "select * from com_books where type="&tid&" and sortid<>0 order by pid asc,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 bookpicm=rs("bookpicm")
set id=rs("id")
set adminuser=rs("adminuser")
set ck=rs("ck")
set bestbook=rs("bestbook")
set books_date=rs("books_date")
set pid=rs("pid")
set lookcn=rs("lookcn")
set looken=rs("looken")
set lookutf=rs("lookutf")
%>
<%if word<>"" then%><div class="tablesearch">您搜索的关键字是：<font color=#ff6600><%=word%></font>，共搜索到 <%=rs.recordcount%> 条信息。 </div><%end if%>
<form name="form1" id="form1" method="post" action="?<%=canshu2%>">
<div class="tableAll titlebgcolor">
<ul>
 <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:50px;">操作</li>
 <li style="width:200px;">名称（点击修改）</li>
 <li style="width:80px;">添加者</li>
 <li style="width:80px;">点击</li>
 <li style="width:25px;"><%=language_cn%></li>
 <%if Const_webEn =1 then%><li style="width:25px;"><%=language_en%></li><%end if%>
 <%if Const_webUtf =1 then%><li style="width:25px;"><%=language_utf%></li><%end if%>
 <li style="width:25px;">荐</li>
 <li style="width:100px;">时间</li>
 <li style="width:50px;">排序</li>
 </ul>
</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;" onMouseMove="thumbshow(event,'../<%=bookpicm%>','<%=titlename%>')" onmouseout="hide(this)"><img src=../<%=bookpicm%> width="30" height="22" border="0" align="absmiddle"></li>
 <li style="width:50px;"><a href="book_modify_wx.asp?id=<%=id%>&<%=canshu2%>">编辑</a></li>
 <li style="width:200px;"><span id="name$<%=id%>" class="edit"><%=titlename%></span></li>
 <li style="width:80px;"><%=adminuser%></li>
 <li style="width:90px;"><%=ck%></li>
 <li style="width:25px;"><%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:25px;"><%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:25px;"><%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:25px;"><%if bestbook=1 then%><a href="?action=pt&id=<%=id%>&<%=canshu2%>" title="点击更改显示状态"><font color=green>√</font></a>
 <%else%><a href="?action=tj&id=<%=id%>&<%=canshu2%>" title="点击更改显示状态"><font color=#999999>×</font></a><%end if%></li>
 <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>
<!--小图放大div-->
<div id="a1" style="position:absolute; z-index:10;"></div>
<%
end if
rs.close
set rs=nothing
%>
</div>
<script language="JavaScript" type="text/JavaScript" src="js/jquery.latest.js"></script> 
<!--#include file="footer.asp"-->