<!--#include file="admin_cook.asp"-->
<!--#include file="../conn.asp"-->
<!--#include file="inc/page_class.asp"-->
<!--#include file="inc/Function.asp"-->
<!--#include file="admin_checkes.asp"-->
<HTML>
<HEAD>
<TITLE>友情链接管理 - 管理页面</TITLE>
<LINK href="images/Style.css" type="text/css" rel="stylesheet">
<META content="MSHTML 6.00.2900.5512" name="GENERATOR">
</HEAD>
<BODY bottomMargin=0 leftMargin=0 topMargin=0 rightMargin=0>
<BR style="OVERFLOW: hidden; LINE-HEIGHT: 3px">
<TABLE class="tableBorder" cellSpacing=1 cellPadding=2 align="center" border=0>
<TBODY>
<TR>
<TH>友情链接管理</TH></TR>
<TR height=25>
<TD class="TableRow1" align="left"><B>操作说明：</B>
<BR>①、你可以任意增加友情链接,然后此做相应的操作. 
</TD></TR>
<TR height=25>
<TD class="TableRow1" align="left"><B>友情链接导航：</B> 
<A href="?act=list">友情链接管理首页</A> | 
<A class="showmeun" href="?act=add">增加友情链接</A> |</TD>
</TR></TBODY></TABLE><BR>
<%
action=request("act")
select case action
case "del":
call del()
case "add"
call add()
case "addok"
call addok()
case "edit":
call edit()
case "editok":
call editok()
case "list":
call list()
case "Linkpass":
call Linkpass()
case "Linkpasses":
call Linkpasses()
case "linkblk":
call linkblk()
case "linkblkes":
call linkblkes()
end select
sub add()
%>
<TABLE class="tableBorder" cellSpacing=1 cellPadding=3 align="center" border=0>
<FORM name="form" action="?act=addok" method="post">
<TBODY>
<TR>
<TH colSpan=2>增加友情链接</TH></TR>
<TR>
<TD class="TableRow1" align="right" width="20%">链接名称：</TD>
<TD class="TableRow1" align="left" width="80%">
<input name="Link_name" type="text" size="50"></TD>
</TR>
<TR>
<TD class="TableRow1" align="right" width="20%">连接网址：</TD>
<TD class="TableRow1" align="left" width="80%">
<input name="Link_url" type="text" size="50"></TD>
</TR>
<TR>
<TD class="TableRow2" align="middle" colSpan=2>
<INPUT class="button" type="submit" value=" 添 加 " name="Submit">
<INPUT class="button" type="reset" value=" 重 填 " name="Submit2"></TD>
</TR>
</FORM>
</TBODY>
</TABLE>
<%
end sub
sub addok()
call LinkAdd()
Link_name=Request.Form("Link_name")
Link_url=Request.Form("Link_url")
set rs=Server.CreateObject("ADODB.RecordSet")
rs.Open"select * from Link",conn,1,3
rs.AddNew
rs("Link_name")=Link_name
rs("Link_url")=Link_url
rs.Update
rs.Close
Succeed("<li>添加友情连接成功</li>")
end sub
sub list()
%>
<TABLE class="tableBorder" cellSpacing=1 cellPadding=3 align="center" border=0>
<TBODY>
<TR>
<TH width="9%">编号</TH>

<TH width="14%">友情链接名称</TH>
<TH noWrap width="21%">友情链接连接地址</TH>
<TH noWrap width="22%">是否通过</TH>
<TH noWrap width="18%">黑名单</TH>
<TH noWrap width="16%">操作选项</TH>
</TR>
<%
sql=""
Dim RS, Sql
sql="select * from Link order by Id desc"
set rs=Server.CreateObject("ADODB.RecordSet")
Dim Obj_CreatePage
Set Obj_CreatePage = New Impression_Page
'/*得到数据连接对象*/
Obj_CreatePage.GetConn = conn
'/*得到Sql查询语句*/
Obj_CreatePage.GetSQL = Sql
'/*设置每页显示条数*/
Obj_CreatePage.PageSize = 20
'/*分页导航(1为有数字,2为无数字)*/
Obj_CreatePage.Page_NavType = 2
'/*分页的文件地址,可提前构造好,支持多参数传递!*/
Obj_CreatePage.File_Path = "Link.asp?act=list&"
Set RS = Obj_CreatePage.GetRs()
If Not(RS.Bof and RS.Eof) Then
For I = 1 to Obj_CreatePage.PageSize
If RS.Eof Then
	Exit For
End If
if rs("Link_passed")=1 then
ToString="待审核"
end if
if rs("Link_passed")=2 then
ToString="未通过"
end if
if rs("Link_passed")=3 then
ToString="已通过"
end if
if rs("Link_lk")=1 then
ToStringes="YES"
end if
if rs("Link_lk")=2 then
ToStringes="NO"
end if
%>
<FORM name="delform" action="?act=del&id=<%=rs("Id")%>" method="post">
<TR>
<TD class="TableRow2" align="center"><%=rs("id")%></TD>

<TD class="TableRow2" noWrap align="middle"><%=rs("Link_name")%></TD>
<TD class="TableRow2" align="middle"><a href="<%=rs("Link_url")%>" title="<%=rs("Link_name")%>" target="_blank"><%=rs("Link_url")%></a></TD>
<TD class="TableRow2" align="middle"><INPUT class="button" type="button" value="<%=ToString%>" name="<%=ToString%>" disabled>
<INPUT class="button" onClick="javascript:location.href='?act=Linkpass&id=<%=rs("Id")%>'" type="button" value="YES" name="Submit1"> 
<INPUT class="button" onClick="javascript:location.href='?act=Linkpasses&id=<%=rs("Id")%>'" type="button" value="NO" name="Submit1">
<TD class="TableRow2" align="middle"><INPUT class="button" type="button" value="<%=ToStringes%>" name="<%=ToStringes%>" disabled>
<INPUT class="button" onClick="javascript:location.href='?act=linkblk&id=<%=rs("Id")%>'" type="button" value="YES" name="Submit1"> 
<INPUT class="button" onClick="javascript:location.href='?act=linkblkes&id=<%=rs("id")%>'"  type="button" value="NO" name="Submit1">
<TD class="TableRow2" align="middle">
<INPUT class="button" onClick="return confirm('您确定要删除选定的友情连接吗?');" type="submit" value="删除" name="Submit2"> 
<INPUT class="button" onClick="javascript:location.href='?act=edit&id=<%=rs("id")%>'" type="button" value="修改" name="Submit1"></TD>
</TR>
</form>
<%
RS.MoveNext
Next
%>
<TR>
<TD colspan="7" align="middle" class="TableRow2">
<%Obj_CreatePage.Page_Navigation()%></TD>
</TR>
<%
Set Obj_CreatePage = Nothing
Else
%>
<TR>
<TD colspan="7" align="middle" class="TableRow2">
当前还没有添加链接</TD>
</TR>
<%End If%>
</TBODY>
</TABLE>
<%
end sub
sub edit()
sql="select * from Link where id="&request.QueryString("id")
set rs=Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
%>
<TABLE class="tableBorder" cellSpacing=1 cellPadding=3 align="center" border=0>
<FORM name="form" action="?act=editok&id=<%=rs("id")%>" method="post">
<TBODY>
<TR>
<TD class="TableRow1" align="right" width="20%">链接名称：</TD>
<TD class="TableRow1" align="left" width="80%">
<input name="Link_name" type="text" size="50" value="<%=rs("Link_name")%>"></TD>
</TR>
<TR>
<TD class="TableRow1" align="right" width="20%">连接网址：</TD>
<TD class="TableRow1" align="left" width="80%">
<input name="Link_url" type="text" size="50" value="<%=rs("Link_url")%>"></TD>
</TR>
<TR>
<TD class="TableRow2" align="middle" colSpan=2>
<INPUT class="button" type="submit" value=" 修 改 " name="Submit">
<INPUT class="button" type="reset" value=" 重 填 " name="Submit2"></TD>
</TR>
</FORM>
</TBODY>
</TABLE>
<%
rs.Close
set rs=nothing
end sub
sub editok()
call LinkEdit()
sql="select * from Link where id="&request.QueryString("id")
set rs=server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,3
rs("Link_name")=Request.Form("Link_name")
rs("Link_url")=Request.Form("Link_url")
rs.Update
rs.Close
set rs=nothing
conn.Close
set conn=nothing
Succeed("<li>编辑友情连接成功</li>")
end sub
%>
<%
sub del()
sql="delete from Link where id="&request.QueryString("id")
conn.Execute(sql)
conn.Close
set conn=nothing
Succeed("<li>删除友情连接成功</li>")
end sub
sub Linkpass()
rs=""
sql=""
dim rs,sql
sql="select * from Link where id="&request.QueryString("id")
set rs=Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,3
rs("Link_passed")=3
rs.Update
rs.Close
set rs=nothing
response.Redirect"?act=list"
end sub
sub Linkpasses()
rs=""
sql=""
dim rs,sql
sql="select * from Link where id="&request.QueryString("id")
set rs=Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,3
rs("Link_passed")=2
rs.Update
rs.Close
set rs=nothing
response.Redirect"?act=list"
end sub
sub linkblk()
rs=""
sql=""
dim rs,sql
sql="select * from Link where id="&request.QueryString("id")
set rs=Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,3
rs("Link_lk")=1
rs.Update
rs.Close
set rs=nothing
response.Redirect"?act=list"
end sub
sub linkblkes()
rs=""
sql=""
dim rs,sql
sql="select * from Link where id="&request.QueryString("id")
set rs=Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,3
rs("Link_lk")=2
rs.Update
rs.Close
set rs=nothing
response.Redirect"?act=list"
end sub

%>
</BODY>
</HTML>

