<?php 
//-----------------------------------------------------------------------------
//    ID002同学录 单班级 (PHP & MySQL) 1.0 标准版
//-----------------------------------------------------------------------------
//    Copyright(C) aNErG, 2003. All rights reserved
//
//    技术支持 http://anerg.126.com
//-----------------------------------------------------------------------------
//    本软件对个人完全免费使用
//
//    如用于商业用途,您必须与我联系并支付RMB ￥20
//-----------------------------------------------------------------------------


if ($mod==reg){
include ('conn.php') ;?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><?php echo $classname ?>成员注册</title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<table width="90%" height="634" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><div align="center"><img src="images/main.jpg" width="400" height="239"></div></td>
  </tr>
  <tr>
    <td height="395">
<table width="600" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#4A6B84">
        <tr>
          <td background="images/post1.gif"><div align="center">新成员注册</div></td>
        </tr>
        <tr>
          <td height="379"> 
            <div align="center"> 
              <form name="form1" method="post" action="saveuser.php">
                <table width="90%" border="0" cellspacing="0" cellpadding="0">
                  <tr> 
                    <td colspan="2">&nbsp; </td>
                  </tr>
                  <tr> 
                    <td width="37%"> <div align="right">*用户名:</div></td>
                    <td width="63%"><input type="text" name="username"></td>
                  </tr>
                  <tr> 
                    <td width="37%"> <div align="right">*密码:</div></td>
                    <td><input type="password#8080FF" name="userpwd"></td>
                  </tr>
                  <tr> 
                    <td width="37%"> <div align="right">*E-mail:</div></td>
                    <td><input type="text" name="useremail"></td>
                  </tr>
                  <tr> 
                    <td width="37%"> <div align="right">性别:</div></td>
                    <td> BOY 
                      <input name="sex" type="radio" value="Boy" checked>
                      &nbsp;GIRL
                      <input name="sex" type="radio" value="Girl"> 
                    </td>
                  </tr>
                  <tr> 
                    <td width="37%"> <div align="right">QQ:</div></td>
                    <td><input type="text" name="userqq"></td>
                  </tr>
                  <tr> 
                    <td width="37%"> <div align="right">MSN:</div></td>
                    <td><input type="text" name="usermsn"></td>
                  </tr>
                  <tr> 
                    <td width="37%"> <div align="right">ICQ:</div></td>
                    <td><input type="text" name="usericq"></td>
                  </tr>
                  <tr> 
                    <td width="37%"> <div align="right">电话:</div></td>
                    <td><input type="text" name="userphone"></td>
                  </tr>
                  <tr> 
                    <td width="37%"> <div align="right">移动通讯:</div></td>
                    <td><input type="text" name="mobilephone"></td>
                  </tr>
                  <tr> 
                    <td width="37%"> <div align="right">生日:</div></td>
                    <td><input type="text" name="birthday">
                      (1982-01-13) </td>
                  </tr>
                  <tr> 
                    <td width="37%"> <div align="right">个人介绍:</div></td>
                    <td><textarea name="userinfo" cols="35" rows="6">此人很懒，所以什么都不写！</textarea>
                      <br>
                      (不要超过100字)</td>
                  </tr>
                  <tr> 
                    <td width="37%"> <div align="right"></div></td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr> 
                    <td width="37%"> <div align="right"></div></td>
                    <td><input type="submit" name="Submit" value="提交">
                      <input type="reset" name="Submit2" value="重置"></td>
                  </tr>
                  <tr> 
                    <td colspan="2">&nbsp; </td>
                  </tr>
                </table>
              </form>
            </div></td>
        </tr>
      </table></td>
  </tr>
</table>
<?php require("bottom.php"); ?>
<p>&nbsp;</p>
<? } 
if (empty($HTTP_COOKIE_VARS["class_username"])){
if ($mod==""){
include ('conn.php') ;
$query="select classname,adminemail,announcement from classconfig";
$result=mysql_db_query("$dbname",$query);
$r=mysql_fetch_array($result);
$classname=$r["classname"];
$adminemail=$r["adminemail"];
$announcement=$r["announcement"];
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><==--欢迎来到<?php echo $classname ?>--==></title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>

<body leftmargin="0" topmargin="40%" marginwidth="0" marginheight="10">
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td><div align="center"><img src="images/main.jpg" width="400" height="239"></div></td>
  </tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td colspan="3" background="images/post1.gif">&nbsp;</td>
  </tr>
  <tr> 
    <td width="44%">
<div align="right"></div></td>
    <td width="55%"> 
      <form name="form1" method="post" action="login.php">
        USER: 
        <input name="username" type="text" size="10">
        &nbsp;&nbsp;PASS: 
        <input name="userpwd" type="password" size="10">
        <input name="Submit" type="submit" value="LOGIN">
        <a href="index.php?mod=reg">&nbsp;&nbsp;新成员注册</a> 
      </form></td>
    <td width="1%">
<div align="center"></div></td>
  </tr>
</table>
<br><br>
<?php require("bottom.php"); }?>
<? }
else{
//require('cookies.php');
include ('conn.php') ;
require('java.js');
$username=$HTTP_COOKIE_VARS["class_username"];
$password=$HTTP_COOKIE_VARS["class_userpwd"];
$classuser=$HTTP_COOKIE_VARS["class_username"];
$query="select stat from classuser where username='$classuser'";
$result=mysql_db_query("$dbname",$query);
$r=mysql_fetch_array($result);
$stat=$r["stat"];
$query="select announcement,classname,adminemail from classconfig";
$result=mysql_db_query("$dbname",$query);
$r=mysql_fetch_array($result);
$classname=$r["classname"];
$announcement=$r["announcement"];
$adminemail=$r["adminemail"];
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><==--欢迎来到<?php echo $classname ?>--==></title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="10" marginwidth="0" marginheight="0">
<iframe height="0" frameborder="0" width="0" src="cookies.php"></iframe>
<table width="90%" height="359" border="1" align="center" cellpadding="0" cellspacing="12" bordercolor="#4A6B84">
  <tr>
    <td height="76" bordercolor="#4A6B84"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td colspan="2">&nbsp;</td>
        </tr>
        <tr> 
          <td width="48%">你好<?php echo $username;?>,<?php echo $classname;?>欢迎你！</td>
          <td width="52%"><div align="right"><a href="logout.php">注销登录</a></div></td>
        </tr>
      </table> </td>
  </tr>
  <tr>
    <td height="221" bordercolor="#4A6B84"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="20%" align="center" valign="top"><table width="90%" height="100%" border="1" cellspacing="0" cellpadding="0" valign="top" align="center" bordercolor="#7597B0">
        <tr>
          <td valign="top"><div align="center">
		  <p>╭════════╮</p>
		  <p><a href="###" onclick="Popup('showuser.php','showuser',800,550);">成员列表</a></p>
		  <p><a href="###" onclick="Popup('classphoto.php','classphoto',750,550);" >班级相册</a></p>
		  <p><a href="###" onclick="Popup('upphoto.php', 'upphoto', 400, 200);">上传相片</a></p>
		  <p><a href="###" onclick="Popup('updateuser.php','upuser', 450, 450);">更新资料</a></p>
		  <p><a href="###" onclick="Popup('sendu2u.php','send',400,200);">站内消息</a></p>
		   <p>╰═══════╯</p>
		 </div></td>
        </tr>
		<tr>
					<?
			$nowm=date("m");
			$query="select username,birthday from classuser where birthday LIKE _'$nowm'_ ";
            $result=mysql_db_query("$dbname",$query);
			if($result){
			?>
		    <td><div align="center"><br>
			本月过生日的同学有：
			<br><table>
			<?
			while($r=mysql_fetch_array($result)){
			$bname=$r["username"];
			$birthday=$r["birthday"];
			$birth=substr("$birthday",5,2);
			$birthday=substr("$birthday",5);
			if($nowm==$birth){
			echo "<tr>";
			echo "<td>";
			echo "<a href=\"###\" onclick=\"Popup('listuser.php?name=$bname','listuser',450,300);\">";
			echo "$bname";
			echo "</a>";
			echo "<td>";
			echo "&nbsp;&nbsp;&nbsp;$birthday";
			echo "</td>";
			echo "</td>";
			echo "</tr>";
			}
			}
			?></tr></table>
			不要忘记送上你的祝福:）
			<? }else{
			echo "<tr>";
			echo "<td>";
			echo "本月没有同学过生日！";
			echo "</td>";
			echo "</tr>";
			}
			?>
			</div>
			</td>
		</tr>
      </table></td>
          <td width="55%" align="center" valign="top"><?php include("showmsg.php"); ?></td>
          <td width="25%" align="center" valign="top"><table width="90%" border="1" cellpadding="0" cellspacing="0" bordercolor="#7597B0">
              <tr>
                <td background="images/post1.gif">
<div align="center"><? 
						if($stat==1){
						echo "<a href=\"###\" onclick=\"Popup('admin.php?mod=ann','admin',430,260);\">";
						}
                    ?>管理员公告</a></div></td>
              </tr>
              <tr>
                <td valign="top" bgcolor="#FFFFFF"><table width="90%" height="160" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                      <td valign="top">&nbsp;&nbsp;<?php echo $announcement ?></td>
                    </tr>
                  </table>
                  
                </td>
              </tr>
            </table>
            <a href="mailto:<?php echo $adminemail ?>">如果你有任何问题，请给我来信</a><br>
            <form name="form1" method="post" action="post.php">
              <table width="90%" border="1" cellpadding="0" cellspacing="0" bordercolor="#7597B0">
                <tr> 
                  <td bordercolor="#7597B0"> 
                    <div align="center">
                      <textarea name="classmsg" rows="16"></textarea>
					  <input name="imgsrc" type="text" value="http://相关图片地址" size="22">
                    </div></td>
                </tr>
                <tr>
                  <td bordercolor="#7597B0" background="images/post1.gif"><div align="center">
                      <input type="submit" name="Submit" value="我要留言">
                      <input type="reset" name="Submit2" value="重写一次">
                    </div></td>
                </tr>
              </table>
            </form> 
            <p>&nbsp;</p></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td><div align="center">
	  <table width="80%">
	     <tr>
		    <td>
			<div align="center">目前在线的成员</div>
			</td>
		 </tr>
		 <tr>
		    <td><div align="center">
			<table>
			  <tr>
			<?
			 $query="select cname from classcookie order by ctime";
   			 $result=mysql_db_query("$dbname",$query);
			 $i=1;
			 while($r=mysql_fetch_array($result)){
			 $oname=$r["cname"];
			 echo "<td>";
			 echo "<a href=\"###\" onclick=\"Popup('listuser.php?name=$oname','listuser',450,300);\">";
			 echo "$oname";
			 echo "</a>";
			 echo "&nbsp;&nbsp;&nbsp;";
			 echo "</td>";
			 $i++;
			 if ($i>8){echo "</tr>";
			 $i=1;
			  }
			 }
			?>
			</table>
			</div></td>
		 </tr>
	  </div>
	  </table>
	</td>
  </tr>
</table>
<?php require("bottom.php"); ?>
<?php }?>
