<?php

	include '../user.php';
	include '../global.php';
	include '../config.php';
	include '../../header.php';

	$user = $_COOKIE['AnYue_Admin_User'];
	$pass = $_COOKIE['AnYue_Admin_Pass'];

	if ($user != $username or $pass != $password){
	header('refresh:0;url=../login.php');
	}else{
?>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #F8F9FA;
}
-->
</style>

<link href="../images/skin.css" rel="stylesheet" type="text/css" />
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" height="29" valign="top" background="../images/mail_leftbg.gif"><img src="../images/left-top-right.gif" width="17" height="29" /></td>
    <td width="935" height="29" valign="top" background="../images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt">添加用户</div></td>
      </tr>
    </table></td>
    <td width="16" valign="top" background="../images/mail_rightbg.gif"><img src="../images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
    <td height="71" valign="middle" background="../images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9"><table width="100%" height="138" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="13" valign="top">&nbsp;</td>
      </tr>
      <tr>
        <td valign="top"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td class="left_txt">当前位置：添加用户</td>
          </tr>
          <tr>
            <td height="20"><table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
              <tr>
                <td></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td><table width="100%" height="55" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="10%" height="55" valign="middle"><img src="../images/title.gif" width="54" height="55"></td>
                <td width="90%" valign="top"><span class="left_txt2">在这里，您可以根据您的要求，添加用户并</span><span class="left_txt3">设置基本信息</span><span class="left_txt2">！</span><br>
                <span class="left_txt2">包括</span><span class="left_txt3">用户名，登陆密码，用户邮箱，注册时间，注册IP</span><span class="left_txt2">等以及网站</span><span class="left_txt3">会员及等级积分设置</span><span class="left_txt2">。 </span></td>
              </tr>
            </table></td>
          </tr>
		  <?php
		  if (!empty ($_POST['B1'])){
			  mysql_query ("INSERT INTO `user` (`user`,`pass`,`email`,`regdate`,`regip`) VALUES ('{$_POST['username']}','{$_POST['password']}','{$_POST['email']}','{$_POST['regdate']}','{$_POST['regip']}')");
			  echo '<div align="center" style="color: #FF0000"><span style="color: #00FFFF">■■■■■■■■■</span> 添加成功！ <span style="color: #00FFFF">■■■■■■■■■</span></div>';
		  }
		  ?>
		  <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="nowtable">
              <tr>
                <td class="left_bt2">&nbsp;&nbsp;&nbsp;&nbsp;添加用户</td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
			<form name="form1" method="POST" action="">
              <tr>
                <td width="20%" height="30" align="right" bgcolor="#f2f2f2" class="left_txt2">用户名：</td>
                <td width="3%" bgcolor="#f2f2f2">&nbsp;</td>
                <td width="32%" height="30" bgcolor="#f2f2f2"><input name="username" type="text" value="" size="30" /></td>
                <td width="45%" height="30" bgcolor="#f2f2f2" class="left_txt">用户的账号，例如：text</td>
              </tr>
              <tr>
                <td height="30" align="right" class="left_txt2">登陆密码：</td>
                <td>&nbsp;</td>
                <td height="30"><input type="text" name="password" value="" size="30" /></td>
                <td height="30" class="left_txt">用户登陆时输入的密码</td>
              </tr>
              <tr>
                <td height="30" align="right" bgcolor="#f2f2f2" class="left_txt2">用户邮箱：</td>
                <td bgcolor="#f2f2f2">&nbsp;</td>
                <td height="30" bgcolor="#f2f2f2"><input type="text" name="email" value="" size="30" /></td>
                <td height="30" bgcolor="#f2f2f2" class="left_txt">用户的邮箱</td>
              </tr>
			  <tr>
                <td height="30" align="right" class="left_txt2">注册时间：</td>
                <td>&nbsp;</td>
                <td height="30"><input type="text" name="regdate" value="<?=date('Y-m-d H:i:s')?>" size="30" /></td>
                <td height="30" class="left_txt">用户注册的时间</td>
              </tr>
              <tr>
                <td height="30" align="right" bgcolor="#F2F2F2" class="left_txt2">注册IP：</td>
                <td bgcolor="#F2F2F2">&nbsp;</td>
                <td height="30" bgcolor="#F2F2F2"><input name="regip" value="127.0.0.1" type="text" id="mymail" size="30" /></td>
                <td height="30" bgcolor="#F2F2F2"><span class="left_txt">用户注册的IP地址</span></td>
              </tr>

            </table></td>
          </tr>
        </table>
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr><br /></tr>
            <tr>
              <td width="50%" height="30" align="right"><input type="submit" value="确定添加" name="B1" /></td>
              <td width="6%" height="30" align="right">&nbsp;</td>
              <td width="44%" height="30"><a href=""><input type="reset" value="取消添加" name="B12" /></a></td>
            </tr>
            <tr>
              <td height="30" colspan="3">&nbsp;</td>
            </tr>
          </table></td>
      </tr>
    </table></td>
    <td background="../images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="middle" background="../images/mail_leftbg.gif"><img src="../images/buttom_left2.gif" width="17" height="17" /></td>
      <td height="17" valign="top" background="../images/buttom_bgs.gif"><img src="../images/buttom_bgs.gif" width="17" height="17" /></td>
    <td background="../images/mail_rightbg.gif"><img src="../images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>

</body>
<?php } ?>