<!--#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">链接管理</a></li>
    </ul>
    </div>
    
    <div class="rightinfo">  
    
    <table class="tablelist">
    	<thead>
    	<tr>
        <tr>
        <th width="35"><input name="chk_all" type="checkbox" class="chk_all" /></th>
        <th width="50">排序</th>
        <th width="130">站点名称</th>
        <th width="180">站点链接</th>
        <th>站点简介</th>
        <th width="100">操作</th>
        </tr>
        </thead>
        <tbody>
        <%
		Pid=clng(Request_QueryString("Pid"))
		If Pid="" or isnull(Pid) Then wherestr="" ELse wherestr="And Pid="&Pid&"" 
        Page=Max(Cnum(sqlshow(Request("page"))),1)
        Set Rs=server.createobject("adodb.recordSet")
        Sql="select * from Jin_Links where Title<>'' "&wherestr&" order by SortID asc,sysID desc"
        Rs.Open Sql,Conn,1,3
        ListPageSize=15
        '显示页数
        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
		If left(trim(Rs("Url")),7)="http://" Then LinkUrl=Trim(Rs("Url")) else LinkUrl=web_root&Trim(Rs("Url"))
        %>     
        <tr>
        <td><input name="chk_ids" type="checkbox" class="chk_ids" value="<%= Rs("sysID") %>" /></td>
        <td><input name="SortID" class="SortID" type="text" value="<%= Rs("SortID") %>" id2="<%=Rs("sysID")%>" style="width:35px; height:22px; text-align:center; outline:none;" /></td>
        <td>
		<%If Rs("Logo")<>"" then%>
        <a href="<%=Web_Root%><%=Rs("Logo")%>" target="_blank" class="preview" onClick="return linknouse();">[<font color="red">图</font>]<%= Rs("Title") %></a>
        <%else%>
        <%= Rs("Title") %>
        <%end if%>
        </td>
        <td><a href="<%=LinkUrl%>" target="_blank"><%= Rs("Url") %></a></td>
        <td><% If isnull(Rs("Info")) and isempty(Rs("Info")) then response.Write "无" else response.Write Rs("Info") %></td>
        <td><a href="Add.asp?Action=linksedit&id=<%= Rs("sysID") %>" class="tablelink">编辑</a> <a href="#" class="tablelink LinkDel" 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="Linksplsc"><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>
    
<%
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("SortID");
autoSave("SortID");
autoSave("SortID");
autoSave("SortID");

autoDel("LinkDel");
autoChkAll("Linksplsc");
});
</script>


<%Call BackFoot()%>