📄 classmate.asp
字号:
<!--#INCLUDE FILE="setup.asp" -->
<!--#INCLUDE FILE="char.asp" -->
<!--#INCLUDE FILE="checkuser.asp" -->
<!--#INCLUDE FILE="theme.asp" -->
<%locat="班级通讯录"
dim totalPages,currentPage
dim rs,sql
if membername="" then
errmsg=errmsg+"<br>"+"<li>您还没有<a href=login.asp>登录</a>。"
call top(1,1)
call error("Information",errmsg)
else
joinstatus=chkjoinclass(clsid)
if joinstatus<>"" then
call top(1,1)
call error("Exclamation",joinstatus)
else
call top(2,1)
style=request("style")
if style="List" then
call liststyle()
else
style="Card"
call cardstyle()
end if
end if
end if
sub opnbar()
%>
<br><br>
<TABLE border=0 cellspacing=0 cellpadding=0 align=center width=100%>
<TR><TD align=left>
<IMG SRC="IMAGES/classmate.gif" WIDTH="114" HEIGHT="38" BORDER=0 ALT=""></td>
<td align=right valign=bottom>
<input name=Button onClick=document.all.WebBrowser.ExecWB(6,1) type=button value=打印本页>
<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
<input onClick="location.href='ClassMailList.asp'" type="button" value="邮件列表">
<%
if style="Card" then
response.write "<input onClick=""location.href='ClassMate.asp?Style=List'"" type=button value=列表样式>"
else
response.write "<input onClick=""location.href='ClassMate.asp?Style=Card'"" type=button value=卡片样式>"
end if
response.write "</td></tr></table>"
Set rs = server.CreateObject("ADODB.Recordset")
if style="List" then
sql="select realname,userid,email,oicq,telephone,mobilephone,workshop from student where "&_
"userid in(select userid from [joinclass] where isauditing=false and classid="&clsid&") order by realname"
else
sql = "select S.realname,S.userid,S.email,S.homepage,S.oicq,S.image,"&_
"S.telephone,S.mobilephone,S.workshop,J.degree from student S inner join joinclass J on S.userid=J.userid where "&_
"J.classid="&clsid&" and J.isauditing=false order by S.realname"
end if
rs.open sql,conn,1,1
rs.pagesize=20
totalpages=rs.pagecount
currentPage=request("page")
if currentpage="" then currentpage=1
if not isInteger(currentpage) then
currentpage=1
elseif Cint(currentpage)>totalpages then
currentpage=totalpages
end if
currentpage=Cint(currentpage)
rs.absolutepage=currentpage
end sub
sub liststyle()
call opnbar()
response.write "<TABLE border=0 width=""100%"" bgcolor="&tablebordercolor&" cellsapcing=1 cellpadding=4>"
response.write "<tr>"&_
"<th>姓名</th>"&_
"<th>电话</th>"&_
"<th>手机</th>"&_
"<th>QQ</th>"&_
"<th>Email</th>"&_
"<th width=""27%"">工作单位</th>"&_
"</tr>"
total=0
do until total=20 or rs.eof
name=htmlencode(rs(0))
if len(name)=2 then
name=left(name,1)&" "&right(name,1)
end if
response.write "<tr bgcolor="&tablebodycolor2&"><td> <a target=_blank href=Profile.asp?Name="&htmlencode(rs(1))&"&Action=showdetail title=查看"&name&"的详细个人资料>"&name&"</a></td>"&_
"<td>"&htmlencode(rs(4))&"</td>"&_
"<td>"&htmlencode(rs(5))&"</td>"&_
"<td><a href=http://search.tencent.com/cgi-bin/friend/user_show_info?ln="&htmlencode(rs(3))&" target=_blank title=查看"&name&"的OICQ状态>"&htmlencode(rs(3))&"</a></td>"&_
"<td><a href=mailto:"&htmlencode(rs(2))&" title=给"&name&"发邮件>"&htmlencode(rs(2))&"</a></td>"&_
"<td>"&htmlencode(rs(6))&"</td>"&_
"</tr>"
total=total+1
rs.movenext
loop
rs.close
set rs=nothing
call pagelink()
end sub
sub cardstyle()
call opnbar()
set tmprs=conn.execute("select classname from class where classid="&clsid)
classname=tmprs(0)
set tmprs=nothing
response.write "<TABLE border=0 width=""100%"">"
total=0
do until rs.eof or total=20
if total mod 2=0 then response.write "<TR>"
response.write "<TD align=center width=""25%"" height=""150"">"
name=htmlencode(rs("realname"))
if len(name)=2 then
name=left(name,1)&" "&right(name,1)
end if
face=rs("image")
if isnull(face) then face=""
%>
<table align=center border=0><tr><td align=center>
<TABLE border=0 width=320 cellspacing=0 cellpadding=0 align=left>
<TR>
<TD colspan=2 bgcolor=#8DCC63>
<TABLE width=100% cellspacing=3 cellpadding=5 border=0>
<TR>
<TD bgcolor=ffffff height=180 background="images/cardback.gif">
<table border="0" width="90%" height="96" align=center>
<tr>
<td width="25%" rowspan="2" height="80"><%if not isnull(rs("image")) and rs("image")<>"" then%><a target=_blank href=profile.asp?name=<%=rs(1)%>&action=showdetail><img src=<%=rs("image")%> align=right class=trans border=0 alt="点击查看<%=name%>的详细个人资料"></a><%end if%></td>
<td width="75%" colspan=2 height="35" align=right class=cardfont><%=classname%></td>
</tr>
<tr>
<td width=50% height="40" align=right><table border=0 style="FONT-SIZE: 12pt;color:white;filter:glow(color=#217112,strength=2)"><tr><td><span style="FONT-SIZE: 11pt"><%=name%></span></td></tr></table></td><td width=50 class=cardfont>
<%if rs("degree")=8 then
response.write " 班长"
elseif rs("degree")=7 then
response.write " 班副"
end if%>
</td>
</tr>
</table>
<table border="0" width="90%" align=center cellspacing=0 cellpadding=0>
<tr height=18>
<td class=cardfont width=40%>电话:<%=htmlencode(rs("telephone"))%></td>
<td class=cardfont>手机:<%=htmlencode(rs("mobilephone"))%></td>
</tr>
<tr height=18>
<td class=cardfont>QQ:<%if rs("oicq")<>"" then%>
<a class=green href='http://search.tencent.com/cgi-bin/friend/user_show_info?ln=<%=htmlencode(rs("oicq"))%>' target=_blank title='查看<%=name%>的OICQ状态'><%=htmlencode(rs("oicq"))%></a>
<%end if%></td>
<td class=cardfont>Email:<%if trim(rs("email"))<>"" then%><a class=green href="mailto:<%=htmlencode(rs("email"))%>" title='给<%=name%>发邮件'><%=htmlencode(rs("email"))%></a><%end if%></td>
</tr>
<tr height=18>
<td width="100%" colspan="2" class=cardfont>我的主页:<%if rs("homepage")<>"" then%><a class=green href="<%=htmlencode(trim(rs("homepage")))%>"
target="_blank" title='访问<%=name%>的个人主页'><%=htmlencode(trim(rs("homepage")))%></a><%end if%></td>
</tr>
<tr height=18>
<td width="100%" colspan="2" class=cardfont>工作单位:<%=htmlencode(rs("workshop"))%></td>
</tr>
</table>
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR><TD width=10></TD><TD width=290 bgcolor=#318112 height=5><spacer type=block width=1></TD></TR>
</TABLE>
<TABLE border=0 width=5 cellspacing=0 cellpadding=0 align=left>
<TR><TD height=8></TD></TR>
<TR><TD height=183 bgcolor=#318112><br></TD></TR>
</TABLE>
</td></tr></table>
<BR>
<%
total=total+1
rs.movenext
if rs.eof or total=20 or total mod 2=0 then response.write "</TR>"
loop
rs.close
set rs=nothing
%>
</td><tr></table>
<%
call pagelink()
end sub
sub pagelink()
%>
<table width=100% align="center" bgcolor=<%=tablebodycolor1%>>
<tr><td align=left valign=center>
<%
if currentpage=0 then currentpage=1
if not (currentpage=1 or totalpages=0) then
response.write " <a href=?page="¤tpage-1&"&OrderBy="&order&"><img src=images/left.gif border=0> 上一页</a>"
end if
if not (currentpage=totalpages or totalpages=0) then
response.write " <a href=?page="¤tpage+1&"&OrderBy="&order&"><img src=images/right.gif border=0> 下一页</a>"
end if
%></td>
<td align=right valign=center>
<%
'response.write style
response.write "页 "¤tpage&" / "&totalpages&" 去第"
%> <input type=hidden name=cstyle value="<%=style%>"><input type=text name=targetPage size=2 style="height:16px;width:20px;"> 页</td>
<td width=15 align=right style="cursor:hand" onclick="document.location.href='ClassMate.asp?Style='+cstyle.value+'&Page='+targetPage.value;">
<img src=images/btngo.gif width=13 height=15>
</td></tr></table>
<%
end sub
call footer()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -