<meta http-equiv="Content-Type" content="text/html; charset=big5">
<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>

