<style type="text/css">
.layui-form-item{margin-bottom: 0;}
</style>

<div class="layui-form" style="margin-bottom: 15px;"><span style="font-size: 20px;"><?php echo $specialty->name; ?> - </span><span style="font-size: 16px;"><?php echo $course->name; ?></span></div>

<div style="float: left;"><a class="layui-btn" onclick="javascript:showResourEditBox(0, <?php echo $zerotree->id; ?>);"><i class="layui-icon layui-icon-add-circle"></i> 添加题目</a><a class="layui-btn" onclick="showQuestImportBox();"><i class="fa fa-upload"></i> 批量导入</a></div>
<div style="float: right;">
<form class="layui-form" id="search_form" method="post" action="/glquesti/list/<?php echo $course->id; ?>">
  <div class="layui-form-item">
    <div class="layui-inline">
      <label class="layui-form-label">题目名称</label>
      <div class="layui-input-inline">
        <input type="text" class="layui-input" name="se_title" value="<?php echo $search["se_title"]; ?>">
      </div>
    </div>
    <div class="layui-inline">
      <label class="layui-form-label">上传人</label>
      <div class="layui-input-inline">
        <input type="text" class="layui-input" name="se_username" value="<?php echo $search["se_username"]; ?>">
      </div>
    </div>
    <div class="layui-inline">
      <label class="layui-form-label">所属章节</label>
      <div class="layui-input-inline">
        <select name="se_treeid" lay-filter="changecondition">
        <option value=""></option>
        <?php foreach($chapters as $onechapter){ ?>
        <option value="<?php echo $onechapter->id; ?>"<?php if($search["se_treeid"]==$onechapter->id){echo ' selected';} ?>><?php echo $onechapter->name; ?></option>
          <?php if(!empty($onechapter->sections)){ foreach($onechapter->sections as $onesection){ ?>
          <option value="<?php echo $onesection->id; ?>"<?php if($search["se_treeid"]==$onesection->id){echo ' selected';} ?>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $onesection->name; ?></option>
            <?php if(!empty($onesection->knowledges)){ foreach($onesection->knowledges as $oneknowled){ ?>
            <option value="<?php echo $oneknowled->id; ?>"<?php if($search["se_treeid"]==$oneknowled->id){echo ' selected';} ?>>&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-inline">
      <label class="layui-form-label">题目类型</label>
      <div class="layui-input-inline">
        <select name="se_typechild" lay-filter="changecondition">
        <option value=""></option>
        <?php foreach($questitypes as $oneqtype){ ?>
        <option value="<?php echo $oneqtype->id; ?>"<?php if($search["se_typechild"]==$oneqtype->id){echo ' selected';} ?>><?php echo $oneqtype->name; ?></option>
        <?php } ?>
        </select>
      </div>
    </div>
	  <div class="layui-inline">
      <label class="layui-form-label">难度</label>
      <div class="layui-input-inline">
        <select name="se_levels" lay-filter="changecondition">
        <option value=""></option>
        <option value="1"<?php if($search["se_levels"]==1){echo ' selected';} ?>>简单</option>
		    <option value="2"<?php if($search["se_levels"]==2){echo ' selected';} ?>>一般</option>
		    <option value="3"<?php if($search["se_levels"]==3){echo ' selected';} ?>>困难</option>
        </select>
      </div>
    </div>
    <div class="layui-inline">
      <label class="layui-form-label">状态</label>
      <div class="layui-input-inline">
        <select name="se_islocked" lay-filter="changecondition">
        <option value=""></option>
        <option value="1"<?php if($search["se_islocked"]==1){echo ' selected';} ?>>禁用</option>
        <option value="2"<?php if($search["se_islocked"]==2){echo ' selected';} ?>>启用</option>
        </select>
      </div>
    </div>
    <div class="layui-inline">
      <button class="layui-btn" lay-submit>搜索</button>
    </div>
  </div>
</form>
</div>
<div style="clear: both;"></div>

<div class="layui-form">
<form id="list_form" method="post">
<table class="layui-table" lay-skin="line">
  <thead>
    <tr>
      <th><input type="checkbox" name="" lay-skin="primary" lay-filter="allChoose"></th>
      <th>题目</th>
      <th>类型</th>
      <th>难度</th>
      <th>上传人</th>
      <th>时间</th>
      <th>状态</th>
      <th>操作</th>
    </tr> 
  </thead>
  <tbody id="pagelistbox">
    
  </tbody>
  <tfoot>
    <tr id="waitingtipsbox" style="display: none;"><td colspan="8" align="center"><i class="layui-icon layui-anim layui-anim-rotate layui-anim-loop">&#xe63d;</i> 努力加载中......</td></tr>
    <tr>
      <td><input type="checkbox" name="" lay-skin="primary" lay-filter="allChoose"></td>
      <td colspan="7"><div class="layui-btn-group">
      <button type="button" class="layui-btn" title="移动" id="moveto_button">移动</button>
      <button type="button" class="layui-btn" title="禁用" onclick="lockedQuestion(1);">禁用</button>
      <button type="button" class="layui-btn" title="启用" onclick="lockedQuestion(0);">启用</button>
      <button type="button" class="layui-btn" title="删除" id="delete_button">删除</button>
      </div></td>
    </tr>
  </tfoot>
</table>
<input type="hidden" name="islocked" value="0">
</form>
</div>

<div class="layui-form">
  <div id="pagelinkbox" style="text-align: right;"></div>
  <div style="clear: both;"></div>
</div>

<form id="gotopage_form" style="display: none;">
  <input type="hidden" name="curpage">
  <input type="hidden" name="rnum">
  <input type="hidden" name="listmore" value="yes">
  <input type="hidden" name="se_title" value="<?php echo $search["se_title"]; ?>">
  <input type="hidden" name="se_username" value="<?php echo $search["se_username"]; ?>">
  <input type="hidden" name="se_treeid" value="<?php echo $search["se_treeid"]; ?>">
  <input type="hidden" name="se_typechild" value="<?php echo $search["se_typechild"]; ?>">
  <input type="hidden" name="se_levels" value="<?php echo $search["se_levels"]; ?>">
  <input type="hidden" name="se_islocked" value="<?php echo $search["se_islocked"]; ?>">
</form>

<input type="hidden" id="specialid" value="<?php echo $specialty->id; ?>">
<input type="hidden" id="courseid" value="<?php echo $course->id; ?>">
<input type="hidden" id="listview" value="list">

<form id="moveto_form" method="post" style="display: none;">
  <input type="hidden" name="resourceids">
</form>

<form id="stem_form" method="post" action="/glquesti/basic/index">
  <input type="hidden" name="courseid" value="<?php echo $course->id; ?>">
  <input type="hidden" name="treeid">
  <input type="hidden" name="stemid">
  <input type="hidden" name="listview" value="list">
</form>

<script type="text/javascript">
var allsize = <?php echo $pager->allsize; ?>;
var pagesize = <?php echo $pager->pagesize; ?>;
var courseid = <?php echo $course->id; ?>;
</script>

<script src="/public/modules/glquesti/list/index.js"></script>