📄 controlfriend.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="function/UserView.asp"-->
<!--#include file="function/addfriend.asp"-->
<!--#include file="function/delfriend.asp"-->
<%
IF Request.Form("add")="yes" Then
FriendName=Request.Form("FriendName")
AddFriend(FriendName)
End IF
IF Request.Form("del")="yes" Then
DelFriend
End IF
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<!--#include file="inc/css.asp"-->
<script Language="JavaScript">
function CheckAll(form) {
for (var i=0;i<form.elements.length;i++) {
var e = form.elements[i];
e.checked = "checked";
}
}
</script>
<title><%=WebSiteName%></title>
</head>
<body topmargin="0" background="images/bg.gif">
<!--#include file="top.asp"-->
<div align="center">
<center>
<table border="0" width="755" cellspacing="0" cellpadding="0" height="341">
<tr>
<td width="189" style="background-color: #FFFFFF; border-left: 1 solid #000000; border-top: 1 solid #000000; border-bottom: 1 solid #000000" valign="top" height="341">
<!--#include file="cleft.asp"-->
</td>
<td width="562" style="background-color: #FFFFFF; border: 1 solid #000000" valign="top" height="341">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="20%" height="25" bgcolor="#EDEDED" style="border-right: 1 solid #000000; border-bottom: 1 solid #000000" align="center">
<b>
<a href="Control.asp">
控制面板首页</a></b>
</td>
<td width="20%" height="25" bgcolor="#EDEDED" style="border-right: 1 solid #000000; border-bottom: 1 solid #000000" align="center">
<b>
<a href="controledit.asp">
编辑个人资料</a></b>
</td>
<td width="20%" height="25" bgcolor="#EDEDED" style="border-right: 1 solid #000000; border-bottom: 1 solid #000000" align="center">
<b>
<a href="controlpass.asp">
修改登录密码</a></b>
</td>
<td width="20%" height="25" bgcolor="#EDEDED" style="border-right: 1 solid #000000; border-bottom: 1 solid #000000" align="center">
<b>
<a href="controlmail.asp">
短消息信箱</a></b>
</td>
<td width="20%" height="25" bgcolor="#FFFFFF" align="center">
<b>
好友列表</b>
</td>
</tr>
<tr>
<td width="100%" valign="middle" colspan="5" height="10">
</td>
</tr>
<tr>
<td width="100%" valign="middle" colspan="5" height="5">
<div align="center">
<center>
<table border="0" width="504" cellspacing="0" cellpadding="0" style="border: 1 solid #000000" height="136">
<tr>
<td width="500" background="images/bg2.gif" height="22" colspan="5">
<p align="center"><font color="#333333"><b><%=Session("User")%>,欢迎使用您的好友录</b></font></td>
</tr>
<tr>
<td width="500" align="center" height="50" colspan="5">
<!--#include file="controlnavigatin.asp"-->
</td>
</tr>
</center>
<tr>
<td width="100" height="22" bgcolor="#EDEDED" style="border-right: 1 solid #cccccc; border-top: 1 solid #cccccc; border-bottom: 1 solid #cccccc" align="center">
<font color="#545454">姓 名</font>
</td>
<td width="100" height="22" bgcolor="#EDEDED" style="border-right: 1 solid #cccccc; border-top: 1 solid #cccccc; border-bottom: 1 solid #cccccc" align="center">
<font color="#545454">短消息</font>
</td>
<td width="100" height="22" bgcolor="#EDEDED" style="border-right: 1 solid #cccccc; border-top: 1 solid #cccccc; border-bottom: 1 solid #cccccc" align="center">
<font color="#545454">OICQ</font>
</td>
<td width="101" height="22" bgcolor="#EDEDED" style="border-right: 1 solid #cccccc; border-top: 1 solid #cccccc; border-bottom: 1 solid #cccccc" align="center">
<font color="#545454">是否在线</font>
</td>
<td width="101" height="22" bgcolor="#EDEDED" style="border-right: 1 solid #cccccc; border-top: 1 solid #cccccc; border-bottom: 1 solid #cccccc" align="center">
<font color="#545454">割 除</font>
</td>
</tr>
<%
SQL="Select * From 好友列表 Where 用户名='"& Session("User") & "'"
Set RS=Server.CreateObject("ADODB.Recordset")
RS.Open SQL,Connstr,1,1
If Not RS.EOF Then
const MaxperpageFriend=10 '定义每一页显示的数据记录的常量
dim currentpage '定义当前页的变量
rs.pagesize=MaxperpageFriend
currentpage=request.querystring("pageid")
if currentpage="" then
currentpage=1
elseif currentpage<1 then
currentpage=1
else
currentpage=clng(currentpage)
if currentpage > rs.pagecount then
currentpage=rs.pagecount
end if
end if
'如果变量currentpage的数据类型不是数值型
'就1赋给变量currentpage
if not isnumeric(currentpage) then
currentpage=1
end if
dim totalput,n '定义变量
totalput=rs.recordcount
if totalput mod MaxperpageFriend=0 then
n=totalput\MaxperpageFriend
else
n=totalput\MaxperpageFriend+1
end if
if n=0 then
n=1
end if
rs.move(currentpage-1)*MaxperpageFriend
i=0
Do While i< MaxperpageFriend and not rs.eof
%>
<form action="" method="post" name=inbox>
<tr>
<td width="100" height="22" bgcolor="#EDEDED" style="border-right: 1 solid #cccccc; border-bottom: 1 solid #cccccc" align="center">
<%=RS("好友名字")%>
</td>
<td width="100" height="22" bgcolor="#EDEDED" style="border-right: 1 solid #cccccc; border-bottom: 1 solid #cccccc" align="center">
<a href="controlsendmessage.asp?name=<%=RS("好友名字")%>">
发送消息</a>
</td>
<td width="100" height="22" bgcolor="#EDEDED" style="border-right: 1 solid #cccccc; border-bottom: 1 solid #cccccc" align="center">
<%=ViewOICQ(RS("好友名字"))%>
</td>
<td width="101" height="22" bgcolor="#EDEDED" style="border-right: 1 solid #cccccc; border-bottom: 1 solid #cccccc" align="center">
<%=Whether(RS("好友名字"))%>
</td>
<td width="101" height="22" bgcolor="#EDEDED" style="border-right: 1 solid #cccccc; border-bottom: 1 solid #cccccc" align="center">
<input type="checkbox" name="CheckValue" value="<%=RS("好友名字")%>" class="1">
</td>
</tr>
<%
RS.MoveNext
I=I+1
Loop
Else
%>
<tr>
<td width="502" height="22" bgcolor="#EDEDED" style="border-right: 1 solid #cccccc; border-bottom: 1 solid #cccccc" align="center" colspan="5">
您的好友列表中没有任何内容。
</td>
</tr>
<%End IF%>
</center>
<tr>
<td colspan="5" width="500">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" valign="bottom" colspan="3" height="22">
<p align="right">页数:<%=currentpage%>/<% =n%>
<%k=currentpage
if k<>1 then%>
[<a href="controlfriend.asp?pageid=1">首页</a>]
[<a href="controlfriend.asp?pageid=<%=k-1%>">上一页</a>]
<%else%>
[首页] [上一页]
<%end if%>
<%if k<>n then%>
[<a href="controlfriend.asp?pageid=<%=k+1%>">下一页</a>]
[<a href="controlfriend.asp?pageid=<%=n%>">尾页</a>]
<%else%>
[下一页] [尾页]
<%end if%>
共有<font color="red"><%=totalput%></font>个好友</p>
</td>
</tr>
<center>
<tr>
<td colspan="3" width="500" height="5">
</td>
</tr>
<tr>
<td colspan="3" width="500">
<p align="center" style="margin-bottom: 5">[<a href="delallfriend.asp">割除所有</a>] <input type="button" name="chkall" value="全选" onclick="CheckAll(this.form)" style="background-color: #DDDDDD; background-repeat: repeat; background-attachment: scroll; font-size: 9pt; height: 20; width: 40; border: 1px groove #000000; background-position: 0% 50%">
<input type="reset" name="Reset" value="重置" style="background-color: #DDDDDD; background-repeat: repeat; background-attachment: scroll; font-size: 9pt; height: 20; width: 40; border: 1px groove #000000; background-position: 0% 50%">
<input type=hidden name="del" value="yes"><input type="submit" name="delete" value="删除" style="background-color: #DDDDDD; background-repeat: repeat; background-attachment: scroll; font-size: 9pt; height: 20; width: 40; border: 1px groove #000000; background-position: 0% 50%"></td>
</tr>
</form>
<tr>
<td width="100%" valign="bottom" colspan="3" height="5"></td>
</tr>
<form action="" method="post">
<tr>
<td width="38%" valign="bottom">
<p align="right">您好友的姓名:</td>
<td width="32%"><input type="text" name="FriendName" size="12" maxlength="12" style="background-attachment: scroll; background-repeat: repeat; font-size: 9pt; height: 18; width: 153; background-color: #FFFFFF; border: 1 solid #000000; background-position: none 0%"></td>
<td width="30%"><input type=hidden name="add" value="yes"><input type="submit" value=" 增 加 " name="Submit" style="background-color: #DDDDDD; background-repeat: repeat; background-attachment: scroll; font-size: 9pt; height: 20; width: 69; border: 1px groove #000000; background-position: 0% 50%"></td>
</tr>
</table>
</center>
</td>
</tr>
</form>
<tr>
<td colspan="5" width="500" height="5">
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td width="100%" valign="middle" colspan="5">
</td>
</tr>
<%if ErrInfo<>"" Then%>
<tr>
<td width="100%" valign="middle" colspan="5">
<p style="line-height: 150%; margin-left: 200; margin-top: 3; margin-bottom: 3"><font color="#FF0000">·请输入好友的名字!<br>
·对不起,这个同学没有注册!</font>
</td>
</tr>
<%End IF%>
<tr>
<td width="100%" valign="middle" colspan="5">
</td>
</tr>
<tr>
<td width="100%" valign="middle" colspan="5" height="10">
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<!--#include file="bottom.asp"-->
</body>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -