index.blade.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. @extends('admin.layout')
  2. <style type="text/css">
  3. </style>
  4. @section('header')
  5. @endsection
  6. @section('content')
  7. <div id="sg-main-container-sg">
  8. <div class="wrapper wrapper-content animated fadeInRight">
  9. <div class="row">
  10. <div class="col-sm-12">
  11. <div class="ibox float-e-margins">
  12. <div class="ibox-title">
  13. <h5>{{ $model_name . '记录' }}</h5>
  14. <div class="ibox-tools">
  15. <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
  16. </a>
  17. </div>
  18. </div>
  19. <div class="ibox-content">
  20. <div class="row">
  21. <form>
  22. <div class="col-sm-3 form-group">
  23. <input type="text" class="form-control datepicker" name="begin_date" value="{{ request('begin_date') }}" placeholder="开始时间" autocomplete="off">
  24. </div>
  25. <div class="col-sm-3 form-group">
  26. <input type="text" class="form-control datepicker" name="end_date" value="{{ request('end_date') }}" placeholder="截止时间" autocomplete="off">
  27. </div>
  28. <div class="col-sm-3 form-group">
  29. <input type="text" class="form-control" name="keyword" value="{{ request('keyword') }}" placeholder="请输入学员/课程名搜索">
  30. </div>
  31. <div class="col-sm-3">
  32. <button type="submit" class="btn btn-sm btn-primary">搜索</button>
  33. </div>
  34. </form>
  35. </div>
  36. <table class="table table-striped table-bordered table-hover dataTables-example dataTable" id="sg-main-table">
  37. <thead>
  38. <tr>
  39. <th>姓名</th>
  40. <th>课程名称</th>
  41. <th>开始打卡</th>
  42. <th>结束打卡</th>
  43. <th>累计时间</th>
  44. </tr>
  45. </thead>
  46. <tbody>
  47. @if($list->count() <= 0)
  48. <tr>
  49. <td colspan="5" style="text-align: center;">暂无{{ $model_name }}</td>
  50. </tr>
  51. @else
  52. @foreach($list as $item)
  53. <tr>
  54. <td>{{ $item->student->name }}</td>
  55. <td>{{ $item->course->name }}</td>
  56. <td>{{ $item->begin_date_time }}</td>
  57. <td>{{ $item->end_date_time }}</td>
  58. <td>{{ $item->duration }}</td>
  59. </tr>
  60. @endforeach
  61. @endif
  62. </tbody>
  63. </table>
  64. <div class="row">
  65. <div class="col-sm-12">{{ $list->links() }}</div>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. <div class="modal fade" id="delete-modal" tabindex="-1" role="dialog" aria-labelledby="delete-label" aria-hidden="true">
  74. <div class="modal-dialog">
  75. <form id="delete-form" method="POST" action="{{ $pre_uri . 'delete' }}">
  76. {{ csrf_field() }}
  77. <input type="hidden" name="id" id="delete-input-id">
  78. <div class="modal-content">
  79. <div class="modal-header">
  80. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  81. <h4 class="modal-title" id="delete-label">确定要删除吗?</h4>
  82. </div>
  83. <div class="modal-footer">
  84. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  85. <button type="submit" class="btn btn-danger">删除</button>
  86. </div>
  87. </div>
  88. </form>
  89. </div>
  90. </div>
  91. @endsection
  92. @section('footer')
  93. <script type="text/javascript">
  94. $(function () {
  95. $('#sg-main-table').on('click', '.btn-delete', function () {
  96. $('#delete-input-id').val($(this).attr('data-id'));
  97. $('#delete-modal').modal('show');
  98. });
  99. })
  100. </script>
  101. @endsection