<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language=JavaScript1.2>
function ismail(mail)
{
	return(new RegExp(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/).test(mail));
}
function isqq(qq)
{
	return(isNaN(qq));
}
function regcheck(formct){
	if (formct.manage.value=='' || formct.password.value=='' || formct.passwordrepeat.value==''){
		alert('会员名或密码为空,请填写');
		return false; 
	}
	if (formct.password.value!=formct.passwordrepeat.value){
		alert('两次输入的密码不一致，请检查后重试。');
		return false; 
	}
	if (formct.password.value.length<5){
		alert('密码太少，请用6位以上');
		return false;
	}
	if (isqq(formct.qq.value)){
		alert('QQ格式不对,请填写');
		return false;
	}
	if (!ismail(formct.email.value)){
		alert('email格式不对,请填写');
		return false;
	}
}
</script>
<title>注册 - PHPStat v1.0 20060618</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body topmargin="0">
<table  width="100%" border="0" cellspacing="1" cellpadding="0" >
  <tr> 
    <td><strong>新用户注册</strong></td>
  </tr>
  <tr> 
    <td><form name="form1" method="post" action="adduser.php" onSubmit='return regcheck(form1)'>
        <table  style="BORDER-COLLAPSE: collapse" borderColor=#93C2DC cellPadding=2 width="100%" border=1>
          <tr > 
            <td colspan="2"><div align="center"><strong><br>
                填写注册资料</strong></div></td>
          </tr>
          {/foreach key=Key item=Item from=$UserData/} 
          <tr > 
            <td width="26%"> <div align="right">用户名:</div></td>
            <td width="74%"><input name="manage" type={/ if $action == "update"/}hidden{/else/}text{//if/} class=input id="manage" value="{/$Item.manager/}" maxlength="12"> 
              3-12位英文或数字字符</td>
          </tr>
		  {/if $Item.group != "strongsuperadmin"/}
          <tr > 
            <td> <div align="right">用户权限:</div></td>
            <td><select name="group" id="group">
                <option value="{/$Item.group/}">{/$Item.groupname/}</option>				
                <option value="guest">仅查看报告</option>				
                <option value="admin">普通管理员</option>
                <option value="superadmin">帐户管理员</option>
              </select> <strong>帐户管理员</strong>拥有全部权限，<strong>普通管理员</strong>独立网站权限，<strong>仅查看报告</strong>没有查看报告权限</td>
          </tr>
		  {//if/}
          <tr > 
            <td> <div align="right">密码:</div></td>
            <td><input name="password" type="password" class=input id="password" maxlength="12" value="{/$Item.manager/}">
              6-12位英文字符，请牢记！</td>
          </tr>
          <tr > 
            <td> <div align="right">重复密码:</div></td>
            <td><input name="passwordrepeat" type="password" class=input id="passwordrepeat" maxlength="12" value="{/$Item.manager/}">
              6-12位英文字符，请牢记！</td>
          </tr>
          <tr > 
            <td> <div align="right">QQ:</div></td>
            <td><input name="qq" type="text" id="qq" class=input value="{/$Item.qq/}"></td>
          </tr>
          <tr > 
            <td> <div align="right">Email:</div></td>
            <td><input name="email" type="text" id="email" class=input value="{/$Item.email/}"></td>
          </tr>
          <tr > 
            <td> <div align="right">Msn:</div></td>
            <td><input name="msn" type="text" id="msn" class=input value="{/$Item.msn/}"></td>
          </tr>
          {//foreach/} {/if $Site == "true"/} 
          <tr > 
            <td><div align="right">分配站点:</div></td>
            <td><select name="user_site[]" size="5" multiple width=120>
                {/foreach item=Item from=$SiteData/}
				<option value={/$Item.website/}{/$Item.selected/}>{/$Item.sitename/}</option>
			    {//foreach/}
				
              </select></td>
          </tr>
          {//if/} 
          <tr > 
            <td colspan=2 align=center><input type="submit" name="Submit" value= {/if $action !=""/}修改{/else/}注册{//if/} class=pagebutton> 
              <input name="action" type="hidden" id="action" value="{/$action|default:"insert"/}">
              <input type="button" name="Submit2" value="返回" onclick="{/if $action !=""/}window.history.go(-1){/else/}window.close(){//if/}" class=pagebutton> </td>
          </tr>
        </table>
      </form></td>
  </tr>
</table>

