<!-- #include file="../inc/checkadmin.asp" -->
<!-- #include file="../inc/conn.asp" -->
<!-- #include file="inc/Config.asp" -->

<%
if request.QueryString("delete")="all" then
editid=request.Form("id")
if editid="" then
response.write "<script>alert('亲爱的，您未选定任何数据！');location.href='LinkList.asp'</script>"
response.end 
end if
set rs=server.createobject("adodb.recordset")
sql="delete from web_link where id in ("& editid &")"
rs.open sql,conn,1,3
response.write "<script>alert('恭喜，已成功删除选定的数据！');location.href='LinkList.asp'</script>"
response.end 
end if
%>

<% if request.QueryString("delete")<>"" then
de_id=request.QueryString("delete")
set rs=server.createobject("adodb.recordset")
sql="select * from web_link where id="&de_id&""
rs.open sql,conn,1,3
rs.filter= "id ="&de_id&""
rs.delete
rs.update
response.write "<script>alert('恭喜，已成功删除编号为："&de_id&" 的友情链接！');location.href='LinkList.asp'</script>"
rs.close
set rs=nothing
response.end
end if
%>
<% 
ye=Request.QueryString("page")
if ye="" then
yema=""
else
yema=" - 第"&ye&"页" 
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
		
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		
		<title>链接列表<%=yema%> - <%=admin_name%></title>
		
		<!--                       CSS                       -->
	  
		<!-- Reset Stylesheet -->
		<link rel="stylesheet" href="images/css/reset.css" type="text/css" media="screen" />
	  
		<!-- Main Stylesheet -->
		<link rel="stylesheet" href="images/css/style.css" type="text/css" media="screen" />
		
		<!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
		<link rel="stylesheet" href="images/css/invalid.css" type="text/css" media="screen" />	
		
		<!-- Colour Schemes
	  
		Default colour scheme is green. Uncomment prefered stylesheet to use it.
		
		<link rel="stylesheet" href="images/css/blue.css" type="text/css" media="screen" />
		
		<link rel="stylesheet" href="images/css/red.css" type="text/css" media="screen" />  
	 
		-->
		
		<!-- Internet Explorer Fixes Stylesheet -->
		
		<!--[if lte IE 7]>
			<link rel="stylesheet" href="images/css/ie.css" type="text/css" media="screen" />
		<![endif]-->
		
		<!--                       Javascripts                       -->
  
		<!-- jQuery -->
		<script type="text/javascript" src="images/scripts/jquery-1.3.2.min.js"></script>
		
		<!-- jQuery Configuration -->
		<script type="text/javascript" src="images/scripts/simpla.jquery.configuration.js"></script>
		
		<!-- Facebox jQuery Plugin -->
		<script type="text/javascript" src="images/scripts/facebox.js"></script>
		
		<!-- jQuery WYSIWYG Plugin -->
		<script type="text/javascript" src="images/scripts/jquery.wysiwyg.js"></script>
		
		<!-- jQuery Datepicker Plugin -->
		<script type="text/javascript" src="images/scripts/jquery.datePicker.js"></script>
		<script type="text/javascript" src="images/scripts/jquery.date.js"></script>
		<!--[if IE]><script type="text/javascript" src="images/scripts/jquery.bgiframe.js"></script><![endif]-->

		
		<!-- Internet Explorer .png-fix -->
		
		<!--[if IE 6]>
			<script type="text/javascript" src="images/scripts/DD_belatedPNG_0.0.7a.js"></script>
			<script type="text/javascript">
				DD_belatedPNG.fix('.png_bg, img, li');
			</script>
		<![endif]-->
		<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
var checkflag = "false";
function check(field) {
if (checkflag == "false") {
for (i = 0; i < field.length; i++) {
field[i].checked = true;}
checkflag = "true";
return "false"; }
else {
for (i = 0; i < field.length; i++) {
field[i].checked = false; }
checkflag = "false";
return "true"; }
}
//  End -->
</script>
	</head>
  
	<body><div id="body-wrapper"> <!-- Wrapper for the radial gradient background -->
		<!-- #include file="Menu.asp" -->
		 <!-- End #sidebar -->
		
		<div id="main-content"> <!-- Main Content Section with everything -->
      			<noscript> <!-- Show a notification if the user has disabled javascript -->
				<div class="notification error png_bg">
					<div>
						亲爱的，你的浏览器不支持。请升级您的浏览器。</div>
				</div>
</noscript>
			
			<!-- Page Head -->
			<div class="content-box">
			  <!-- Start Content Box -->
			  <div class="content-box-header">
			    <h3>链接列表</h3>
			    <ul class="content-box-tabs">
			      <li></li>
			      <!-- href must be unique and match the id of target div -->
		        </ul>
			    <div class="clear"></div>
		      </div>
			  <!-- End .content-box-header -->
			  <div class="content-box-content">
			    <div class="tab-content default-tab" id="tab1">
			      <!-- This is the target div. id must match the href of this div's tab -->
			      <div class="notification attention png_bg"> <a href="#" class="close"><img src="images/images/icons/cross_grey_small.png" title="Close this notification" alt="close" /></a>
			        <div> 操作提示：在这里您可以对网站的友情链接进行管理。</div>
		          </div>
			      <table>
                  <form name="form" method="post" action="?delete=all">
			        <thead>
		            </thead>
			        <tr>
			          <th width="5%"><input type=checkbox value="全选" onClick="this.value=check(this.form.id)"></th>
			          <th width="7%" >编号</th>
			          <th width="10%" >网站名称</th>
			          <th width="10%" >网站地址</th>
			          <th width="6%" >排序</th>
			          <th width="8%" >状态</th>
			          <th width="20%" >介绍</th>
			          <th width="9%" >NoFollow</th>
			          <th width="15%" >时间</th>
			          <th width="9%" >操作</th>
		            </tr>
			        <tbody>
