⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 web_friend.asp

📁 直接附加数据库! 修改 Include/ Class_Main.asp 为自己信息 后台admin admin 绍兴人才网程序
💻 ASP
字号:
<!--#include file="../Include/Class_Conn.asp" -->
<!--#include file="../Include/Class_Main.asp" -->
<!--#include file="Web_Session.asp" -->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../Css/Css.CSS" type=text/css rel=stylesheet>
<%
'//检测管理员是否有权限操作该页面
If Instr(1,Session("Web_Power"),"203") <= 0 Then 
  Call CloseDB()
  Response.write "对不起!您没有访问该页面的权限..."
  Response.End()
End If

Dim Atcion
Atcion=Request.QueryString ("atcion")
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="5"></td>
  </tr>
</table>
<table width="99%" border="0" align="center"  cellpadding="5" cellspacing="0" bgcolor="fb7a03">
  <tr> 
	    
    <td width="100%" height="22" valign="middle"><font color=ffffff><a href="?"><font color=ffffff><strong>管理首页</strong></font></a> 
      | <a href="?atcion=add"><font color=ffffff><strong>新增合作伙伴</strong></font></a></font></td>
	</tr>
</table>
<table width="99%" border="0" align="center" cellspacing="0">
  <tr>
    <td height="4"></td>
  </tr>
</table>

<%
Select Case Atcion
Case "add"
	Call Add
Case "save"
	Call Save
Case "del"
	Call Del
Case "lock"
	Call Locker
Case "unlock"
	Call UnLocker
Case Else
	Call Main
End Select

Sub Main
	Dim Count,PageCount,Page,OutStr,i
	Dim FieldName(1),FieldValue(1),TopicList
	
	Page=Request.QueryString ("page")
	If Not IsNumeric(Page) Or Page="" Or Page="0" Then
		Page=1
	End If
%>
<table width="99%" border="0" align="center" cellspacing="1" bgcolor="Eff0eb">
  <tr> 
    <td bgcolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" >
        <tr align="center" valign="middle" bgcolor="eff0eb" height="22"> 
          <td width="6%">排序</td>
          <td width="23%">名称</td>
          <td width="12%">图片</td>
          <td width="21%">连接地址</td>
          <td width="9%">类型</td>
          <td width="9%">状态</td>
          <td width="20%">操作</td>
        </tr>
        <%
	SQL="select count(id) from [pH_FriendLink]"
	Set rs=conn.execute(sql)
	Count=rs(0)
	If Count=<0 Then 
		OutStr="<tr height='22' bgcolor='ffffff' width='98%'>"
		OutStr=OutStr&"<td colspan='5'>&nbsp;<font color='red'>暂无内容</font></td>"
		OutStr=OutStr&"</tr></table>"
		response.write OutStr
		response.flush
	Else
		SQL="select top "&Page*Cint(10)&" id,linkname,linkimgpath,linkurl,Columnid,ordernum,state,style,Class from [pH_FriendLink] Where Class=0 order by id desc"
		'Response.Write sql
		Set rs=conn.execute(sql)
		
		If Cint(Page) <>1 Then rs.move Cint(10)*(page-1)
		
		TopicList=rs.getrows(Cint(10))
		rs.close:Set rs=Nothing
	
	    For i=0 To Ubound(TopicList,2)
  %>
        <tr valign="middle" bgcolor="eff0eb" align="center" height="22"> 
          <td><%=TopicList(5,i)%></td>
          <td align="left" bgcolor="eff0eb">&nbsp;<%=HTMLEncode(TopicList(1,i))%></td>
          <td>
		  <% If TopicList(7,i) = 1 Then %>
		  <img src="../UpLoadFiles/Logo/<%=TopicList(2,i)%>" width="88" height="31">
		  <% End if %>
		  </td>
          <td align="left"><a href="<%=TopicList(3,i)%>" target=_blank><%=HTMLEncode(TopicList(3,i))%></a></td>
          <td>
		  <% 
		  If TopicList(8,i) = 1 Then
		   Response.write "友情连接"
		  Elseif TopicList(8,i) = 0 Then
		   Response.write "<font color=#ff0000>合作伙伴</font>"
		  End if
		   %>
		  </td>
          <td> 
            <%If TopicList(6,i) Then response.write "通过" Else response.write "等待审核" End If%>
          </td>
          <td><a href="?atcion=add&postid=<%=TopicList(0,i)%>">编辑</a> 
            | <a href="?atcion=del&postid=<%=TopicList(0,i)%>" onclick="{if(confirm('确定删除吗?')){return true;}return false;}">删除</a></td>
        </tr>
        <%	Next%>
        <tr valign="middle" bgcolor="eff0eb" align="right"> 
          <td height="22" colspan="7">&nbsp; 
            <%Response.Write PageList(Cint(10),Count,Page,FieldName,FieldValue)%>
          </td>
        </tr>
      </table></td>
  </tr>
