<!--#include file="include/conn.asp"-->
<%Call limsss(sQxa,"$$webLinks$$")%>
<html>
<title>友情链接</title>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../css/lst.css" rel="stylesheet" type="text/css" />
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<!----头文件---->

<table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2"><tr><td height="31"><div class="titlebt">友情链接</div></td></tr></table>

<table border="1" width="100%" cellpadding="2" style="border-collapse: collapse" bordercolor="#B5D0D9" bgcolor="#FFFFFF">
	<tr>
		<td>
		
		
		
		
<table border="1" width="100%" id="table3" cellspacing="0" style="border-collapse: collapse" bordercolor="#F6F6F6">
<tr>
<td height="30" align="center" bgcolor="#F6F6F6">链接名称</td>
<td height="30" align="center" bgcolor="#F6F6F6">链接地址</td>
<td height="30" align="center" bgcolor="#F6F6F6">链接描述</td>
<td height="30" align="center" bgcolor="#F6F6F6">链接图片</td>
<td height="30" align="center" bgcolor="#F6F6F6">操作</td>
</tr>
<form action="?action=addlinks" method=post>
<tr>
<td height="30" align="center"><input name="aaaa"></td>
<td height="30" align="center"><input name="bbbb"></td>
<td height="30" align="center"><input name="cccc"></td>
<td height="30" align="center"><input name="dddd"></td>
<td height="30" align="center"><input class="ed" type=image src="../images/ico/add.gif"></td>
</tr>
</form>
</table>
<br>
<table border="1" width="100%" id="table3" cellspacing="0" style="border-collapse: collapse" bordercolor="#F6F6F6">
<tr>
<td height="30" align="center" bgcolor="#F6F6F6">链接名称</td>
<td height="30" align="center" bgcolor="#F6F6F6">链接地址</td>
<td height="30" align="center" bgcolor="#F6F6F6">链接描述</td>
<td height="30" align="center" bgcolor="#F6F6F6">链接图片</td>
<td height="30" align="center" bgcolor="#F6F6F6">操作</td>
</tr>
<%
sSql="select * from LstLink order by Id desc"
Set oRs = Server.CreateObject("ADODB.Recordset")
oRs.Open sSql, oconn, 1, 1
If oRs.eof and oRs.bof then
Response.Write ""
Else
Do While Not oRs.eof%>
<form action="?action=eddlinks&Id=<%=oRs("Id")%>" method=post>
<tr>
<td height="30" align="center"><input name="aaaa" value="<%=oRs("LinkTitle")%>"></td>
<td height="30" align="center"><input name="bbbb" value="<%=oRs("LinkUrl")%>"></td>
<td height="30" align="center"><input name="cccc" value="<%=oRs("LinkTxt")%>"></td>
<td height="30" align="center"><input name="dddd" value="<%=oRs("LinkPic")%>"></td>
<td height="30" align="center"><input class="ed" type=image src="../images/ico/save.gif">
<a href="?action=dellinks&Id=<%=oRs("Id")%>"><img src=../images/ico/del.gif></a></td>
</tr>
</form>
<%
oRs.MoveNext
Loop
End If
%>
</table>		
		
		
		
		
		
		</td>
	</tr>
</table>

</body>
</html>
<%
'添加
If action="addlinks" Then
if trim(request("aaaa"))="" or trim(request("bbbb"))="" then
	call alert("不能为空!","webLinks.asp")
end if
	Set oRs=server.createobject("adodb.recordset")
	sSql="Select * from [LstLink] where LinkTitle='"&trim(request("aaaa"))&"'"
	oRs.open sSql,oconn,1,3
	If not oRs.eof then
	Call Alert ("用户名重复,返回重来.","-1")
	End If
		oRs.addnew
		oRs("LinkTitle")=trim(request("aaaa"))
		oRs("LinkUrl")=trim(request("bbbb"))
		oRs("LinkTxt")=trim(request("cccc"))
		oRs("LinkPic")=trim(request("dddd"))
		oRs.update
		oRs.close
		response.redirect "webLinks.asp"
	Set oRs = Nothing
End If
'编辑
If action="eddlinks" Then
if trim(request("aaaa"))="" or trim(request("bbbb"))="" then
	Call alert("不能为空!","webLinks.asp")
end if
	Set oRs=server.createobject("adodb.recordset")
	sSql="Select * from [LstLink] where id="&Id
	oRs.open sSql,oconn,1,3
		oRs("LinkTitle")=trim(request("aaaa"))
		oRs("LinkUrl")=trim(request("bbbb"))
		oRs("LinkTxt")=trim(request("cccc"))
		oRs("LinkPic")=trim(request("dddd"))
		oRs.update
		oRs.close
		call alert("编辑成功!","webLinks.asp")
	Set oRs = Nothing
End If
'删除
If action="dellinks" then
		set ors=Server.CreateObject("ADODB.Recordset")
		sSql="delete * from LstLink WHERE Id = "&Id&" "
		ors.open sSql,oconn,1,3
		set ors=nothing
		call alert("删除成功!","webLinks.asp")
End if
%>
