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

📄 myclass.asp

📁 酷虎网同学录V1.0
💻 ASP
字号:
<!--#INCLUDE FILE="setup.asp" -->
<!--#INCLUDE FILE="char.asp" -->
<!--#INCLUDE FILE="checkuser.asp" -->
<!--#INCLUDE FILE="theme.asp" -->
<%
locat="班级首页"
if membername="" then
  	errmsg=errmsg+"<br>"+"<li>您还没有<a href=login.asp>登录</a>。"
	call top(1,1)
	call error("Information",errmsg)
elseif chkclass()=false then
  	errmsg=errmsg+"<br>"+"<li>您要访问的班级不存在或者您还没有加入这个班级。"
	call top(1,1)
	call error("Exclamation",errmsg)
else
	call top(2,1)
	%>
	<table align=center width=100% cellspacing=1 cellpadding=0><tr><td height=500 width=140 valign=top align=center bgcolor=<%=bodycolor%>>
	<!--body left-->
	<%call classmenu()
	call onlinemember()%>	  
	<!--end body left-->
	</td><td valign=top bgcolor=<%=bodycolor%>>
	<%
	call showclassinfo()
end if



function chkclass()
if request("classid")<>"" and request("classid")<>cstr(clsid) and isinteger(request("classid")) then
	classid=clng(request("classid"))
	if chkjoinclass(classid)="" then
		response.cookies("fengyue")("myclass")=classid
		clsid=classid

		sql="update [joinclass] set visitcount=visitcount+1,lastvisit=now() where userid='"&membername&"' and classid="&classid
		conn.execute(sql)

		sql="update [class] set visitcount=visitcount+1 where classid="&classid
		conn.execute(sql)

	else
		response.cookies("fengyue")("myclass")=""
		chkclass=false
		exit function
	end if
	
elseif clsid<>"" then
	if chkjoinclass(clsid)<>"" then
		response.cookies("fengyue")("myclass")=""
		chkclass=false
		exit function
	end if
else
	chkclass=false
	exit function
end if

chkclass=true

end function


sub showclassinfo()

dim rs

set rs=conn.Execute("select * from [class] where classid="&clsid)
classname=rs("classname")
regdate=rs("regdate")
homepage=rs("homepage")
visitcount=rs("visitcount")
enyear=rs("enyear")
creatorid=rs("creator")
adminid1=rs("admin1")
adminid2=rs("admin2")
studcount=rs("studcount")
pronouncement=rs("pronouncement")

if adminid1<>"" then admin=getrealname(adminid1)
if adminid2<>"" then admin=admin&"&nbsp;"&getrealname(adminid2)

creator=getrealname(creatorid)
if creator="" then creator="不详"


set rs=conn.Execute("select degree from [joinclass] where userid='"&membername&"' and classid="&clsid)
if not rs.eof then
degree=cint(rs(0))
end if
'response.write degree
%>

<!--#INCLUDE FILE="script/popup.inc" -->

<TABLE cellSpacing=0 cellPadding=0 width=100% align=center border=0><TBODY>
  <TR>
    <TD vAlign=top align=middle width=100%><BR>
      <TABLE cellSpacing=0 cellPadding=0 width=510 border=0>
        <TBODY><TR vAlign=top><TD nowrap><IMG src="images/smile.gif" hspace=2 align=absmiddle>
		<%response.write getrealname(membername)&"["&htmlencode(membername)&"],欢迎你!"%> 
 </TD>
 <TD valign=middle align=right><%call myclasslist()%>
</TD></TR>
        <TR>
          <TD  vAlign=middle colSpan=2 height=30>您是&nbsp;<font color=#cc0000><%=htmlencode(classname)%></font>&nbsp;的第<font color=#cc0000><b><%=visitcount%></b></font>位访问者,您的身份:<font color=#cc0000><%
if SysAdmin then
response.write "系统管理员"
elseif degree=8 then
	response.write "班长" 
elseif degree=7 then
	response.write "副班长"
elseif degree=6 then
	response.write "学习委员"
elseif degree=5 then
	response.write "宣传委员"
elseif degree=4 then
	response.write "文娱委员"
elseif degree=3 then
	response.write "生活委员"
elseif degree=2 then
	response.write "体育委员"
elseif degree=1 then
	response.write "班级成员"
