www.gusucode.com > 学校共青团组织网站源代码 > 学校共青团组织网站源代码/626/admin/admin_link.asp

    <%
if Request.Cookies("admindj")<>"1" then
   Response.Write "<BR><BR><BR><BR><center>权限不足,你没有此功能的管理权限"
   Response.end
end if
%>
<!--#include file = admin_chk.asp -->
<!--#include file = admin_conn.asp -->
<!--#include file = titleb.asp -->
<html>

<head>
<!--#include file = language.asp -->

<STYLE type="text/css">
<!--
a:link       {text-decoration: none; font-family: AdobeSm; color: #000000 }
a:visited    {text-decoration: none; color: #000000 }
A:hover      {COLOR: green; FONT-FAMILY: "宋体,MingLiU"; TEXT-DECORATION: underline}
body         {font-size: 9pt; font-family: 宋体,MingLiU, Arial;color: #000000}
TD           {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000;table-layout:fixed;word-break:break-all}
p            {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000}
input        {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000}
body         {margin-top: 0; margin-bottom: 0;margin-left:0;margin-right:0; color: #000000}
select       {FONT-SIZE: 9PT;}
option       {FONT-SIZE: 9pt;}
textarea     {FONT-SIZE: 9pt;}
-->
</STYLE>
</head>

<body bgcolor="#ffffff">

<div align="center">
	<table border="0" width="600" id="table1">
		<tr>
			<td> </td>
		</tr>
		<tr>
			<td>
			<p align="center"><b>
			<span style="font-size: 9pt"><a href="admin_link_code.asp">
			友情链接调用</a> <a target="_blank" href="../Link-ShenQing.asp">友情链接申请页面</a></span> 
			<a href="admin_link_mb.asp">模版管理</a></b></td>
		</tr>
		<tr>
			<td>
<%
DELid=trim(request("DELid"))

if DELid<>"" then
	conn.Execute "delete from [Link] where ID="&Clng(delid)
end if
if request("edit")="1" and request("id")<>"" then
  sql = "select * from link where id="&request("ID")
  Set rs = Server.CreateObject("ADODB.RecordSet")
  rs.Open sql,conn,1,1
  if rs.recordcount<>0 then
  	eid=rs("id")
  	elinkname=rs("linkname")
  	eurl=rs("url")
  	elb=rs("lb")
  	elogo=rs("logo")
  	ejs=rs("js")
  	epic=rs("pic")
  	esh=rs("sh")
  end if
end if

if (not isNumeric(epic)) then
	epic=0
end if
if (not isNumeric(ESH)) then
	esh=1
end if
%>
			<!--webbot BOT="GeneratedScript" PREVIEW=" " startspan --><script Language="JavaScript" Type="text/javascript"><!--
function FrontPage_Form1_Validator(theForm)
{

  if (theForm.linkname.value == "")
  {
    alert("请在 网站名称 域中输入值。");
    theForm.linkname.focus();
    return (false);
  }

  if (theForm.linkname.value.length < 1)
  {
    alert("在 网站名称 域中,请至少输入 1 个字符。");
    theForm.linkname.focus();
    return (false);
  }

  if (theForm.linkname.value.length > 255)
  {
    alert("在 网站名称 域中,请最多输入 255 个字符。");
    theForm.linkname.focus();
    return (false);
  }

  if (theForm.url.value == "")
  {
    alert("请在 网站地址 域中输入值。");
    theForm.url.focus();
    return (false);
  }

  if (theForm.url.value.length < 10)
  {
    alert("在 网站地址 域中,请至少输入 10 个字符。");
    theForm.url.focus();
    return (false);
  }
  return (true);
}
//--></script><!--webbot BOT="GeneratedScript" endspan --><form method="POST" action="admin_link_add_save.asp?id=<%=eid%>" name="FrontPage_Form1" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript">
				<table border="1" width="100%" id="table2" cellspacing="0" cellpadding="3" style="border-collapse: collapse" bordercolor="#C0C0C0">
					<tr>
						<td align="left" background="../images/topBar_bg.gif" colspan="2">&nbsp;<b>添加/修改友情链接
						          </b></td>
					</tr>
					<tr>
						<td width="98" align="center">网站名称</td>
						<td>
						&nbsp;<!--webbot bot="Validation" s-display-name="网站名称" b-value-required="TRUE" i-minimum-length="1" i-maximum-length="255" --><input type="text" name="linkname" size="31" value='<%=elinkname%>' maxlength="255"></td>
					</tr>
					<tr>
						<td width="98" align="center">网站地址</td>
						<td>
						&nbsp;<!--webbot bot="Validation" s-display-name="网站地址" b-value-required="TRUE" i-minimum-length="10" --><input type="text" name="url" size="42" value='<%=eurl%>'></td>
					</tr>
					<tr>
						<td width="98" align="center">网站分类</td>
						<td>
						&nbsp;<select size="1" name="lb">
						<option value="">请选择</option>
						<%
						lbid=elb
						if (not isNumeric(LBID)) then
							lbid=0
						end if
						
						set rs2 = Server.CreateObject("ADODB.RecordSet")
						rs2.Open "select * from [LINKLB] order by id asc",conn,1,1
						while not rs2.eof
						%>
						<option <% if clng(lbid)=clng(rs2("id")) then Response.Write " selected "%> value="<%=rs2("ID")%>"><%=rs2("lb")%></option>
						<%
						rs2.movenext
						wend
						rs2.close
						set rs2=nothing
						%>
						</select></td>
					</tr>
					<tr>
						<td width="98" align="center">网站LOGO</td>
						<td>
						&nbsp;<input type="text" name="logo" size="52" value='<%=elogo%>'> 图片 宽:88 高:31</td>
					</tr>
					<tr>
						<td width="98" align="center">网站介绍</td>
						<td>
						&nbsp;<input type="text" name="js" size="52" value='<%=ejs%>'></td>
					</tr>
					<tr>
						<td width="98" align="center">有无图片</td>
						<td>
						&nbsp;<input type="radio" value="1" <% if clng(epic)=1 then Response.Write " checked "%> name="PIC" id=pic1><label for=pic1>有LOGO</label>
						<input type="radio" name="PIC" <% if clng(epic)=0 then Response.Write " checked "%> value="0" id=pic2><label for=pic2>没有LOGO</label></td>
					</tr>
					<tr>
						<td width="98" align="center">是否审核</td>
						<td>
						&nbsp;<input type="radio" name="SH" value="1" <% if esh="1" then Response.Write " checked "%> id=sh1><label for=sh1>已经审核</label>
						<input type="radio" name="SH" value="0"  <% if esh="0" then Response.Write " checked "%>  id=sh2><label for=sh2>取消审核</label></td>
					</tr>
					<tr>
						<td align="center" colspan="2"><input type="submit" value="保存" name="B1">  <input type='button' value='取消' onclick="javascript:location.href='?'"></td>
					</tr>
				</table>
			</form>
			</td>
		</tr>
	</table>
</div>
<%
id=trim(request("id"))
ontop=trim(request("ontop"))
upd=trim(request("upd"))
addtime=date()

if ontop<>"" then
  conn.Execute "update [link] set ontop="&ontop&" where id="&clng(id)
elseif upd<>"" then
  conn.Execute "update [link] set upd='"&addtime&"' where id="&clng(upd)
end if
  sql = "select * from link order by ontop desc , upd desc , id desc"
  Set rs = Server.CreateObject("ADODB.RecordSet")
  rs.Open sql,conn,1,1
  
%>
<div align="center">
	<table border="1" id="table3" width=760 cellpadding="3" style="border-collapse: collapse" cellspacing="0">
		<tr>
			<td align="center" background="../images/topBar_bg.gif"><b>LOGO</b></td>
			<td align="center" background="../images/topBar_bg.gif"><b>网站名称</b></td>
			<td align="center" background="../images/topBar_bg.gif"><b>分类</b></td>
			<td align="center" background="../images/topBar_bg.gif"><b>操 作</b></td>
		</tr>
<%
if rs.recordcount<>0 then

page=int(request.QueryString ("page"))
rs.PageSize=20
pagecount=rs.pagesize
if page<=0 then page=1
if request.QueryString("page")="" then page=1
rs.AbsolutePage=page
   for i=0 to pagecount
     ontop=rs("ontop")
     if ontop="" then ontop=3
     if ontop="3" then 
       ontop=5
     else
       ontop=3
     end if
%>
		<tr >
			<td align=center style="table-layout:fixed;word-break:break-all" height="25">
			<%
			if trim(rs("logo"))<>"" then
			   response.write "<a href="&rs("url")&" target=_blank title='"&rs("js")&"'><img border=0 width=88 height=31 src=" & rs("logo") & "></a>"
			end if
			%></td>
			<td height="25" align=center><a href="<%=rs("url")%>" title='<%=rs("url")%>' target=_blank>
<%=rs("linkname")%></a></td>
			<td align=center height="25"><%if rs("ontop")="5" then Response.Write "<b><font color=blue>[顶]</font></b>"%>
			<%
			set rs2 = Server.CreateObject("ADODB.RecordSet")
			rs2.Open "select * from [LINKLB] where [ID]="&rs("lb")&" order by id desc",conn,1,1
			if rs2.recordcount<>0 then
				Response.Write rs2("lb")
			end if
			rs2.close
			set rs2=nothing
			%>
			</td>
			<td height="25" width=200>
			<%
			if rs("sh")="1" then 
				ssss="已经审核"
			else
				ssss="<font color=blue>没有审核</font>"
			end if
			%>
			<p align="center"><a href="admin_link.asp?id=<%=rs("id")%>&edit=1">修改(<%=SSSS%>)</a> <a href='admin_link.asp?ontop=<%=ontop%>&id=<%=rs("id")%>'>固顶</a> <a href=admin_link.asp?upd=<%=rs("id")%>>提升</a> 
			<a href="?DELid=<%=rs("id")%>">删除</a></td>
		</tr>
<%
 Response.flush 
 rs.movenext
 if rs.eof then exit for
 next

end if
%>
	</table>
</div><br>
<center>
<%if rs.recordcount<>0 then
  if page>1 then
    response.write "<a href="&request.servervariables("URL")&"?page=1>首页</a> "
    response.write "<a href="&request.servervariables("URL")&"?page="&page-1&">上一页</a> "
  end if
  if page<rs.pagecount then
    response.write "<a href="&request.servervariables("URL")&"?page="&page+1&">下一页</a> "
    response.write "<a href="&request.servervariables("URL")&"?page="&rs.pagecount&">尾页</a> "
  end if
    response.write "共"&rs.recordcount&"条 每页显示"&pagecount&"条 共"&rs.pagecount&"页 "
  %>

<%end if%>
</center>
</body>
<%
conn.close
set conn=nothing
%>
</html>