<!--#INCLUDE FILE="setup.asp" -->
<!--#INCLUDE FILE="checkuser.asp" -->
<!--#INCLUDE FILE="theme.asp" -->
<%
Dim Locat,Act
Locat="首页"

Response.Write 	"<!-- <DIV align=center><IMG height=4 src=images/TBorder.gif width=746></DIV>"&_
"<table width=750 align=center border=0 bgcolor="&BodyColor&" cellspacing=0 cellpadding=0>"&_
"<tr>"&_
	"<td width=4 background=images/Lborder.gif></td>"&_ 
	"<td align=center>"&_
	"<table align=center width=734 cellspacing=0 cellpadding=0><tr><td>"&_
	"<TABLE cellSpacing=0 cellPadding=0 width=100% align=center border=0>"&_
	"<tr height=10><td></td></tr>"&_
	"<TR><TD width=210><a href=http://txlbbs.126.com target=_blank><IMG height=60 src=images/logo.gif width=180 border=0></a></TD>"&_
	"<TD align=right colSpan=2><object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" "&_
	"codebase=""http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0"" id=""Movie1"" width=""468"" height=""70"">"&_
	"<param name=""movie"" value=""images/banner.swf"">"&_
	"<param name=""quality"" value=""high"">"&_
	"<param name=""bgcolor"" value=""#FFFFFF"">"&_
	"<embed name=""banner"" src=""images/banner.swf"" quality=""high"" bgcolor=""#FFFFFF"" width=""468"" height=""70"" "&_
	"type=""application/x-shockwave-flash"" "&_
	"pluginspage=""http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"">"&_
	"</embed></object>"&_
	"</TD></TR>"&_
	"<tr height=5><td></td></tr>"&_
	"</TABLE>-->"
Call HomeTop()

%>
<!--#INCLUDE FILE="script/roll.inc" -->
<div id="textanim" style="z-index:1000;position:absolute; left: 520; top: 220" onclick="breakf()"></div>
<table width=100% align=center border=0 cellpadding=0 cellspacing=0>
<tr><td width=185 bgcolor=#ffffff valign=top>

<%if membername="" Then%>
<TABLE cellSpacing=0 cellPadding=0 width=185 border=0 background="images/BlueLeft.gif">
<FORM style="MARGIN: 0px" method="POST" action="login.asp" name="frmlogin">
<input type=hidden name=action value=CheckLogin>
<TR><TD><img src=images/myclass.gif><!-- 我的班级 --></TD></TR>
<TR><TD height=20></TD></TR>
<TR><TD align=center height=30>用户： <INPUT size=16 name=fyuser maxlength=12></TD></TR>
<TR><TD height=30 align=center>密码： <INPUT type=password size=16 name=fypwd maxlength=12></tr> 
<tr><TD align=center height=30><input type=image src=images/login1.gif>&nbsp;&nbsp;
<a href="Register.asp"><img src=images/reg.gif border=0></a></TD></TR>
<TR align=center><TD height=37><A href="Help.asp">帮助中心</a>&nbsp;&nbsp;&nbsp;
<A href="GetPasswd.asp">忘记密码?</A></TD></TR>
</FORM>
			  
<%Else%>

<TABLE cellSpacing=0 cellPadding=0 width=185 border=0 background="images/BlueLeft.gif">
<TR><TD><img src=images/myclass.gif><!-- 我的班级 --></TD></TR>
<TR><TD align=middle height=170>
	<table width="84%" height=116 border=0 cellspacing=0 cellpadding=0 style="word-break:break-all">
	<tr height=10><td></td></tr>
<%
sql="select visitcount,point from student where userid='"&membername&"'"
Set Rs=conn.execute(sql)		  
Response.Write "<br>您是第"&Rs(0)&"次访问同学录<br>您目前的积分是"&Rs(1)&"分<br>"			  
			  
sql="Select J.classid,J.isauditing,C.classname from joinclass J inner join Class C on C.classid=J.classid where J.userid='"&membername&"' order by J.isauditing desc"

Set Rs=conn.execute(sql)
if Rs.eof and Rs.bof Then 
	Response.Write "<tr><td height=50 align=center>您还没有注册班级！</td></tr>"
Else
	bisauditing=False
	do until Rs.eof
		if bisauditing=False and Rs(1)=True Then 
			Response.Write "<tr><td height=10><table align=center width=""100%""><tr><td width=1 bgcolor=""green""></td></tr></table></td></tr>"
			bisauditing=True
		End if
		if Rs(1)=True Then
			Response.Write "<tr><td height=18><img src=images/auditing.gif width=13 hspace=1 align=absmiddle alt=你尚未正式加入这个班级，还处于审核状态>"
			Response.Write "<a href=Regclass.asp?action=exitpass&classid="&Rs(0)&" title=我要退出审核状态>"&htmlencode(Rs(2))&"</a></td></tr>"
		Else
			Response.Write "<tr><td height=18><a href=MyClass.asp?ClassID="&Rs(0)&" title=立刻进入班级页面><img src=images/go.gif width=13 hspace=1 align=absmiddle border=0>"&htmlencode(Rs(2))&"</a></td></tr>"
		End if
		Rs.movenext
	loop
End if

Response.Write "<tr height=28><td align=right valign=bottom><input type=button value=注册班级 onclick=""location.href='RegClass.asp'"" class=button></td></tr></table>"%>
</TD></TR>
        
<%End if%>

<tr><td><img src=images/topclass.gif></td></tr>
</TABLE>
<!-- end myclass-->

<!-- top class-->
<TABLE cellSpacing=0 cellPadding=0 width=185 border=0 background=images/GreenLeft.gif>
	<TR><TD><!-- 人气最旺班级 --></TD></TR>
	<TR><TD align=center height=110><%Call TopClasses()%><BR></TD></TR>
	<tr><td><img src=images/topuser.gif></td></tr>
</TABLE>

<!-- top users-->
<TABLE cellSpacing=0 cellPadding=0 width=185 border=0 background=images/RedLeft.gif>
	<TR><TD><!-- 用户积分排行 --></TD></TR>
	<TR><TD align=center height=110><%Call TopUsers()%><BR></TD></TR>
</TABLE>

<!-- end left --></td>

<!-- right start-->
<td valign=top bgcolor=#ffffff>
<%Call navbar(0)%>
<TABLE width=100% background=images/star.gif bgcolor=#ffffff cellspacing=0 cellpadding=0 border=0>
	<TR><td width=20></td>
	<TD valign=top class=mp><BR>创建班级<%=ClassNum%>个&nbsp;注册校友<%=UserNum%>人&nbsp;当前在线<%=OnlineUsers()%>人
	<BR><BR><BR>
	<font color=#aaaaaa>&nbsp;&nbsp;风月同学录全新改版，功能更强，页面更美观，丰富的班级栏目和最新加入的班委功能，令您体验如此轻松的同学间交流，还等什么，赶快加入吧！</font>
</td>
<td align=right><img src=images/leaf.jpg></TD>
</TR>
</TABLE>
<br>
<table width=100% border=0 cellspacing=0 cellpadding=0>
<tr><td width=380 valign=top align=right>
	<TABLE border=0><TR>
		<TD width=80><a href=ClassList.asp title=查看已经创建的班级><img src=images/classlist1.gif border=0></a><BR>班级列表</TD>
		<TD width=80><a href=UserList.asp title=查看已注册用户><img src=images/userlist.gif border=0></a><BR>注册校友</TD>
		<TD width=80><a href=OnlineUser.asp title=查看当前在线校友><img src=images/onlineuser.gif border=0></a><BR>在线校友</TD>
		<TD width=80><a href=TeacherList.asp title=查看已登记的教师通讯信息><img src=images/teacherlist.gif border=0></a><BR>教师通讯</TD>
	</TR></TABLE>
<BR><!-- top bbs -->
<TABLE cellSpacing=0 cellPadding=0 width=90% border=0 align=center>
	<TR><TD><%TopBBS()%></TD></TR>
</TABLE>

<!-- search schoolmate -->
<TABLE width=90% height=40 align=center>
<form action="search.asp" method="post"> 
<input type=hidden name=Action value=search>
<TR><TD>&nbsp;&nbsp;<img src=images/search2.gif align=absmiddle></td>
<td><INPUT size=18 name=realname type=text>&nbsp;
<input type=image src=images/search1.gif align=absmiddle>
</TD></TR></FORM>
</TABLE>

</td>

<td width=1>
	<TABLE cellpadding=0 cellspacing=0 border=0 valign=middle><TR><TD height=315 width=1 background=images/bg_dot1.gif></TD></TR></TABLE>
</td>

<td valign=top align=right>
<!-- right -->
<BR>
<table width=150 cellpadding=0 cellspacing=1 border=0 bgcolor=#e0e0e0>
	<tr bgcolor=#ffffff><td height=25 background=images/newclass.gif></td></tr>
	<tr bgcolor=#ffffff><td align=right><%call NewClasses()%></td></tr>
</table>
<BR>
<TABLE cellspacing=1 cellpadding=0 border=0 width=150 bgcolor=#e0e0e0>
	<tr bgcolor=#ffffff><td height=25 background=images/helpcenter.gif></td></tr>
	<tr bgcolor=#ffffff><td align=center>
		<table width=95% border=0 cellpadding=3 cellspacing=1 align=center>	
		<tr><td height=6></td></tr>
		<tr><td><img src=images/BlueDot.gif align=absmiddle hspace=2><a href=Help.asp#2>如何加入同学录？</a></td></tr>
		<tr><td height=1 background="images/bg_xu.gif"></td></tr>
		<tr><td><img src=images/BlueDot.gif align=absmiddle hspace=2><a href=Help.asp#7>如何修改个人资料？</a></td></tr>
		<tr><td height=1 background="images/bg_xu.gif"></td></tr>
		<tr><td><img src=images/BlueDot.gif align=absmiddle hspace=2><a href=Help.asp#6>密码忘记了怎么办？</a></td></tr>
		<tr><td height=1 background="images/bg_xu.gif"></td></tr>
		<tr><td><img src=images/BlueDot.gif align=absmiddle hspace=2><a href=Help.asp#3>如何成为班委会成员？</a></td></tr>
		<tr><td height=1 background="images/bg_xu.gif"></td></tr>
		<tr><td><img src=images/BlueDot.gif align=absmiddle hspace=2><a href=Help.asp#4>班委成员有哪些权利？</a></td></tr>
		</TABLE>
</td></tr></table>

</td></tr></table><BR>

</td></tr></table>
<%

Sub NewClasses()

Dim tcRs
Set tcRs=conn.execute("Select top 5 classname,classid from class order by classid desc")
Response.Write "<table width=""95%"" border=0 cellpadding=3 cellspacing=1 style=""word-break:break-all"">"&_
"<tr><td height=6></td></tr>"
i=1
do until tcRs.eof
	if i=0 then 
		response.write "<tr><td height=1 background=""images/bg_xu.gif""></td></tr>"
	else
		i=0
	end if
	if membername<>"" Then
	Response.Write "<tr><td><img src=images/BrownDot.gif align=absmiddle hspace=2><a target=_blank href=BrowseClass.asp?ClassID="&tcRs(1)&">"&htmlencode(tcRs(0))&"</a></td><td></td></tr>"
	Else
	Response.Write "<tr><td><img src=images/BrownDot.gif align=absmiddle hspace=2>"&htmlencode(tcRs(0))&"</td><td></td></tr>"
	End if
	tcRs.movenext
loop
Response.Write "</table>"

End Sub


Sub TopBBS()

Dim tbRs
Set tbRs=conn.execute("select top 6 userid,title,postid,posttime from topic order by lastTime desc")
Response.Write "<table width=""100%"" border=0 cellspacing=1 cellpadding=4>"&_
	"<TR><TD colspan=3><a href=ForumDisplay.asp><img src=images/newbbs.gif border=0></a></TD></TR>"
do until tbRs.eof
	Response.Write "<tr><td width=200><IMG src=images/OrangeDot.gif hspace=3 align=absmiddle><a href=ViewThread.asp?TopicID="&tbRs(2)&" title="""&tbRs(1)&""">"&htmlencode(left(tbRs(1),10))&"</a></td><td>"
	if membername<>"" Then
		Response.Write "<a href=""Profile.asp?Name="&tbRs(0)&"""  title=""查看"&tbRs(0)&"个人资料"" target=_blank>"&tbRs(0)&"</a>"
	Else
		Response.Write tbRs(0)
	End if
	Response.Write "</td><td align=right>"&formatdatetime(tbRs(3),vbShortDate)&"</td></tr>"&_
	"<tr><td colspan=4 background=""images/bg_xu.gif"" height=1></td></tr>"
	tbRs.movenext
loop
Response.Write "<tr><td colspan=3 align=right><a href=ForumDisplay.asp><img src=images/more.gif border=0></a></td></tr></table>"

End Sub



Sub topclasses()

Dim tcRs
Set tcRs=conn.execute("Select top 5 classname,studcount,classid from class order by studcount desc,classname")
Response.Write "<BR><table width=""92%"" border=0 cellspacing=3 style=""word-break:break-all"">"
	do until tcRs.eof
	if membername<>"" Then
		Response.Write "<tr><td width=120><a target=_blank href=BrowseClass.asp?ClassID="&tcRs(2)&">"&htmlencode(tcRs(0))&"</a></td>"
	Else
		Response.Write "<tr><td width=120>"&htmlencode(tcRs(0))&"</td>"
	End if
	Response.Write "<td><FONT color=#cc0000>"&tcRs(1)&"</FONT></td></tr>"
	tcRs.movenext
loop
Response.Write "</table>"

End Sub



Sub topusers()

Dim TUrs,TUsql
if BoolVar(9) then
	TUsql="Select top 5 userid,point from student where locked<2 order by point desc,userid"
else
	TUsql="Select top 5 userid,point from student order by point desc,userid"
end if

Set TUrs=conn.execute(TUsql)
Response.Write "<BR><table width=""92%"" border=0 cellspacing=3>"
do until TUrs.eof
	if membername<>"" Then
	Response.Write "<tr><td width=120><a target=_blank href=""Profile.asp?Name="&tuRs(0)&""" title=""查看"&TUrs(0)&"个人资料"">"&htmlencode(TUrs(0))&"</td>"
	Else
	Response.Write "<tr><td width=120>"&htmlencode(TUrs(0))&"</td>"
	End if
	Response.Write "<td><FONT color=#cc0000>"&TUrs(1)&"</FONT></td></tr>"
	TUrs.movenext
loop
set TUrs=nothing
Response.Write "</table>"

End Sub

Function onlineusers()

	Dim oSQL,oRs
	oSQL="Select count(userid) from online"
	Set oRs=conn.execute(oSQL)
	if oRs.eof and oRs.bof Then
		onlineusers=0
	Else
		onlineusers=oRs(0)
	End if
	Set oRs=Nothing

End Function


Sub HomeTop()

	Call pagehead()	
	Response.Write 	"<DIV align=center><IMG height=4 src=images/TBorder.gif width=746></DIV>"&_
	"<table width=750 align=center border=0 bgcolor="&BodyColor&" cellspacing=0 cellpadding=0>"&_
	"<tr>"&_
		"<td width=4 background=images/Lborder.gif><!-- left border --></td>"&_ 
		"<td align=center>"&_
		"<table align=center width=734 cellspacing=0 cellpadding=0><tr><td>"&_
		"<!-- content start -->"&_
		"<TABLE cellSpacing=0 cellPadding=0 width=100% align=center border=0>"&_
		"<tr height=5><td></td></tr>"&_
		"<TR><TD width=210><a href=http://txlbbs.126.com target=_blank><IMG height=60 src=images/logo.gif width=170 border=0></a></TD>"&_
		"<TD align=right colSpan=2><object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" "&_
		"codebase=""http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0"" id=""Movie1"" width=""548"" height=""80"">"&_
		"<param name=""movie"" value=""images/banner.swf"">"&_
		"<param name=""quality"" value=""high"">"&_
		"<param name=""bgcolor"" value=""#FFFFFF"">"&_
		"<embed name=""banner"" src=""images/banner.swf"" quality=""high"" bgcolor=""#FFFFFF"" width=""548"" height=""80"" "&_
		"type=""application/x-shockwave-flash"" "&_
		"pluginspage=""http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"">"&_
		"</embed></object>"&_
		"</TD></TR>"&_
		"<tr height=3><td></td></tr>"&_
		"</TABLE>"


End Sub

%>
<%Call footer%>

