<!--#include file="../siteconfig/conn.asp"-->
<%
if session("adminlogin")<>sessionvar then
Response.Write("<script language=javascript>alert('你尚未登录，或者超时了！请重新登录');this.location.href='login.asp';</script>")
Response.End
End if
%>
<!--#include file="Admin_UrlFunction.asp"-->
<HTML>
<HEAD>
<TITLE>网址管理</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<link href="./images/admincp/admincp.css" rel="stylesheet" type="text/css" />

</HEAD>

<script language="JavaScript" type="text/javascript" src="js.js"></script>
<BODY>

<h3>网址管理</h3>
<%Url_UrlClassId
Url_UrlClassId=Request("Url_UrlClassId")
if Url_UrlClassId<1 then
   rs.open"select * from Url",conn,1,3
else
   rs.open"select * from Url where Url_UrlClassId="&Url_UrlClassId,conn,1,3
end if
dim UrlCount,pn
pn=Request("pn")
if pn="" then pn=1
UrlCount = int(rs.recordcount)
dim UrlPageCount,UrlPageSize
UrlPageSize=15
UrlPageCount=int(UrlCount/UrlPageSize)+1
redim UrlArray(UrlCount,6)
dim j,i
j=1
while not rs.eof and not rs.bof
   UrlArray(j,0)=rs("Url_Id")
   UrlArray(j,1)=rs("Url_Name")
   UrlArray(j,2)=rs("Url_Url")
   UrlArray(j,3)=rs("Url_Memo")
   UrlArray(j,4)=rs("Url_UrlClassId")
   UrlArray(j,5)=rs("Url_TopId")
   UrlArray(j,6)=rs("Url_Yn")
   j=j+1
rs.movenext
wend
rs.close%>
<table width="96%" border="0" cellspacing="1" cellpadding="8" align="center" class="tb tb2 fixpadding">
  <tr>
    <td class="vtop lineheight">ID</td>
    <td class="vtop lineheight">网站名称</td>
    <td class="vtop lineheight">网址URL</td>
    <td class="vtop lineheight">网站描术</td>
    <td class="vtop lineheight">分类名称</td>
    <td class="vtop lineheight">推荐级别</td>
	<td class="vtop lineheight">是否审查</td>
    <td class="vtop lineheight">编辑</td>
    <td class="vtop lineheight">删除</td>
  </tr>
<%if pn=1 then 
  i=1
else
  i=UrlPageSize*pn-UrlPageSize
end if
for i=i to int(pn*UrlPageSize)-1
%>
  <tr>
    <td class="vtop lineheight"><%=UrlArray(i,0)%></td>
    <td class="vtop lineheight" title="<%=UrlArray(i,1)%>"><%=Left(UrlArray(i,1),6)%></td>
    <td class="vtop lineheight" title="<%=UrlArray(i,2)%>"><a href="<%=UrlArray(i,2)%>" target="_blank"><%=Left(UrlArray(i,2),30)%></a></td>
    <td class="vtop lineheight"><%=Left(UrlArray(i,3),15)%></td>
    <td class="vtop lineheight"><%rs.open"select UrlClass_Id,UrlClass_Name from UrlClass where UrlClass_Id="&UrlArray(i,4),conn,1,3
	if rs("UrlClass_Id")="" then
	   response.write "无分类"
	else
	   response.write rs("UrlClass_Name")
	end if
	rs.close%></td>
    <td class="vtop lineheight"><%=UrlArray(i,5)%></td>
	<td class="vtop lineheight">
	<%if UrlArray(i,6)=1 then%>
	     <a href="#" onClick="javascript:DivOpenClose('Admin_Url_Yn.asp?Url_Id=<%=UrlArray(i,0)%>',1,450,150);return false"><font color=#FF0000>未通过</font></a>
	<%else%>
	     <a href="#" onClick="javascript:DivOpenClose('Admin_Url_Yn.asp?Url_Id=<%=UrlArray(i,0)%>',1,450,150);return false">已通过</a>
	<%end if%>
	</td>
    <td class="vtop lineheight"><a href="#" onClick="javascript:DivOpenClose('Admin_UrlUp.asp?Url_Id=<%=UrlArray(i,0)%>',1,450,350);return false">编辑</a></td>
    <td class="vtop lineheight"><a href="#" onClick="javascript:DivOpenClose('Admin_UrlDel.asp?Url_Id=<%=UrlArray(i,0)%>',1,450,150);return false">删除</a></td>
  </tr>
<%if i=UrlCount then exit for
next%>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><div align="center"><a href="#" onClick="javascript:DivOpenClose('Admin_UrlAllAdd.asp',1,600,450);return false"><font color="#669900">批量添加</font></a> <a href="#" onClick="javascript:DivOpenClose('Admin_UrlAdd.asp',1,450,350);return false"><font color="#669900">添加网址</font></a>
  <%if pn=1 then%>
<font color="#999999">首页</font> <font color="#999999">上一页</font> <a href='?Url_UrlClassId=<%=Url_UrlClassId%>&pn=2'>下一页</a> <a href='?Url_UrlClassId=<%=Url_UrlClassId%>&pn=<%=UrlPageCount%>'>未页</a>
<%else
   if UrlPageCount<>int(pn) then%>
      <a href='?Url_UrlClassId=<%=Url_UrlClassId%>&pn=1'>首页</a> <a href='?Url_UrlClassId=<%=Url_UrlClassId%>&pn=<%=pn-1%>'>上一页</a> <a href='?Url_UrlClassId=<%=Url_UrlClassId%>&pn=<%=pn+1%>'>下一页</a> <a href='?Url_UrlClassId=<%Url_UrlClassId%>&pn=<%=UrlPageCount%>'>未页</a>
     <%else%>
      <a href='?Url_UrlClassId=<%=Url_UrlClassId%>&pn=1'>首页</a> <a href='?Url_UrlClassId=<%=Url_UrlClassId%>&pn=<%=UrlPageCount-1%>'>上一页</a> <font color="#999999">下一页</font> <font color="#999999">未页</font>
     <%end if
end if%>
每页<%=UrlPageSize%>条 当前第<%=pn%>页 共<%=UrlPageCount%>页</div></td>
    <td><form name="GoFrom" method="post" action="?Url_UrlClassId=<%=Url_UrlClassId%>" id="GoFrom" onSubmit="return GoCheck();" style="margin-bottom:0px;"><input name="pn" type="text" value="<%=pn%>" size="3" style="color: #669900;    background-color: #FFFFFF; border: #006699; border-style: dashed; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px"><input name="submit" type="submit" value="跳到" style="color: #669900;    background-color: #FFFFFF; border: #006699; border-style: dashed; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px">
</form></td>
  </tr>
</table>
<div id="DivMenu" style="position:absolute; width:100%; height:100%; z-index:1; left: 0px; top: 0px; filter:Alpha(opacity=50); background-color: #E8E8E8; layer-background-color: #E8E8E8; border: 1px none #000000; visibility: hidden;"></div>
<div id="DivIframe" style="position:absolute; width:55%; height:400px; z-index:1; visibility: hidden; overflow: visible; filter:Alpha(opacity=80);"><iframe id=OpenIframe name=OpenIframe src=londing.html width=100% height=100% frameborder=0 scrolling=no>修改分类</iframe>
</div>
</BODY>
</HTML>

