<%
Sub pagehead()

	Dim title
	Call online()
	if Act<>"" Then title=Act Else title=Locat
	response.write "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">"&_
	"<html><head>"&_
	"<title>"&StrVar(1)&"--"&title&"</title>"&_
	"<META http-equiv=""Content-Type"" content=""text/html;charset=gb2312"">"&_
	"<meta name=generator content=fenghua>"&_
	"<meta name=keywords content=""fengyue,fenghua,schoolmate,txl,alumni,风华,风月,同学录,校友录,asp,txlbbs.126.com"">"&_
	"<meta name=description content=重温昔日情怀，延续同学友情......>"&_
	"<link href=""css.asp"" rel=""stylesheet"" type=""text/css"">"%>
	<!--#include file="theme.css"-->
	<script language=JavaScript src="script/jsfun.asp"></script>
	</head>
	<body alink=#333333 vlink=#333333 link=#333333 topmargin=0 leftmargin=0 background="images/bg.gif">

<%

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>-->"


End Sub


Sub top(navlayer,headshow)

	if headshow<>0 Then 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>"

	Call navbar(navlayer)
response.flush
End Sub


Sub online()

	Dim oRs,loc
	if membername<>"" Then
		Set oRs = Server.CreateObject("ADODB.Recordset")
		sql="Select userid from online where userid='"&membername&"'"
		oRs.open sql,conn,1,3
		if oRs.eof and oRs.bof Then
			sql="insert into online(userid,ip,location) values "&_
				"('"&membername&"','"&Request.ServerVariables("Remote_Addr")&"','同学录首页')"
			conn.execute(sql)
		Else
			if ClassName<>"" Then
				loc="『 <a href=BrowseClass.asp?ClassID="&ClsID&" target=_blank>"&htmlencode(ClassName)&"</a> 』 "&Locat
			Else
				loc=Locat
			End if
			sql="update online Set activetime=Now(),location='"&loc&"',act='"&Act&"' where userid='"&membername&"'"
			conn.execute(sql)
		End if
		oRs.close
		Set oRs=Nothing
	End if

	Conn.Execute("delete from online where DATEDIFF('s', activetime, now())>1200")

End Sub


Sub NavBar(layer)

	Dim BarStr,title

	if act<>"" Then title=act Else title=locat
	Response.Write "<TABLE height=27 cellSpacing=0 cellPadding=0 width=""100%"" border=0 align=center background=""images/navbg.gif"""
	if layer=0 then response.write " style=""FILTER:DropShadow(Color=#ffffff, OffX=1, OffY=1, Positive=1)"""
	response.write "><TR><td>"

	BarStr="<A href=Default.asp><IMG width=14 SRC=IMAGES/home1.gif hspace=3 border=0>"&StrVar(1)&"</A> >> "
	
	Select Case layer
	Case 0 
		if membername="" then 
			response.write "&nbsp;欢迎您来"&StrVar(1)&"做客!</td><td align=right><a href=Register.asp><img src=images/logoff.gif hspace=2 border=0 align=absmiddle>还没有注册?</a>&nbsp;<a href=Help.asp><img src=images/help1.gif hspace=2 border=0>查看系统帮助</a>"
		else
			response.write "&nbsp;<font face=Verdana>欢迎您,<a href=Profile.asp?Action=showdetail&Name="&membername&" title=查看我的个人资料 target=_blank>"&membername&"</a></font> :)</td>"&_
			"<td align=right><a href=Login.asp?Action=logout><img src=images/logoff.gif hspace=2 border=0 align=absmiddle>退出系统</a>"&_
			"&nbsp;<a href=Help.asp><img src=images/help1.gif hspace=2 border=0 align=absmiddle>帮助中心</a>"&_
			"&nbsp;<a href=MyModify.asp><img src=images/mydoc.gif hspace=2 border=0 align=absmiddle>修改资料</a>"
		end if
	Case 1
		Response.Write BarStr&title
	Case 2
		if locat="校友留言" Then
			Response.Write BarStr&"『 <A href=ForumDisplay.asp>校友留言</a> 』 >> "&act
		Else
			Response.Write BarStr&" <A href=MyClass.Asp?ClassID="&ClsID&">"&htmlencode(ClassName)&"</a> "&_
				">> "&title
		End if
	Case 3
		if locat="班级管理" Then 
			Response.Write BarStr&" <A href=MyClass.Asp?ClassID="&ClsID&">"&htmlencode(ClassName)&"</a> "&_
				">> <A href=ClsAdm_Class.asp?ClassID="&ClsID&"&Action=Main>班级管理</a> >> "&act
		ElseIf locat="班级相册" Then 
			Response.Write BarStr&" <A href=MyClass.Asp?ClassID="&ClsID&">"&htmlencode(ClassName)&"</a> "&_
				">> <A href=ClassAlbum.asp?ClassID="&ClsID&">班级相册</a> >> "&act
		End if
	End Select
	if layer<>0 then response.write "</td><td align=right>"

	if membername<>"" then response.write "&nbsp;"&chkNewMsg
	Response.Write "&nbsp;</td></tr></table>"

End Sub



function chkNewMsg()
	dim MsgSql,MsgRs

	chkNewMsg="<IMG SRC=Images/inbox.gif WIDTH=17 BORDER=0 align=absmiddle hspace=2>"&_
		"<a href=UserSMS.asp?action=inbox>我的短信"
	MsgSql="select count(*) from message where incept='"&membername&"' and issend=1 and delR=0 and flag=0"
	set MsgRs=conn.execute(MsgSql)
	if MsgRs(0)<>0 then
		chkNewMsg=chkNewMsg&"(<font color=brown><b>"&MsgRs(0)&"</b></font>)</a>"
		if inStr(lcase(Request.ServerVariables("URL")),"usersms.asp")=0 then
			Response.Write "<bgsound src=""sound/newmsg.wav"" border=0>"
		end if
	else
		chkNewMsg=chkNewMsg&"(0)</a>"
	end if
	set MsgRs=nothing
end function



Sub success(byval suctitle,byval sucmsg)

	Response.Write "<br><br>"&_
		"<table cellpadding=5 cellspacing=1 border=0 align=center width=""100%""  Class=TableBorder>"&_
			"<tr align=center><th>成功："&suctitle&"</th></tr>"&_
			"<tr><td Class=LightTableBody height=80>&nbsp;&nbsp;"&sucmsg&"</td></tr>"&_
		"</table><BR>"

End Sub


Sub Redirect(timeout,url,title,msg)

	Response.Write "<meta http-equiv=refresh content="&timeout&";URL="&url&">"&_
		"<br><br><table cellpadding=5 cellspacing=1 border=0 align=center width=""100%"" Class=TableBorder>"&_
		"<tr><th>状态："&title&"</th></tr>"&_
		"<tr><td Class=LightTableBody>"&msg&"</td></tr></table><BR>"

End Sub


Sub footer()

	Response.Write "</td></tr></table>"&_
	"</td>"&_
	"<td width=4 background=images/RBorder.gif><!-- right border --></td>"&_ 
	"</tr></table>"&_
	"<DIV align=center><IMG height=4 src=images/BBorder.gif width=746></DIV>"&_
	"<p><TABLE cellSpacing=0 cellPadding=0 width=""95%"" border=0 align=center>"&_
	"<tr><td></td></tr>"&_
	"<tr valign=center><td width =""100%"" align=center><font face=Verdana>"&_
	"<a href=http://txlbbs.126.com title=若有任何问题，请访问风华论坛>风华同学录2.0正式版&nbsp;(中小学版)</a>"&_
	"<br>版权所有&copy; 2001-2003 <a href=mailto:zjgxwx@163.com>风华工作室</a>。保留所有权利。</font>"
	Response.Write "</td></tr></table>"&_
		"</body></html>"

	Call endconnection()

End Sub

%>
<!--#include file="include/htmlencode.asp" -->
