<!DOCTYPE html>
<html>
<head>
  <meta charset="<?php echo $cfg_soft_lang; ?>">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  <title>新增帐号</title>
  <link rel="stylesheet" href="../static/web/css/bootstrap.min.css">
  <link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
  <link rel="stylesheet" href="../static/web/css/admin.css">
	<script src="../static/web/js/jquery.min.js"></script>
	<script src="../static/web/js/bootstrap.bundle.min.js"></script>
	<script src="js/main.js"></script>
  <script>
    function checkSubmit() {
      if (document.form1.userid.value == "") {
        ShowMsg("用户ID不能为空");
        document.form1.userid.focus();
        return false;
      }
      if (document.form1.uname.value == "") {
        ShowMsg("用户名不能为空");
        document.form1.uname.focus();
        return false;
      }
      if (document.form1.pwd.value == "") {
        ShowMsg("用户密码不能为空");
        document.form1.pwd.focus();
        return false;
      }
      return true;
    }
  </script>
</head>
<body>
  <table width="98%" cellpadding="3" cellspacing="1" align="center" class="table maintable mt-3 mb-3">
    <tr>
      <td height="26" background="../static/web/img/tbg.gif">
        <table width="96%" cellspacing="1" cellpadding="1" class="table table-borderless">
          <tr>
            <td width="24%" style="padding-left:10px">新增帐号</td>
            <td width="76%" align="right"><a href="sys_admin_user.php" class="btn btn-success btn-sm">管理帐号</a></td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td height="215" align="center">
        <form name="form1" action="sys_admin_user_add.php" onSubmit="return checkSubmit();" method="post">
          <input type="hidden" name="_csrf_token" value="<?php echo $GLOBALS['csrf_token']; ?>">
          <input type="hidden" name="dopost" value="add">
          <table width="98%" cellspacing="1" cellpadding="1" class="table table-borderless">
            <tr>
              <td width="260" height="26" class="bline">用户登录ID:</td>
              <td><input name="userid" type="text" id="userid" size="16" style="width:260px">(只能用'0-9'、'a-z'、'A-Z'、'.'、'@'、'_'、'-'、'!'以内范围的字符)</td>
            </tr>
            <tr>
              <td height="26" class="bline">用户笔名:</td>
              <td><input name="uname" type="text" id="uname" size="16" style="width:260px">(发布文章后显示责任编辑的名字)</td>
            </tr>
            <tr>
              <td height="26" class="bline">用户密码:</td>
              <td><input name="pwd" type="text" id="pwd" size="16" style="width:260px">(只能用'0-9'、'a-z'、'A-Z'、'.'、'@'、'_'、'-'、'!'以内范围的字符)</td>
            </tr>
            <tr>
              <td height="26" class="bline">用户组:</td>
              <td height="26" class="bline">
                <select name='usertype' style='width:160px'>
                <?php
			  	$dsql->SetQuery("Select * from `#@__admintype` order by `rank` asc");
			  	$dsql->Execute("ut");
			  	while($myrow = $dsql->GetObject("ut"))
			  	{
			  		echo "<option value='".$myrow->rank."'>".$myrow->typename."</option>";
			  	}
			  	?>
                </select>
                <a href='sys_group.php' class='btn btn-success btn-sm'>用户组设定</a>
              </td>
            </tr>
            <tr>
              <td height="26" class="bline">授权栏目:</td>
              <td height="26" class="bline">
                <select name="typeids[]" id="typeid" style="width:260px;height:200px" multiple="true">
                  <option value="0" class='alltype' selected>所有频道</option>
                  <?php echo $typeOptions?>
                </select>
                (按Ctrl可以进行多选)
              </td>
            </tr>
            <tr>
              <td height="26" class="bline">真实姓名:</td>
              <td height="26" class="bline"><input name="tname" type="text" id="tname"style="width:260px"></td>
            </tr>
            <tr>
              <td height="26" class="bline">电子邮箱:</td>
              <td height="26" class="bline"><input name="email" type="text" id="email" style="width:260px"></td>
            </tr>
            <tr>
              <td height="26" class="bline">安全验证串:</td>
              <td height="26" class="bline">
                <input name="safecode" type="text" id="safecode" style="width:260px">
                <input name="randcode" type="hidden" value="<?php echo $randcode; ?>">(复制本代码:<span style='color:#e74d58'><?php echo $safecode;  ?></span>)
              </td>
            </tr>
            <tr>
              <td colspan="2" align="center" class="py-3"><button type="submit" class="btn btn-success btn-sm" class="coolbg np">保存</button></td>
            </tr>
          </table>
        </form>
      </td>
    </tr>
  </table>
</body>
</html>