<!-- $Id: user_info.htm 7710 2007-03-30 07:10:35Z liry $ -->
{include file="pageheader.htm"}
<div class="main-div">
<form method="post" action="users.php" name="theForm" onsubmit="return validate()">
<table >
  <tr>
    <td class="label">{$lang.username}:</td>
    <td><input type="text" name="username" maxlength="60" value="{$user.username}" />{$lang.require_field}</td>
  </tr>
  <tr>
    <td class="label">{$lang.email}:</td>
    <td><input type="text" name="email" maxlength="60" size="40" value="{$user.email}" />{$lang.require_field}</td>
  </tr>
  {if $form_action eq "insert"}
  <tr>
    <td class="label">{$lang.password}:</td>
    <td><input type="password" name="password" maxlength="20" size="20" />{$lang.require_field}</td>
  </tr>
  {/if}
  <tr>
    <td class="label">{$lang.user_rank}:</td>
    <td><select name="user_rank">
      <option value="0">{$lang.not_special_rank}</option>
      {html_options options=$special_ranks selected=$user.user_rank}
    </select></td>
  </tr>
  <tr>
    <td class="label">{$lang.gender}:</td>
    <td>{html_radios name="sex" options=$lang.sex checked=$user.sex }</td>
  </tr>
  <tr>
    <td class="label">{$lang.birthday}:</td>
    <td>{html_select_date field_order="YMD" prefix="birthday" time=$user.birthday start_year="-100" end_year="+1" display_days=true month_format="%m"}</td>
  </tr>
  <tr>
    <td class="label"><a href="javascript:showNotice('noticePayPoints');" title="{$lang.form_notice}"><img src="images/notice.gif" width="16" height="16" border="0" alt="{$lang.form_notice}"></a> {$lang.label_pay_points}</td>
    <td><input type="text" name="pay_points" maxlength="250" size="20" value="{$user.pay_points}" />{$lang.require_field}<br /><span class="notice-span" id="noticePayPoints">{$lang.notice_pay_points}</span></td>
  </tr>
  <tr>
    <td class="label"><a href="javascript:showNotice('noticeRankPoints');" title="{$lang.form_notice}"><img src="images/notice.gif" width="16" height="16" border="0" alt="{$lang.form_notice}"></a> {$lang.label_rank_points}</td>
    <td><input type="text" name="rank_points" maxlength="250" size="20" value="{$user.rank_points}" />{$lang.require_field}<br /><span class="notice-span" id="noticeRankPoints">{$lang.notice_rank_points}</span></td>
  </tr>
  {if $form_action eq "update"}
  <tr>
    <td class="label">{$lang.label_user_money}</td>
    <td>{$user.formated_user_money}  <a href="user_account.php?act=list&id={$user.user_id}">[ {$lang.view_detail_account} ]</a>
    </td>
  </tr>
  {/if}
  <tr>
    <td colspan="2" align="center">
      <input type="submit" value="{$lang.button_submit}" class="button" />
      <input type="reset" value="{$lang.button_reset}" class="button" />
      <input type="hidden" name="act" value="{$form_action}" />
      <input type="hidden" name="id" value="{$user.user_id}" />
    </td>
  </tr>
</table>

</form>
</div>
{insert_scripts files="../js/utils.js,validator.js"}
{literal}
<script language="JavaScript">
<!--
document.forms['theForm'].elements['username'].focus();

onload = function()
{
    // 开始检查订单
    startCheckOrder();
}

/**
 * 检查表单输入的数据
 */
function validate()
{
    validator = new Validator("theForm");
    validator.required("username",  no_username);
    validator.isEmail("email", invalid_email, true);
    validator.isInt("pay_points", invalid_pay_points, true);
    validator.isInt("rank_points", invalid_rank_points, true);

    if (document.forms['theForm'].elements['act'] == "insert")
    {
        validator.required("password", no_password);
    }

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