<% 
nokey=request.QueryString("key")
if nokey="yes" then 
keys=request.form("Keyword")
set rs=server.createobject("adodb.recordset")
sql="select * from web_link where ( name like '%"&keys&"%') or ( url like '%"&keys&"%') order by id desc"
rs.open(sql),conn,1,1
If rs.bof And rs.eof Then
response.write "<font color='#FF0000'><b>对不起，找不到相关链接。<a href='LinkList.asp'>返回列表</a></b><font/></br></br>"

response.end
else
set rs=server.createobject("adodb.recordset")
sql="select * from web_link where ( name like '%"&keys&"%') or ( url like '%"&keys&"%') order by id desc"
rs.open(sql),conn,1,1
rs.pagesize=1000
end if
else

set rs=server.createobject("adodb.recordset")
sql="select * from web_link order by id desc"
rs.open(sql),conn,1,1
If rs.bof And rs.eof Then
response.write "暂时没有任何连接。<br/><br/>"
response.end
end if
rs.pagesize=10 
end if
page=Request.QueryString("page") 
if page="" then page=1
rs.absolutepage=page 
for i= 1 to rs.pagesize
if rs.eof then
exit for
end if
l_id=rs("id")
l_name=rs("name")
l_url=rs("url")
l_image=rs("image")
l_paixu=rs("paixu")
l_jieshao=rs("jieshao")
l_NoFollow=rs("NoFollow")

l_view_yes=rs("view_yes")
l_time=rs("time")
%>
			          <tr>
			            <td ><input type="checkbox" name="id" value="<%=l_id%>" ></td>
			            <td ><%=l_id%></td>
			            <td ><a href="<%=l_url%>" target="_blank"><%=l_name%></a></td>
			            <td ><%=l_url%></td>
			            <td ><%=l_paixu%></td>
			            <%if l_view_yes=1 then
view_yeszt="<font color='#666666'>显示</font>"
else
view_yeszt="<font color='#DC4900'>隐藏</font>"
end if
%>
			            <td ><%=view_yeszt%></td>
			            <td ><a title="<%=l_jieshao%>"><%=left(l_jieshao,12)%>..</a></td>
			            <%if l_NoFollow=1 then
NoFollowzt="是"
else
NoFollowzt="否"
end if
%>
			            <td ><%=NoFollowzt%></td>
			            <td ><%=l_time%></td>
			            <td ><a href="EditLink.asp?id=<%=l_id%>" ><img src="images/images/icons/hammer_screwdriver.png" alt="Edit Meta" /></a> &nbsp; &nbsp; <a href="?delete=<%=l_id%>" onclick="return confirm('请注意，删除后不可恢复！\n\n您真的确定要删除此条数据吗?')"><img src="images/images/icons/cross.png" alt="Delete" /></a></td>
		              </tr>
			          <%
rs.movenext
next
%>
		            </tbody>
		          </table>
			      <p><input type="submit"  value="删除所选" /></form>
                  <br><div align="center"><form id="form1" name="form1" method="post" action="?key=yes">
			        查找：<input name="Keyword" type="text" id="kew" size="25" />
			        <input type="submit" name="button" id="button" value="查找" />&nbsp;&nbsp;查找条件：网站名称、网站地址</form></div>
			        </p><p>
当前第<%=page%>页，共有<%=rs.pagecount%>页，共有：<%=rs.recordcount%>条记录，每页显示<%=rs.pagesize%>条记录
<%if page=1 then%>
首页
<%else%>
<a href="?page=1">首页</a>
<%end if%>

<%if page=1 then%>
上一页
<%else%>
<a href="?page=<%=page-1%>">上一页</a>
<%end if%>

<%if rs.pagecount<page+1 then%>
下一页
<%else%>
<a href="?page=<%=page+1%>">下一页</a>
<%end if%>

<%if rs.pagecount<page+1 then%>
尾页
<%else%>
<a href="?page=<%=rs.pagecount%>">尾页</a>
<%end if
rs.close
set rs=nothing
%>
		          </p>
</div>
			    <!-- End #tab1 -->
			    <div class="tab-content" id="tab2"></div>
			    <!-- End #tab2 -->
		      </div>
		  <!-- End .content-box-content --></div> <!-- End .clear --><!-- End .content-box --><!-- End .content-box --><!-- End .content-box -->

			
			
			<!-- Start Notifications --><!-- End Notifications -->
			
<div id="footer">
				<small> <!-- Remove this notice or replace it with whatever you want -->
						<%=Copyright%>
				</small>
			</div><!-- End #footer -->
			
		</div> <!-- End #main-content -->
		
	</div></body>
  

</html>
<!-- #include file="../inc/close.asp" -->