<?php
use app\components\QuestionHelper;
use app\components\StringHelper;
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>编辑</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="apple-mobile-web-app-status-bar-style" content="black"> 
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="format-detection" content="telephone=no">
  
  <link rel="stylesheet" href="/plugins/layui/css/layui.css">
  <link rel="stylesheet" href="/plugins/fontawesome/css/font-awesome.min.css" />
  <link rel="stylesheet" href="/public/css/global.css">

  <script src="/public/js/jquery-1.11.3.min.js"></script>
  <script src="/public/js/jquery.form-3.36.0.min.js"></script>
  
</head>
<body>

<div class="layui-fluid" style="padding-left: 10px; padding-right: 10px; margin-top: 10px;">
<form class="layui-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>
    </tr> 
  </thead>
  <tbody id="pagelistbox">
    <?php foreach($resources as $oneresour){ ?>
      <?php 
      $stemtitle = strip_tags($oneresour->content);
      $stemtitle = StringHelper::loseSpace($stemtitle);
      ?>
    <tr>
      <td><input type="checkbox" name="resourid[]" lay-skin="primary" value="<?php echo $oneresour->id; ?>"></td>
      <td title="<?php echo $stemtitle; ?>"><?php echo StringHelper::utf8Substr($stemtitle,0,15); ?></td>
      <td><?php echo QuestionHelper::ShowStemtypeName($oneresour->typechild); ?></td>
      <td><?php echo QuestionHelper::ShowLevelsName($oneresour->levels); ?></td>
      <td><?php echo $oneresour->showIslocked(); ?></td>
      <td><div class="layui-btn-group"><a class="layui-btn layui-btn-sm" title="编辑" onclick="javascript:parent.showResourEditBox(<?php echo $oneresour->id; ?>,<?php echo $oneresour->treeid; ?>);">编辑</a> <a class="layui-btn layui-btn-sm" title="预览" onclick="javascript:parent.showResourViewBox(<?php echo $oneresour->id; ?>);">预览</a>
          </div>
      </td>
    </tr>
    <?php } ?>
  </tbody>
  <tfoot>
    <tr>
      <td><input type="checkbox" name="" lay-skin="primary" lay-filter="allChoose"></td>
      <td colspan="5"><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>

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

<script src="/plugins/layui/layui.all.js"></script>
</body>
</html>