end if

%></font>。 
            </TD></TR> 
        <TR> 
          <TD  vAlign=top width=153 height=24 colspan=2>
<BR></TD> 

</TR> 
</TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=510 border=0>
        <TBODY>
        <TR>
          <TD vAlign=top height=40><IMG height=40 
            src="images/class_notice.gif" 
      width=510></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=510 border=0>
        <TBODY><tr><td align=center>:::::::欢迎大家在<%=schoolmatename%>落户!::::::::<br><br></td></tr>
        <TR>
          <TD class=mp 
            vAlign=top>我们的家园靠我们自己建设,各位同学一定要常来做客,让我们来共同建设好我们的网上新家园!<br>希望大家在同学会玩得开心!如果您在使用上有什么不清楚的地方,请您参看<A 
            target=_blank 
            href="help.asp">帮助文件</A>,或者向我们<a href=mailto:<%=systememail%>>询问</a>!<BR><%call remindbirthday()%><br><img src=images/pronouncement.gif>&nbsp;&nbsp;
			<%if pronouncement<>"" then 
			response.write pronouncement 
			else response.write "教我们青春的从前,漂流在四方的痴心少年,让我们心碎的时间,看我们万水千山走遍! "
			end if%></TD></TR></TBODY></TABLE><BR>
      <TABLE cellSpacing=0 cellPadding=0 width=510 border=0>
        <TBODY>
        <TR>
          <TD vAlign=top height=40><IMG height=40 
            src="images/class_info.gif" 
width=510></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=510 border=0>
        <TBODY>
        <TR> 
          <TD vAlign=bottom width="50%" height=22>班级名称:<%=htmlencode(classname)%></TD> 
          <TD vAlign=bottom width="50%" colSpan=2 height=18>入学年份:<%=htmlencode(enyear)%></TD></TR> 
        <TR> 
          <TD vAlign=bottom width="50%" height=18>注册日期:<%=regdate%></TD> 
          <TD vAlign=bottom width="50%" colSpan=2 height=18>班级创始人:<a target=_blank href="profile.asp?name=<%=htmlencode(creatorid)%>&action=showdetail"><%=htmlencode(creator)%></a></TD></TR> 

        <TR>
          <TD vAlign=bottom width="50%" height=18>班级成员:<FONT 
            color=#cc0000><B><%=studcount%></B></FONT> [<A   
            href="classmate.asp">查看</A>]</TD> 
          <TD vAlign=bottom width="50%" height=18 colspan=2>本校教师:<FONT  
            color=#cc0000><B><%=teachercount%></B></FONT> [<A   
            href="TeacherList.asp">查看/添加</A>]</TD> 
          </TR> 
        <TR> 
          <TD vAlign=bottom width="50%" height=18>现任管理员:<%if admin<>"" then response.write admin%></TD> 
          <TD vAlign=bottom width="50%" colSpan=2 height=18>附加通信录:<FONT  
            color=#cc0000><B><%=appendcount%></B></FONT> [<A   
            href="AppendList.asp">查看/添加</A>]</TD></TR> 
        <TR> 
          <TD vAlign=bottom width="50%" height=18>最新加入成员:<a target=_blank href="profile.asp?name=<%=newstud%>&action=showdetail" onmouseout="kill()" onmouseover="popup('查看<%=getrealname(newstud)%>的个人信息','<%=tablebodycolor2%>')"><%=getrealname(newstud)%></a> </TD><td colspan=2>班级主页:<a href="<%=htmlencode(homepage)%>" target="_blank"><%=htmlencode(homepage)%></td></TR> 
 <%'response.write "<TR><TD vAlign=bottom colSpan=3 height=18>当前在线成员:</TD></TR>"%>
<%call waitpassmember()%>
	  </TBODY></TABLE><BR> 
	   
<%call top5list()%>	  
</TD></TR></TBODY></TABLE> <br>
<BR><BR>

<%
set rs=nothing

end sub

