index.blade.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. @extends('admin.public.base')
  2. @section('body_class')
  3. style="margin: 0 auto;width: 96%;padding: 30px 0px;"
  4. @endsection
  5. @section('content')
  6. @if(check_auth('admin/video_answer/add'))
  7. <div class="page-header">
  8. <a href="{{url('admin/video_answer/add?'.http_build_query(['question_id'=>request('question_id',0)]))}}" class="btn btn-primary">新增</a>
  9. </div>
  10. @endif
  11. <form action="" method="get" class="form-horizontal form-line">
  12. <div class="form-group col col-lg-8 col-md-12 col-sm-12 col-xs-12" style="margin-right: 2px;">
  13. <select name="question_id" class="form-control selectpicker" data-live-search="true" data-live-search-placeholder="搜索题目" data-none-results-text="未搜索到 {0}" title="选择题目">
  14. @foreach ($questionList as $value)
  15. <option value="{{$value['id']}}" @if( $value['id'] == request('question_id',0) ) selected="" @endif >{{$value['title']}}</option>
  16. @endforeach
  17. </select>
  18. </div>
  19. <input type="submit" class="btn btn-sm btn-primary" value="查询"/>
  20. <a href="{{url('admin/video_answer/index')}}" class="btn btn-sm btn-default" >重置</a>
  21. </form>
  22. <div class="row">
  23. <div class="col-xs-12">
  24. <div class="table-responsive">
  25. <table class="table table-striped table-bordered table-hover">
  26. <thead>
  27. <tr>
  28. <th>ID</th>
  29. <th>题目</th>
  30. <th>题目选项</th>
  31. <th>是否答案</th>
  32. <th>修改时间</th>
  33. <th>操作</th>
  34. </tr>
  35. </thead>
  36. <tbody>
  37. @foreach ($list as $a)
  38. <tr>
  39. <th>{{$a['id']}}</th>
  40. <td>
  41. @foreach ($questionList as $value)
  42. @if( $value['id'] == $a['question_id'] )
  43. {{$value['title']}}
  44. @endif
  45. @endforeach
  46. </td>
  47. <td>{{$a['value']}}</td>
  48. <td>
  49. @if( $a['is_answer'] )
  50. @else
  51. @endif
  52. </td>
  53. <td> {{date('Y/m/d H:i:s',$a['update_time'])}}</td>
  54. <td>
  55. @if(check_auth('admin/video_answer/edit'))
  56. <a href="{{url('admin/video_answer/edit?'.http_build_query(['id'=>$a['id']]))}}" class="btn btn-sm btn-warning" >编辑</a>
  57. @endif
  58. @if(check_auth('admin/video_answer/set_answer'))
  59. @if( !$a['is_answer'] )
  60. <a data-url="{{url('admin/video_answer/set_answer?'.http_build_query(['id'=>$a['id'],'is_answer'=>1]))}}" class="set_status btn btn-sm btn-danger" >设为答案</a>
  61. @endif
  62. @endif
  63. </td>
  64. </tr>
  65. @endforeach
  66. <tr>
  67. <td colspan="20" class="page">{{$list->render()}}</td>
  68. </tr>
  69. <tr>
  70. <td colspan="20">总计 {{$list->total()}} 个题目</td>
  71. </tr>
  72. </tbody>
  73. </table>
  74. </div>
  75. </div>
  76. </div>
  77. @endsection