<div style="margin: 50px auto; width: 70%; padding-bottom: 20px;">
<h2 style="font-size: 20px; margin: 20px auto; text-align: center;">用户注册</h2>
<form class="layui-form" id="detail_form" method="post">
  <div class="layui-form-item">
    <label class="layui-form-label">角色</label>
    <div class="layui-input-block">
    <?php foreach($roles as $onerole){ ?>
      <input type="radio" name="roleid" lay-filter="changerole" value="<?php echo $onerole->id; ?>" title="<?php echo $onerole->name; ?>"<?php if($onerole->id==4){echo ' checked';} ?>>
    <?php } ?>
    </div>
  </div>
  <div class="layui-form-item" id="specialtybox">
    <label class="layui-form-label">专业</label>
    <div class="layui-input-block" style="width: 40%;">
    <select name="specialid" lay-filter="changespecialty">
    <option value=""></option>
    <?php foreach($colleges as $onechapter){ ?>
    <option disabled value="<?php echo $onechapter->id; ?>"><?php echo $onechapter->name; ?></option>
      <?php if(!empty($onechapter->children)){ foreach($onechapter->children as $onesection){ ?>
      <option disabled value="<?php echo $onesection->id; ?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $onesection->name; ?></option>
      <?php if(!empty($onesection->children)){ foreach($onesection->children as $oneknowled){ ?>
      <option value="<?php echo $oneknowled->id; ?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $oneknowled->name; ?></option>
      <?php } } ?>
    <?php } } ?>
    <?php } ?>
    </select>
    </div>
  </div>
  <div class="layui-form-item" id="xzclassbox">
    <label class="layui-form-label">班级</label>
    <div class="layui-input-block" style="width: 40%;">
    <select name="xzclassid">
    <option value=""></option>
    </select>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">用户名</label>
    <div class="layui-input-inline" style="width: 40%;">
      <input type="text" name="username" placeholder="请输入" class="layui-input" maxlength="20">
    </div>
    <div class="layui-form-mid layui-word-aux">长度4-20个字符，允许字母、数字、下划线</div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">密码</label>
    <div class="layui-input-inline" style="width: 40%;">
      <input type="password" name="password" autocomplete="off" placeholder="请输入" class="layui-input" maxlength="20">
    </div>
    <div class="layui-form-mid layui-word-aux">长度4-20个字符，允许字母、数字、符号</div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">姓名</label>
    <div class="layui-input-inline" style="width: 40%;">
      <input type="text" name="realname" placeholder="请输入" class="layui-input" maxlength="20">
    </div>
    <div class="layui-form-mid layui-word-aux">长度2-20个字符，允许中文、字母、数字、下划线</div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">性别</label>
    <div class="layui-input-block">
      <input type="radio" name="male" value="1" title="男" checked>
      <input type="radio" name="male" value="2" title="女">
      <input type="radio" name="male" value="0" title="保密">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">学号/工号</label>
    <div class="layui-input-inline" style="width: 40%;">
      <input type="text" name="stdnumber" placeholder="请输入" class="layui-input" maxlength="20">
    </div>
    <div class="layui-form-mid layui-word-aux">长度4-20个字符，允许字母、数字、下划线</div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">邮箱</label>
    <div class="layui-input-inline" style="width: 40%;">
      <input type="text" name="email" placeholder="请输入" class="layui-input" maxlength="50">
    </div>
    <div class="layui-form-mid layui-word-aux">长度4-50个字符，允许字母、数字、下划线</div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">验证码</label>
    <div class="layui-input-block">
      <img src="/verifycode/index" style="cursor: pointer; float: left; margin-top: 8px;" title="点击刷新" onclick="javascript:this.src='/verifycode/index?rnum='+ Math.random();">
      <input type="text" name="verifycode" autocomplete="off" placeholder="请输入" class="layui-input" maxlength="10" style="float: left; width: 100px; margin-left: 20px;">
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit id="finished_button">提交</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
      <a style="margin-left: 20px;" href="<?php echo Yii::$app->params["login_url"]; ?>">已有账号？立即登录</a>
    </div>
  </div>
  <input type="hidden" name="_csrf" value="<?php echo Yii::$app->request->getCsrfToken(); ?>">
</form>
</div>

<script src="/public/modules/control/register/index.js"></script>