<!--#include file="../Include/Head.asp"-->
<%session("ListPage")=session("nowpage")%>

	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="../Main/Right.asp">首页</a></li>
    <li><a href="Index.asp">Banner列表</a></li>
    </ul>
    </div>
    
    <div class="rightinfo">
    
    <div class="toola">
    <%
	Pid=clng(Request.QueryString("Pid"))
	%>    
    
    <a href="Index.asp" <%If Pid=0 then%>class="classon"<%end If%>>全部分类</a>
    
	<%
    Set Rs=server.createobject("adodb.recordSet")
    Sql="select * from Jin_FlashClass order by SortID asc,sysID desc"
    Rs.open Sql,conn,1,3
    For i=1 to rs.recordcount
	If Pid=Rs("sysID") then classstr="linkon" else classstr=""
    response.Write "<A href=?Pid="&Rs("sysID")&" class="&classstr&">"&Rs("Name")&"</a>"
    Rs.movenext
    next
    Rs.close
    Set Rs=nothing
    %>
    
    </div>
    
    
    <table class="tablelist">
    	<thead>
    	<tr>
        <tr>
        <th width="35"><input name="chk_all" type="checkbox" class="chk_all" /></th>
        <th width="60">排序</th>
        <th width="130">缩略图</th>
        <th width="180">图片名称</th>
        <th width="180">所属分类</th>
        <th>备注内容</th>
        <th width="120">操作</th>
        </tr>
        </thead>
        <tbody>
        <%
		If Pid<>0 Then Wherestr1="And Pid="&Pid&"" else Wherestr1=""
		If NowLang<>"" Then Wherestr2="And Lang='"&NowLang&"'" else Wherestr2=""
        Page=Max(Cnum(sqlshow(Request("page"))),1)
        Set Rs=server.createobject("adodb.recordSet")
        Sql="select * from Jin_Flash where title<>'' "&Wherestr1&" "&Wherestr2&" order by SortID,sysID desc"
        Rs.Open Sql,Conn,1,3
        ListPageSize=8
        '显示页数
        AllCount=Rs.RecordCount
        Pages=Fix(AllCount/ListPageSize)
        If Pages*ListPageSize<AllCount Then Pages=Pages+1	
        PastCount=(Page-1)*ListPageSize
        If AllCount>PastCount Then Rs.Move PastCount
        ShowCount=Min(AllCount-PastCount,ListPageSize)
        For i=1 To ShowCount
        %>     
        <tr height="60">
        <td><input name="chk_ids" type="checkbox" class="chk_ids" value="<%= Rs("sysID") %>" /></td>
        <td><input type="text" name="SortID" class="BannerSortID" value="<%= Rs("SortID") %>" id2="<%= Rs("sysID") %>" style="width:35px; height:20px; text-align:center; outline:none;" /></td>
        <td><img src="<%=Web_Root%><%=rs("Pic")%>" onload="javascript:DrawImage(this,'120','50')" /></td>
        <td><%= Rs("Title") %><p><%= Rs("Addtime") %></p></td>
        <td><%= get_FlashClassName(Rs("Pid"),"cn") %></td>
        <td><% If isnull(Rs("Content")) and isempty(Rs("Content")) then response.Write "无" else response.Write Rs("Content") %></td>
        <td>
        <%If Rs("Show") then%>
        <a href="?Action=BannerShowNo&id=<%=Rs("sysID")%>" class="tablelink">隐藏</a>
        <%else%>
        <a href="?Action=BannerShow&id=<%=Rs("sysID")%>" class="tablelink"><font color="red">显示</font></a>
        <%end if%>
        <a href="Add.asp?Action=flashedit&id=<%= Rs("sysID") %>" class="tablelink">编辑</a>
        <a href="javascript:;" class="tablelink flashDel" id2="<%=Rs("sysID")%>">删除</a></td>
        </tr>
		<%
        Rs.MoveNext
        Next
        Rs.Close
        Set Rs=nothing
        %>    
        
        </tbody>
    </table>
    
    
    <div class="pagin">
    	<div class="message"><a href="javascript:;" id="flashplsc"><font color="#B50000">批量删除</font></a> &nbsp; 共<i class="blue"> <%=AllCount%> </i>条记录</div>
        <ul class="paginList">
        <%Response.write ShowPages(Pages,Page,"Index.asp?Pid="&Pid&"")%>
        </ul>
    </div>
    
    </div>
    
<%
if Trim(Request.QueryString("Action"))="BannerShowNo" then
	conn.execute "UPDATE [Jin_Flash] SET Show = false WHERE SysID = "&Trim(Request.QueryString("id"))
	Response.Write ("<script language=javascript>window.location=document.referrer;</script>")
end if
if Trim(Request.QueryString("Action"))="BannerShow" then
	conn.execute "UPDATE [Jin_Flash] SET Show = true WHERE SysID = "&Trim(Request.QueryString("id"))
	Response.Write ("<script language=javascript>window.location=document.referrer;</script>")
end if
%>  

<%
Function get_FlashClassName(classid,lang)
	Set Rs0=server.createobject("adodb.recordSet")
	Sql0="select * from Jin_FlashClass where sysID="&classid
	Rs0.open Sql0,conn,1,1
	If lang="en" then className=Rs0("Name_en") else className=Rs0("Name")
	Rs0.close
	Set Rs0=nothing
	get_FlashClassName=className
End Function
%>
<script>
$(document).ready(function(e){
autoSave("BannerSortID");
autoDel("flashDel");
autoClick("BannerShow");
autoClick("BannerShowNO");
autoChkAll("flashplsc");
});
</script>

<%Call BackFoot()%>