{include file="page_header.htm"}
<form name="theForm" method="post" enctype="multipart/form-data" onsubmit="return validate();">
<table width="100%"  border="0" cellspacing="0" cellpadding="0" class="table_form1" >	

 {if $act eq "add"}
   <tr>
    <td class="label">用户名 : </td>
    <td>
      <input type="text" name="user_name" class="FormSmall" value="{$user.user_name|escape}" style="width:200px;"/> <span class="required">&nbsp;</span>
    </td>
  </tr>
  <tr>
    <td class="label">密 码 :</td>
    <td>
      <input type="password" name="password" style="width:200px;" class="FormSmall" /> <span class="required">&nbsp;</span>
    </td>
  </tr>
  <tr>
    <td class="label">确认密码 :</td>
    <td>
      <input type="password" name="pwd_confirm"  class="FormSmall"  style="width:200px;" /> <span class="required">&nbsp;</span>
    </td>
  </tr>
  {/if}

  {if $act neq "add"}
    <tr>
    <td class="label">用户名 : </td>
    <td>
	 {$user.user_name|escape}
      <input type="hidden" name="user_name"  class="FormSmall"  value="{$user.user_name|escape}" style="width:200px;"/>
    </td>
  </tr>
  <tr>
    <td class="label">
      旧密码 :</td>
    <td><input type="password" name="old_password" class="FormSmall" style="width:200px;" /><span class="required">&nbsp;</span></td>
  </tr>
  <tr>
    <td class="label">新密码 :</td>
    <td>
      <input type="password" name="new_password"  class="FormSmall"  style="width:200px;" /><span class="required">&nbsp;</span>
    </td>
  </tr>
  <tr>
    <td class="label">确认密码 :</td>
    <td>
      <input type="password" name="pwd_confirm" value="" style="width:200px;"  class="FormSmall"  /><span class="required">&nbsp;</span>
    </td>
  </tr>
  {/if}
   
   <tr>
    <td class="label">姓名 : </td>
    <td>
      <input type="text" name="name"  class="FormSmall"  value="{$user.name|escape}" style="width:200px;"/>
    </td>
  </tr>  
  
  <tr>
    <td class="label">Email地址 :</td>
    <td>
      <input type="text" name="email" value="{$user.email|escape}" style="width:200px;"  class="FormSmall"  /><span class="required">&nbsp;</span>
   </td>
  </tr> 

  <tr>
	<td style="border:none;"></td>
	<td style="border:none;">
      <input type="submit" value="确定" class="bginput" />&nbsp;&nbsp;&nbsp;
      <input type="reset" value="重置" class="bginput" />
      <input type="hidden" name="act" value="{$form_act}" />
      <input type="hidden" name="id" value="{$user.user_id}" />
    </td>
  </tr>
</table>
</form>

{insert_scripts files="../js/utils.js,validator.js"}
<script language="JavaScript">
var act = "{$act}";
<!--
{literal}
document.forms['theForm'].elements['user_name'].focus();
function validate(){
	validator = new Validator("theForm");
	validator.required("user_name", '用户名不能为空.');
	
	if (act == "add"){
		if (document.forms['theForm'].elements['password']){
			validator.required("password", '密码不能为空.');
			validator.eqaul("password", "pwd_confirm", '密码输入不一至.');
		}
	}
	
	if (act == "edit" || act == "modif"){
		if (document.forms['theForm'].elements['old_password'].value.length > 0){
			validator.required("new_password", '密码不能为空.');
			validator.eqaul("new_password", "pwd_confirm", '密码输入不一至.');
		}
	}
	
	validator.required("email", '邮箱不能为空.', 1);
	validator.isEmail("email", '邮箱格式错误.');

  	return validator.passed();
}
//-->
{/literal}
</script>
{include file="page_footer.htm"}