sub remindbirthday()

	set birs=conn.Execute("select s.userid,s.realname,s.birthday from [student] s inner join [joinclass] j on s.userid=j.userid where month(s.birthday)=month(date()) and day(s.birthday)=day(date()) and j.isauditing=false and j.classid="&clsid)
	if birs.eof and birs.bof then exit sub

	blist=""
	age=datediff("yyyy",birs("birthday"),date())
	do until birs.eof
			blist=blist&"<a href=Profile.asp?Action=showdetail&name="&htmlencode(birs("userid"))&" target=_blank  onmouseout=kill() onmouseover=popup('祝"&age&"岁生日快乐!','"&tablebodycolor2&"')>"&birs("realname")&"</a>&nbsp;&nbsp;"
		birs.movenext
	loop
	response.write "<br>今天本班过生日的同学:<font color=#cc0000>"&blist&"</font><br>"
end sub

sub waitpassmember()
dim wlist,tmprs
'on error resume next
set tmprs=conn.execute("select userid,realname from [student] where userid in (select userid from [joinclass] where isauditing=true and classid="&clsid&")")
if tmprs.eof then exit sub

wlist=""
do until tmprs.eof
wlist=wlist&"<a href=profile.asp?action=showdetail&name="&htmlencode(tmprs(0))&" target=_blank  onmouseout=kill() onmouseover=popup('查看"&htmlencode(tmprs(1))&"的个人信息!','"&tablebodycolor2&"')>"&htmlencode(tmprs(1))&"</a>&nbsp;&nbsp;"
tmprs.movenext
loop

response.write "<tr><TD vAlign=bottom colspan=3 height=18>未通过审核同学:"&wlist&"</td></TR>"

end sub

sub onlinemember()
dim tmprs

set tmprs=conn.execute("select o.userid from [online] o inner join [joinclass] j on o.userid=j.userid where j.isauditing=false and j.classid="&clsid)

response.write "<BR><IMG SRC=IMAGES/online.gif><BR><BR>"&_
	"<table border=0 cellspacing=1 cellpadding=3 align=center width=""75%"">"

if not (tmprs.eof and tmprs.bof) then
	do until tmprs.eof
	response.write "<tr><td align=right width=""30%""><img src=images/profile.gif></td><td><a href=profile.asp?action=showdetail&name="&htmlencode(tmprs(0))&_
	" target=_blank  onmouseout=kill() onmouseover=popup('查看"&getrealname(tmprs(0))&_
	"的个人信息!','"&tablebodycolor2&"')>"&getrealname(tmprs(0))&"</a></td></tr>"
	tmprs.movenext
	loop
end if

response.write "</table>"
end sub


function teachercount()
	set rs=conn.Execute("select count(id) from [teacher]")
	teachercount=rs(0)
end function

function appendcount()
	set rs=conn.Execute("select count(id) from [append] where classid="&clsid)
	appendcount=rs(0)
end function

function newstud()
	set rs=conn.Execute("select top 1 userid from [joinclass] where classid="&clsid&" and isauditing=false order by jointime desc")
if not rs.eof then
	newstud=htmlencode(rs(0))
else
	newstud=""
end if

end function

sub top5list()
dim vstrs,vstsql
%>
<TABLE cellSpacing=0 cellPadding=0 width=510 border=0><TBODY> 
<TR> 
	<TD vAlign=top height=40><IMG height=40 src="images/paihang.gif" width=510></TD>
</TR>
</TBODY></TABLE> 
<TABLE cellSpacing=0 cellPadding=0 width=510 border=0><TBODY> 
<TR height=22> 
	<TD width=130>成员TOP5</TD> 
	<TD width=100>| 访问次数</TD> 
	<TD width=100>| 身份</TD> 
	<TD width=180>| 最后一次访问时间</TD>
</TR> 
<TR> 
	<TD bgColor=#b4c7d4 colSpan=4 height=1></TD>
</TR>
</TBODY></TABLE> 
<%
vstsql="select top 5 userid,visitcount,lastvisit,degree from [joinclass] where isauditing=false "&_
"and classid="&clsid&" order by visitcount desc,lastvisit desc"
set vstrs=conn.Execute(vstsql)

do until vstrs.eof
	%>
	<TABLE cellSpacing=0 cellPadding=0 width=510 border=0> 
	<TBODY> 
	<TR vAlign=bottom> 
	<TD width=130 height=18><%=getrealname(vstrs(0))%></TD> 
	<TD align=left width=100>&nbsp;&nbsp;<%=vstrs(1)%></TD> 
	<TD align=left width=100>&nbsp;&nbsp;
	<%if vstrs(3)=1 then
		response.write "成员"
	elseif vstrs(3)=7 then
		response.write "副班"
	elseif vstrs(3)=8 then
		response.write "班长"
	end if%>
	</TD> 
	<TD width=180 class=novdn>&nbsp;&nbsp;<%=vstrs(2)%></TD></TR></TBODY></TABLE>
	<%
	vstrs.movenext
