<div class="layui-form">
<div class="layui-collapse" lay-accordion id="chapterlistbox">
<?php foreach($chapters as $chapterkey => $onechapter){ ?>
  <div class="layui-colla-item">
    <h2 class="layui-colla-title"><span><?php echo $onechapter->name; ?></span>
    <div class="layui-btn-group" style="float: right;">
      <a class="layui-btn layui-btn-sm" title="添加子类型" onclick="javascript:return showSectionEditBox(0, <?php echo $onechapter->id; ?>);"><i class="layui-icon layui-icon-add-circle"></i> 添加子类型</a>
      <a class="layui-btn layui-btn-sm" title="编辑题型" onclick="javascript:return showChapterEditBox(<?php echo $onechapter->id; ?>);">编辑</a>
    </div>
    </h2>
    <div class="layui-colla-content">
      <div class="layui-collapse" lay-accordion id="sectionlistbox_<?php echo $onechapter->id; ?>">
        <?php foreach($onechapter->children as $sectionkey => $onesection){ ?>
        <div class="layui-colla-item">
          <h2 class="layui-colla-title"><span><?php echo $onesection->name; ?></span>
            <div style="float: right;">
              <a class="layui-btn layui-btn-sm" title="编辑子类型" onclick="javascript:return showSectionEditBox(<?php echo $onesection->id; ?>, <?php echo $onechapter->id; ?>);">编辑</a>
            </div>
          </h2>
        </div>
        <?php } ?>
      </div>
    </div>
  </div>
<?php } ?>
</div>
<div style="margin-top: 20px; color: #f00; line-height: 26px;">特别注意：<br>1. 题型只能添加，不能删除，请谨慎操作。<br>2. 系统中使用的全部是子类型。</div>
</div>

<script src="/public/modules/glconfig/qutype/index.js"></script>