</table>
<br>
<table width="99%" border="0" align="center" cellspacing="1" bgcolor="eff0eb">
  <tr>
    <td bgcolor="#FFFFFF"><table width="100%" border="0" align="center"  cellpadding="1" cellspacing="1" bgcolor="#FFFFFF" >
        <tr> 
          <td width="100%" height="22" align="left" valign="middle" bgcolor="eff0eb" class=forumRow> 
            <P><font color=#000000>&nbsp;-说明</font>-<BR>
              ①排序号为从大到小排列 <br>
              ②首页只显示最大8个文字站点</P></td>
        </tr>
      </table></td>
  </tr>
</table>
<%	End If
End Sub

Sub Add
	Dim PostId,Level
	Dim LinkName,LinkURL,LinkImgPath,LinkInfo,ColumnId,OrderNum,State,Style
	PostId=Request.QueryString ("postid")
	LinkImgPath=""
	OrderNum=0
	If IsNumeric(PostId) And PostId<>"" And PostId<>"0" Then
		Sql="select * from [pH_FriendLink] where id="&PostId
		Set rs=conn.execute(sql)
		If Not rs.eof And Not rs.bof Then 
			LinkName=rs(1)
			LinkURL=rs(2)
			LinkImgPath=rs(3)
			LinkInfo=rs(4)
			ColumnId=rs(5)
			OrderNum=rs(6)
			State=rs("state")
			Style=rs("Style")
			Class1 = Rs("Class")
		End If
		rs.close
		Set rs=Nothing
	End If
%>
<table width="99%" border="0" align="center" cellspacing="1" bgcolor="eff0eb">
  <tr>
    <td bgcolor="#FFFFFF"><table width="80%" border="0" cellpadding="0" cellspacing="1"  align="left">
        <form name=a1  method="post" action="?atcion=save&postID=<%=postid%>">
          <tr align="center" valign="middle" bgcolor="eff0eb"> 
            <td height="25" colspan="2">合作伙伴管理</td>
          </tr>
          <tr bgcolor="eff0eb" valign="middle"> 
            <td width="20%" height="25" align="center">网站名称</td>
            <td height="25" align="left">&nbsp; <input type="text" name="name" size="30" value="<%=LinkName%>"></td>
          </tr>
          <tr bgcolor="eff0eb" valign="middle"> 
            <td width="20%" height="25" align="center">网站图片地址</td>
            <td height="25" align="left">&nbsp; <input type="text" name="img" size="40" value="<%=LinkImgPath%>" onChange="if(this.value!=''){faceview.src=this.value;}"> 
              &nbsp;<img src="../UpLoadFiles/Logo/<%=LinkImgPath%>" Width=88 Height=31 name="faceview" id="faceview"></td>
          </tr>
          <tr bgcolor="eff0eb" valign="middle"> 
            <td width="20%" height="25" align="center">网站连接地址</td>
            <td height="25" align="left">&nbsp; <input type="text" name="url" size="40" value="<%=LinkURL%>"></td>
          </tr>
          <tr bgcolor="eff0eb" valign="middle"> 
            <td width="20%" height="25" align="center">网站简介</td>
            <td height="25" align="left">&nbsp; <textarea name="info" cols="40" wrap="VIRTUAL"><%=LinkINfo%></textarea></td>
          </tr>
          <tr bgcolor="eff0eb" valign="middle"> 
            <td width="20%" height="25" align="center">排序号</td>
            <td height="25" align="left">&nbsp; <input type="text" name="order" size="5" value="<%=OrderNum%>" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"></td>
          </tr>
          <tr bgcolor="eff0eb" valign="middle"> 
            <td width="20%" height="25" align="center">状态</td>
            <td height="25" align="left">&nbsp; <select name="state">
                <option value="1"<%If State Then response.write " selected"%>>通过</option>
                <option value="0" <%If Not State Then response.write " selected"%>>不通过</option>
              </select></td>
          </tr>
          <tr bgcolor="eff0eb" valign="middle"> 
            <td width="20%" height="25" align="center">显示风格</td>
            <td height="25" align="left">&nbsp; <select name="style">
			    <option value="0" <%If Style="0" Then response.write " selected"%>>文本</option>
                <option value="1"<%If Style="1" Then response.write " selected"%>>图片</option>
                
              </select></td>
          </tr>
          <tr bgcolor="eff0eb" valign="middle">
            <td height="25" align="center">类 型</td>
            <td height="25" align="left">&nbsp; <select name="class">
			   <option value="0" <%If Class1="0" Then response.write " selected"%>>合作伙伴</option>
                <option value="1"<%If Class1="1" Then response.write " selected"%>>友情连接</option>
                
              </select></td>
          </tr>
          <tr bgcolor="eff0eb"> 
            <td height="25" colspan="2" align="center" valign="middle"> <input type="submit" name="Submit" value="更新"> 
              &nbsp; <input type="reset" name="Submit2" value="重置"></td>
          </tr>
        </form>
      </table></td>
  </tr>
