<link href="styles/general.css" rel="stylesheet" type="text/css" />
<link href="styles/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="js/validator.js"></script>
<body>
<h1>
<span class="action-span"><a href="?ctl=member&act=member_list"><tpl>$member_list</tpl><!--会员列表--></a></span>
<span class="action-span1"><a href="?ctl=index&act=admin_main"><tpl>$common_admin_index</tpl><!--管理首页--></a> >> <tpl>if $member_info['member_id'] != ''</tpl><tpl>$member_edit</tpl><!--会员编辑--><tpl>else</tpl><tpl>$member_add</tpl><!--会员添加--><tpl>/if</tpl></span>
<div style="clear:both"></div>
</h1>
<div class="main-div">
<form method="post" action="index.php?ctl=member&act=member_save" name="theForm" onSubmit="return validate();">
<table width="100%" >
  <tr>
    <td class="label"><tpl>$member_add_name</tpl><!--会员名称-->:</td>
    <td><input type="text" name="member_name" maxlength="60" value="<tpl>$member_info['member_name']</tpl>" /></td>
  </tr>
  <tr>
    <td class="label"><tpl>$member_add_email</tpl><!--电子邮件-->:</td>
    <td><input type="text" name="member_email" maxlength="60" size="40" value="<tpl>$member_info['member_email']</tpl>" /></td>
  </tr>
  <tpl>if $member_info['member_id']==''</tpl>
  <tr>
    <td class="label"><tpl>$member_add_passwd</tpl><!--登录密码-->:</td>
    <td><input type="password" name="member_passwd" maxlength="20" size="20" /></td>
  </tr>
  <tr>
    <td class="label"><tpl>$member_add_passwd1</tpl><!--确认密码-->:</td>
    <td><input type="password" name="confirm_password" maxlength="20" size="20" /></td>
  </tr>
  <tpl>/if</tpl>
  <tr>
    <td class="label"><tpl>$member_add_sex</tpl><!--性别-->:</td>
    <td><tpl>$member_sex</tpl></td>
  </tr>
  <tr>
    <td class="label"><tpl>$member_add_birthday</tpl><!--出生日期-->:</td>
    <td><tpl>$select_year</tpl>&nbsp;<tpl>$select_month</tpl>&nbsp;<tpl>$select_day</tpl></td>
  </tr>
  <tr>
    <td class="label">MSN:</td>
    <td><input type="text" name="member_msn" maxlength="60" size="40" value="<tpl>$member_info['member_msn']</tpl>" /></td>
  </tr>
    </tr>
  <tr>
    <td class="label">QQ:</td>
    <td><input type="text" name="member_qq" maxlength="60" size="40" value="<tpl>$member_info['member_qq']</tpl>" /></td>
  </tr>
    </tr>
  <tr>
    <td colspan="2" align="center">
	<input type="hidden" name="member_id" value="<tpl>$member_info['member_id']</tpl>">
      <input type="submit" value="<tpl>$member_add_save</tpl>" class="button" />
      <input type="reset" value="<tpl>$member_add_reset</tpl>" class="button" />
      </td>
  </tr>
</table>

</form>
</div>
<div id="footer">
<tpl>$common_copyright</tpl>
</div>
<script language="javascript">
  /**
   * 检查输入的内容
   */
  function validate()
  {
    var validator = new Validator('theForm');
    validator.required('member_name','<tpl>$member_add_name_error</tpl>');
	validator.required('member_email','<tpl>$member_add_email_error</tpl>');
	<tpl>if $member_info['member_id']==''</tpl>
	validator.required('member_passwd','<tpl>$member_add_passwd_null</tpl>');
	validator.eqaul('member_passwd','confirm_password','<tpl>$member_add_passwd_conf</tpl>');
	<tpl>/if</tpl>
    return validator.passed();
  }
</script>
</body>
