<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>">
<title>提升為管理員</title>
<link href="css/base.css" rel="stylesheet" type="text/css">
<script language='javascript'src='../data/enums/area.js'></script>
<script>
function checkSubmit()
{
  if(document.form2.email.value=="")
  {
    document.form2.email.focus();
    alert("Email不能為空！");
    return false;
  }
  if(document.form2.uname.value=="")
  {
    document.form2.uname.focus();
    alert("用戶暱稱不能為空！");
    return false;
  }
}
</script>
</head>
<body background='images/allbg.gif' leftmargin='8' topmargin='8'>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#D6D6D6">
  <tr>
    <td height="19" background="images/tbg.gif" style="padding-left:10px;"><a href='<?php echo $ENV_GOBACK_URL; ?>'><b>會員管理</b></a> &gt;&gt; 提升為管理員</td>
  </tr>
  <tr>
    <td height="200" bgcolor="#FFFFFF" align='center'><?php
	if($row['matt']==10) 
    {
    echo "<font color='red'>已經是管理員了，不要再提升了！</font>";
    }else{
	?>
      <table width="98%" border="0" cellspacing="0" cellpadding="6">
        <tr>
          <td colspan="2" height="10" ></td>
        </tr>
        <form name="form2" action="member_toadmin.php" method="post" onSubmit="return checkSubmit();">
          <input type="hidden" name="dopost" value="toadmin" />
          <input type="hidden" name="userid" value="<?php echo $row['userid']?>" />
          <input type="hidden" name="id" value="<?php echo $id?>" />
          <tr>
            <td width="17%" align="right" class='bline'>用戶名：</td>
            <td width="83%" class='bline' align="left"><?php
			  echo "<b>".$row['userid']."</b>";
              if($row['face']!='') {
			     echo "<br /><img src='{$row['face']}' width='80'/>";
			  }
			  ?></td>
          </tr>
          <tr> 
            <td height="30" align="right">用戶筆名：</td>
            <td align="left">
            	<input name="uname" type="text" id="uname" size="16" value="<?php echo $row['uname']?>" style="width:200px" /> &nbsp;（發佈文章後顯示責任編輯的名字）
            </td>
          </tr>
          <tr>
            <td height="30" align="right">用戶密碼：</td>
            <td align="left"><input name="pwd" type="text" id="pwd" size="16" style="width:200px" />
              &nbsp;（留空則不修改，只能用'0-9a-zA-Z.@_-!'以內範圍的字符） </td>
          </tr>
          <tr>
            <td height="30" align="right">用戶類型：</td>
            <td align="left"><select name='usertype' style='width:200px'>
                <?php
			  	$dsql->SetQuery("Select * from #@__admintype order by rank asc");
			  	$dsql->Execute("ut");
			  	while($myrow = $dsql->GetObject("ut"))
			  	{
			  		if($row['usertype']==$myrow->rank) echo "<option value='".$myrow->rank."' selected='1'>".$myrow->typename."</option>\r\n";
			  		else echo "<option value='".$myrow->rank."'>".$myrow->typename."</option>\r\n";
			  	}
			  	?>
              </select></td>
          </tr>
          <tr>
            <td height="30" align="right">負責頻道：</td>
            <td align="left"><select name="typeids[]" id="typeid" size='10' style="width:200px" multiple="true">
                <option value="0" class='alltype'>--所有頻道--</option>
                <?php echo $typeOptions?>
              </select>
              (按 Ctrl 可以進行多選) </td>
          </tr>
          <tr> 
            <td height="30" align="right">真實姓名：</td>
            <td align="left"><input name="tname" type="text" id="tname" size="16" style="width:200px" value="" /> &nbsp;</td>
          </tr>
          <tr>
            <td height="30" align="right">電子郵箱：</td>
            <td align="left"><input name="email" type="text" id="email" size="16" style="width:200px" value="<?php echo $row['email']?>" />
              &nbsp;</td>
          </tr>
          <tr>
            <td height="30" align="right">安全驗證串：</td>
            <td align="left"><input name="safecode" type="text" id="safecode" size="16" style="width:200px" />
              <input name="randcode" type="hidden" value="<?php echo $randcode; ?>" />
              &nbsp;
              (複製本代碼： <font color='red'><?php echo $safecode;  ?></font> ) </td>
          </tr>
          <tr>
            <td height="67" align="right" >&nbsp;</td>
            <td height="67"  align="left"><input type="submit" name="Submit" value="確定提升" class='coolbg' />
              &nbsp;&nbsp;
              <input type="reset" name="Submit22" value="重置表單" class='coolbg' /></td>
          </tr>
        </form>
      </table>
      <?php
      }
      ?>
      </td>
  </tr>
</table>
</body>
</html>