</table>
<%End Sub

Function Save
	If Not ChkPost Then
     Response.write "对不起,请不要从外部提交数据!"
     Response.End()
	End If
	
	Dim LinkName,LinkURL,LinkImgPath,LinkInfo,ColumnId,OrderNum,State,Style
	Dim PostId
	
	PostId=Request.QueryString ("postid")
	LinkName=HTMLEncode(request.Form("name"))
	LinkURL=request.Form("url")
	LinkImgPath=request.Form("img")
	LinkInfo=HTMLEncode(request.Form("info"))
	ColumnId=request.Form("column")
	OrderNum=request.Form("order")
	State=request.Form("state")
	Style=request.form("style")
	Class1 = request.form("class")
	If LinkName="" Or Len(LinkName)>50 Then
     Response.write "对不起,联盟网站的名称长度不符!"
     Response.End()
	End If
	If LinkURL="" Or Len(LinkURL)>150 Then
     Response.write "对不起,联盟网站的连接地址长度不符!"
     Response.End()
	End If
	If Len(LinkImgPath)>150 Then
     Response.write "对不起,联盟网站的图片地址长度不符!"
     Response.End()
	End If
	If OrderNum="" Or Not IsNumeric(OrderNum) Then OrderNum=0
		
	If IsNumeric(PostId) And PostId<>"" And PostId<>"0" Then
		Sql="update [pH_FriendLink] set linkname='"&LinkName&"',linkimgpath='"&LinkImgPath&"',linkurl='"&LinkURL&"',linkinfo='"&LinkInfo&"',ordernum="&OrderNum&",State="&State&",Style="&Style&",Class="&Class1&" where id="&PostId
	Else
		Sql="insert into [pH_FriendLink] (LinkName,LinkURL,LinkImgPath,LinkInfo,OrderNum,State,Style,Class) values ('"&LinkName&"','"&LinkURL&"','"&LinkImgPath&"','"&LinkInfo&"',"&OrderNum&","&State&","&Style&","&Class1&")"
	End If
	'Response.Write sql
	conn.execute(sql)
	
	CloseDB
	Response.Redirect "Web_Friend.asp"
End Function

Function Del
	If Not ChkPost Then 
     Response.write "对不起,请不要从外部提交数据!"
     Response.End()
	End If
	
	Dim PostId
	PostId=Request.QueryString ("postid")
	Check_ID(PostID)
	If IsNumeric(PostId) And PostId<>"" And PostId<>"0" Then
		sql="delete from [pH_FriendLink] where ID="&PostId
		conn.execute(sql)
	End If
	Response.Redirect Request.ServerVariables("HTTP_REFERER")
End Function
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -