<!--#INCLUDE FILE="conn.asp" -->
<!--#include file="Class_Checkuser.asp"-->
<!--#INCLUDE FILE="Class_Top.asp" -->
<!--#include file="inc/ubbcode.asp"-->
<%locat="查询个人资料"
Call top(1,1)
Dim username,sql,rs

if membername="" Then
  	ErrMsg=ErrMsg+"<br>"+"<li>您还没有<a href=Class_Login.asp><font color=red>登录或注册校友录</font></a>，只有登陆用户才有权查看用户资料！"
	Call Error("Information",ErrMsg)
	
Else
	Call main()
End if


Set rs=Nothing

Sub main()
Dim tmpsql,tmprs,showtype

username=replace(trim(Request("name")),"'","")

if username="" or len(username)>12 Then
   	ErrMsg=Errmsg+"<br>"+"<li>没有操作请求，你试图进行非法操作！"
	founderr=true
End if

if founderr Then 
	Call Error("Critical",ErrMsg)
	Exit Sub
End if

sql="Select * from student where userid='"&UserName&"'"
Set rs=Conn.Execute(sql)
if rs.eof and rs.bof Then
	ErrMsg=Errmsg+"<br>"+"<li>您查询的名字不存在"
	founderr=True
End if

if founderr Then 
   set rs=nothing
	Call Error("Critical",ErrMsg)
	Exit Sub
End if

showtype=0
if sysadmin Then
	showtype=1
Else
	tmpsql="Select classid from joinclass where userid='"&username&"' and classid in (Select classid from joinclass where userid='"&membername&"' and isauditing=0)"
	Set tmprs=Conn.Execute(tmpsql)
	'if not tmprs.eof or Request("action")="showdetail" Then
	if not tmprs.eof then
	showtype=1
	End if
	Set tmprs=Nothing
End if

%>
<BR>
    <table cellpadding=0 cellspacing=0 border=0 width=700 Class=TableBorder align=center>
        <tr>
            <td>
                
<table cellpadding=5 cellspacing=1 border=0 width=100%>
  <tr>
    <th colspan="5">
      <p align="center"><b>[ <font color=red>
	  <%if showtype=1 then
	  response.write rs("realname")
	  else
	  response.write rs("userid")
	  end if%></font> ]的个人资料</b></th>
  </tr>
  <tr>
    <td colspan="2" bgcolor="#ffffff">
      <p align="left">&nbsp;<img src=images/2.gif>:::<B>基本资料</B>:::</td>
    <td width="2%" rowspan="16" Class=DarkTableBody>　</td>
    <td colspan="2" bgcolor="#ffffff">
      <p align="left">&nbsp;<IMG SRC="images/2.gif" WIDTH="60" HEIGHT="9" BORDER=0 ALT="">:::<b>联系方法</b>:::</td>
  </tr>
  <tr>
    <td width="13%" align="right" Class=LightTableBody>用户名：</td>
    <td width="28%" Class=LightTableBody><%=htmlencode(username)%></td>
    <td width="16%" nowrap align="right" Class=LightTableBody>Email：</td>
    <td width="41%" Class=LightTableBody><%if rs("email")<>"" then
		  if rs("isemailshow")=0 and showtype<>1 then
		  response.write "<font color=""#999999"">同校同学可见</font>"
		  else
		  response.write "<a href=""mailto:"&rs("email")&""">"&htmlencode(rs("email"))&"</a>"
		  end if
		  else
		  response.write "<font color=""#999999"">无</font>"
		  end if%>
	　</td>
  </tr>
  <tr>
    <td width="13%" align="right" Class=DarkTableBody>性别：</td>
    <td width="28%" Class=DarkTableBody>
<%if rs("sex")=1 Then   
    Response.write("青春女孩")
Else   
   Response.write("阳光男孩")   
End if   
%>
	　</td>
	    <td width="16%" align="right" Class=DarkTableBody>QQ：</td>
    <td width="41%" Class=DarkTableBody>
<%if rs("oicq")<>"" Then
if rs("isoicqshow")=0 and showtype<>1 then
response.write"<font color=""#999999"">同校同学可见</font>"
else
response.write rs("oicq")
end if
end if
%>	</td>
  </tr>
  <tr>
    <td width="13%" align="right" Class=LightTableBody>生日：</td>
    <td width="28%" Class=LightTableBody>
	<%if rs("birthday")<>"" then
		  if showtype<>1 then
		  response.write "<font color=""#999999"">同校同学可见</font>"
		  else
		  response.write rs("birthday")
		  end if
		  else
		  response.write "<font color=""#999999"">无</font>"
		  end if%></td>
     <td width="16%" align="right" Class=LightTableBody>MSN：</td>
    <td width="41%" Class=LightTableBody><%if rs("msn")<>"" Then
if rs("ismsnshow")=0 and showtype<>1 then
response.write"<font color=""#999999"">同校同学可见</font>"
else
response.write ""&htmlencode(rs("msn"))&""
end if
end if
%></td>
 </tr>
  <tr>
    <td width="13%" align="right" Class=DarkTableBody>星座：</td>
    <td width="28%" Class=DarkTableBody><%if rs("birthday")<>"" then
	if showtype<>1 then
		  response.write ""&constellation(rs("birthday"),false)&""
		  else
		  response.write ""&constellation(rs("birthday"),true)&""
		  end if
		  else
		  response.write "<font color=""#999999"">未知</font>"
		  end if%></td>
      <td width="16%" align="right" Class=DarkTableBody>电话：</td>
          <td width="41%" Class=DarkTableBody><%if rs("telephone")<>"" then
		  if showtype<>1 then
		  response.write "<font color=""#999999"">同校同学可见</font>"
		  else
		  response.write rs("telephone")
		  end if
		  else
		  response.write "<font color=""#999999"">无</font>"
		  end if%></td>
</tr>
  <tr>
    <td width="13%" nowrap align="right" Class=LightTableBody>个人主页：</td>
    <td width="28%" nowrap Class=LightTableBody>
<%if rs("homepage")<>"" Then
if rs("ishomepageshow")=0 and showtype<>1 then
response.write "<font color=""#999999"">同校同学可见</font>"
else
response.write "<a href="&rs("homepage")&" target=""_blank"">"&htmlencode(rs("homepage"))&"</a>"
end if
else
response.write "<font color=""#999999"">无</font>"
End if%>	</td>
      <td width="16%" align="right" Class=LightTableBody>手机：</td>
    <td width="41%" Class=LightTableBody>
	<%if rs("mobilephone")<>"" then
		  if showtype<>1 then
		  response.write "<font color=""#999999"">同校同学可见</font>"
		  else
		  response.write rs("mobilephone")
		  end if
		  else
		  response.write "<font color=""#999999"">无</font>"
		  end if%></td>
  </tr>
  <tr>
    <td colspan="2" bgcolor="#ffffff">
      <p align="left">&nbsp;<IMG SRC="images/2.gif" WIDTH="60" HEIGHT="9" BORDER=0 ALT="">:::<b>活动情况</b>:::</td>
    <td width="16%" align="right" Class=DarkTableBody>邮编：</td>
    <td width="41%" Class=DarkTableBody><%=rs("zipcode")%>　</td>
  </tr>
  <tr>
    <td width="13%" align="right" Class=LightTableBody>目前积分：</td>
    <td width="28%" Class=LightTableBody><%=rs("point")%></td>
    <td width="16%" align="right"  Class=LightTableBody>通讯地址：</td>
    <td width="41%" Class=LightTableBody><%if rs("address")<>"" then
		  if showtype<>1 then
		  response.write "<font color=""#999999"">同校同学可见</font>"
		  else
		  response.write ""&htmlencode(rs("address"))&""
		  end if
		  else
		  response.write "<font color=""#999999"">无</font>"
		  end if%>

	　</td>
  </tr>
  <tr>
    <td width="13%" align="right" Class=DarkTableBody>当前状态：</td>
    <td width="28%" Class=DarkTableBody><%'
	
	Set ors=Conn.Execute("Select logintime from online where userid='"&username&"'")
	if ors.eof and ors.bof Then
	Response.write "离线"
	Else
	onlinetime=datediff("n",ors(0),now())
	if onlinetime=0 Then onlinetime=datediff("s",ors(0),now())&"秒"	Else onlinetime=onlinetime&"分钟"
	Response.write "在线["&onlinetime&"]"
	End if
		%>　</td>
<td width="16%" nowrap align="right"  Class=DarkTableBody>工作单位：</td>
    <td width="41%" Class=DarkTableBody><%if rs("workshop")<>"" then
		  if showtype<>1 then
		  response.write "<font color=""#999999"">同校同学可见</font>"
		  else
		  response.write ""&htmlencode(rs("workshop"))&""
		  end if
		  else
		  response.write "<font color=""#999999"">无</font>"
		  end if%>

	　</td>
  </tr>
  <tr>
    <td width="13%" align="right" Class=LightTableBody>所在学校：</td>
    <td width="28%" Class=LightTableBody><%Call classlist(username)%></td>
	<td  Class=LightTableBody>
      <p align="left"></td>
    <td  Class=LightTableBody>&nbsp;</td>
  </tr>
  <tr>
    <td align="right" Class=LightTableBody>所在班级：</td>
    <td Class=LightTableBody><span class="DarkTableBody"><%=rs("class")%></span></td>
    <td colspan="2" bgcolor=#ffffff>&nbsp;<img src="images/2.gif" width="60" height="9" border=0 alt="">:::<b>个人说明</b>:::</td>
  </tr>
  <tr>
    <td width="13%" align="right" Class=DarkTableBody>登陆次数：</td>
    <td width="28%" Class=DarkTableBody><%=rs("visitcount")%>次</td>
	    <td width="16%" rowspan="3" valign="top" Class=DarkTableBody>
      <p align="center">头像：<br>
              <%if rs("imageid")<>"" Then%>
              <img src="<%=rs("imageid")%>"> 
              <%else%>
              <br>
              <br><a href=Class_Modify.asp>请选择您的头像</a>
<%End if%>
</td>
    <td width="41%" rowspan="3" valign="top" Class=DarkTableBody>
人生格言：<BR>
<%if rs("maxim")<>"" Then%>
<%=ubbcode(rs("maxim"))%> 
<%End if%></td>
  </tr>
  <tr>
    <td width="13%" align="right" Class=LightTableBody>注册日期：</td>
    <td width="28%" Class=LightTableBody><%=rs("regdate")%></td>
  </tr>
  <tr>
    <td width="13%" align="right" Class=DarkTableBody>最后登陆：</td>
    <td width="28%" Class=DarkTableBody><%=rs("lastlogin")%></td>
  </tr>
  <tr>
    <td colspan="5" bgcolor="#ffffff">
      <p align="center"><b>:::相关操作:::&nbsp;&nbsp;{&nbsp;</b><a href="Class_UserSms.asp?Action=new&touser=<%=username%>"><img src=images/message1.gif border=0 hspace=1>发送讯息</a>&nbsp;&nbsp;<a href="Class_FriendList.asp?Action=addF&myFriend=<%=username%>" target=_blank><img src=images/add.gif border=0 hspace=1>加为好友</a><b>&nbsp;}</b></td>
  </tr>
</table>
</td></tr></table>

<%
End Sub

Sub classlist(byval username) 
	tmpsql="Select C.classid,C.classname from class C inner join joinclass J on C.classid=J.classid "&_
	"where J.userid='"&username&"' and J.isauditing=0 order by C.classname"
	Set tmprs=Conn.Execute(tmpsql)
	if tmprs.eof Then
		Response.write "尚未加入任何学校"
	Else
		Response.write "<select name=classlist onchange=""if(this.selectedIndex!=0&&this.selectedIndex!=1)"&_
				"{window.open('Class_index.asp?ClassID='+options[this.selectedIndex].value);this.selectedIndex=0;}"">"
		Response.write "<option value=0>浏览所注册学校</option>"
		Response.write "<option value=1>----------------------</option>"
		do until tmprs.eof
			Response.write 	"<option value="&tmprs(0)&">"&htmlencode(tmprs(1))&"</option>"
			tmprs.movenext
		loop		
	End if
End Sub 


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

<%Call footer%>
