<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=system&act=system_admin"><tpl>$system_admin_list</tpl><!--管理员列表--></a></span>
<span class="action-span1"><a href="?ctl=index&act=admin_main"><tpl>$common_admin_index</tpl><!--管理首页--></a> >> <tpl>if $admin_info['admin_id']!=''</tpl><tpl>$system_admin_edit</tpl><!--编辑管理员--><tpl>else</tpl><tpl>$system_admin_add</tpl><!--添加管理员--><tpl>/if</tpl></span>
<div style="clear:both"></div>
</h1>
<div class="main-div">
<form name="theForm" method="post" action="index.php?ctl=system&act=system_admin_save" onSubmit="return validate();">
<table width="100%">
  <tr>
    <td class="label"><tpl>$system_admin_add_name</tpl><!--管理员用户名-->：</td>
    <td>
      <input type="text" name="admin_name" maxlength="20" value="<tpl>$admin_info['admin_name']</tpl>" size="34"/></td>
  </tr>
  <tr>
    <td class="label"><tpl>$system_admin_add_email</tpl><!--管理员email-->：</td>
    <td>
      <input type="text" name="admin_email" value="<tpl>$admin_info['admin_email']</tpl>" size="34" /></td>
  </tr>
 <tpl>if $admin_info['admin_id'] == ''</tpl> 
  <tr>
    <td class="label"><tpl>$system_admin_add_passwd</tpl><!--管理员密码-->：</td>
    <td>
      <input type="password" name="admin_password" maxlength="32" size="34" /></td>
  </tr>
  <tr>
    <td class="label"><tpl>$system_admin_add_passwd1</tpl><!--确认密码-->：</td>
    <td>
      <input type="password" name="pwd_confirm" maxlength="32" size="34" /></td>
  </tr>
  <tpl>/if</tpl>
<tpl>if $admin_info['admin_id'] != ''</tpl>
  <tr>
    <td class="label">
     <tpl>$system_admin_add_old_passwd</tpl> <!--旧密码-->：</td>
    <td>
      <input type="password" name="old_password" size="34" />
      </td>
  </tr>
  <tr>
    <td class="label"><tpl>$system_admin_add_new_passwd</tpl><!--新密码-->：</td>
    <td>
      <input type="password" name="new_password" maxlength="32" size="34" /></td>
  </tr>
  <tr>
    <td class="label"><tpl>$system_admin_add_passwd1</tpl><!--确认密码-->：</td>
    <td>
      <input type="password" name="pwd_confirm" value="" size="34" /></td>
  </tr>
 <tpl>/if</tpl>
  <tr>
    <td colspan="2" align="center">
		<input type="hidden" name="admin_id" value="<tpl>$admin_info['admin_id']</tpl>">
		<tpl>if $admin_info['admin_id'] != ''</tpl>
		<input type="hidden" name="admin_passwd" value="<tpl>$admin_info['admin_passwd']</tpl>" >
		<tpl>/if</tpl>
      <input type="submit" value="<tpl>$system_admin_add_save</tpl>" class="button" />&nbsp;&nbsp;&nbsp;
      <input type="reset" value="<tpl>$system_admin_add_reset</tpl>" class="button" />
  </tr>
</table>
</form>
</div>
<div id="footer">
<tpl>$common_copyright</tpl>
</div>
<script language="javascript">
  /**
   * 检查输入的内容
   */
  function validate()
  {
    var validator = new Validator('theForm');
    validator.required('admin_name','<tpl>$system_admin_add_name_error</tpl>');
	validator.required('admin_email','<tpl>$system_admin_add_email_error</tpl>');
	<tpl>if $admin_info['admin_id']==''</tpl>
	validator.required('admin_password','<tpl>$system_admin_add_passwd_null1</tpl>');
	validator.eqaul('admin_password','pwd_confirm','<tpl>$system_admin_add_passwd_conf</tpl>');
	<tpl>/if</tpl>
    return validator.passed();
  }
</script>
</body>