loop

end sub
%>


<%sub classmenu()%>
<br>
<IMG SRC="IMAGES/classnav.gif">
<table border=0 cellspacing=2 cellpadding=1 align=center width=85%>
<tr height=10><td colspan=2 valign=middle>
<table height=1 width=90% bgcolor=#777777 cellspacing=0 cellpadding=0><tr><td></td></tr></table>
</td></tr>
<tr><td  align=center><img src=images/liuyan.gif></td><td><a   class=menu href="ClassBoard.asp" style="color:<%=menufontcolor%>">班级心声</a></td></tr>
<tr><td></td><td><a  href="ClassAlbum.asp" style="color:<%=menufontcolor%>">班级相册</a></td></tr>
<tr><td align=center><img src=images/count.gif width=16></td><td><a  class=menu  href="Misc.asp?Action=VisitCount" style="color:<%=menufontcolor%>">本班访问统计</a></td></tr>
<tr><td align=center></td><td><a  class=menu  href="Misc.asp?Action=Birthday" style="color:<%=menufontcolor%>">班级生日榜</a></td></tr>
<tr><td></td><td><a  class=menu  href="ManageClass.asp" style="color:<%=menufontcolor%>">班级管理</a></td></tr>
<tr height=10><td colspan=2 valign=middle>
<table height=1 width=90% bgcolor=#777777 cellspacing=0 cellpadding=0><tr><td></td></tr></table>
</td></tr>
<tr><td  align=center><img src=images/cards.gif width=16></td><td><a  class=menu  href="ClassMate.asp" style="color:<%=menufontcolor%>">班级名片册</a></td></tr>
<%if not sysadmin and isappendshow=true then%>
<tr><td></td><td><a   class=menu href="AppendList.asp" style="color:<%=menufontcolor%>">附加通信录</a></td></tr>
<%end if%>
<tr><td></td><td><a   class=menu href="TeacherList.asp" style="color:<%=menufontcolor%>">教师通信录</a></td></tr>
<tr height=10><td colspan=2 valign=middle>
<table height=1 width=90% bgcolor=#777777 cellspacing=0 cellpadding=0><tr><td></td></tr></table>
</td></tr>
<%'if EmailFlag<>0 then%>
<tr><td  align=center><img src=images/email.gif></td><td><a href="ClassMaillist.asp">班级邮件组</a></td></tr>
<tr><td></td><td><a   class=menu href="Notify.asp" style="color:<%=menufontcolor%>">通知校友注册</a></td></tr>
<tr height=10><td colspan=2 valign=middle>
<table height=1 width=90% bgcolor=#777777 cellspacing=0 cellpadding=0><tr><td></td></tr></table>
</td></tr>
<%'end if%>
<tr><td  align=center><IMG alt="退出班级" border=0 height=14 src="images/logout.gif" width=16></td><td><a   class=menu href="ExitClass.asp" style="color:<%=menufontcolor%>">从班级注销</a></td></tr>
</table>
<%end sub

function isappendshow()
	dim tmprs
	set tmprs=conn.execute("select isappendshow from [class] where classid="&clsid)
	if not (tmprs.eof and tmprs.bof) then
		isappendshow=tmprs("isappendshow")
	else
		isappendshow=true
	end if
end function

sub myclasslist() 
   	set tmprs=conn.execute("select classid,classname from [class] where classid "&_
		"in (select classid from [joinclass] where userid='"&membername&_
		"' and isauditing=false) order by classname")
		response.write "<select name=myclasslist onchange=""location.href='MyClass.asp?Classid='+options[this.selectedIndex].value"">"
		response.write "<option value=0>== 我的班级 ==</option>"
		do until tmprs.eof
			response.write 	"<option value="&tmprs(0)&">"&htmlencode(tmprs(1))&"</option>"
			tmprs.movenext
		loop
		response.write "</select>"
end sub 



%>

<%call footer%>


⌨️ 快捷键说明

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