index.blade.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. <div class="col-sm-4">
  22. <form>
  23. <div class="input-group">
  24. <input type="text" value="{{ request('keyword') }}" placeholder="请输入学员/课程名搜索" name="keyword" class="input-sm form-control">
  25. <span class="input-group-btn">
  26. <button type="submit" class="btn btn-sm btn-primary">搜索</button>
  27. </span>
  28. </div>
  29. </form>
  30. </div>
  31. </div>
  32. <table class="table table-striped table-bordered table-hover dataTables-example dataTable" id="sg-main-table">
  33. <thead>
  34. <tr>
  35. <th>姓名</th>
  36. <th>课程名称</th>
  37. <th>请假日期</th>
  38. <th>请假类型</th>
  39. <th>说明</th>
  40. </tr>
  41. </thead>
  42. <tbody>
  43. @if($list->count() <= 0)
  44. <tr>
  45. <td colspan="5" style="text-align: center;">暂无{{ $model_name }}</td>
  46. </tr>
  47. @else
  48. @foreach($list as $item)
  49. <tr>
  50. <td>{{ $item->student->name }}</td>
  51. <td>{{ $item->course->name }}</td>
  52. <td>{{ $item->date }}</td>
  53. <td>{{ ($item->type == 1 ? '短假' : '长假') . $item->days . '天' }}</td>
  54. <td>{{ $item->remark }}</td>
  55. </tr>
  56. @endforeach
  57. @endif
  58. </tbody>
  59. </table>
  60. <div class="row">
  61. <div class="col-sm-12">{{ $list->links() }}</div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. <div class="modal fade" id="delete-modal" tabindex="-1" role="dialog" aria-labelledby="delete-label" aria-hidden="true">
  70. <div class="modal-dialog">
  71. <form id="delete-form" method="POST" action="{{ $pre_uri . 'delete' }}">
  72. {{ csrf_field() }}
  73. <input type="hidden" name="id" id="delete-input-id">
  74. <div class="modal-content">
  75. <div class="modal-header">
  76. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  77. <h4 class="modal-title" id="delete-label">确定要删除吗?</h4>
  78. </div>
  79. <div class="modal-footer">
  80. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  81. <button type="submit" class="btn btn-danger">删除</button>
  82. </div>
  83. </div>
  84. </form>
  85. </div>
  86. </div>
  87. @endsection
  88. @section('footer')
  89. <script type="text/javascript">
  90. $(function () {
  91. $('#sg-main-table').on('click', '.btn-delete', function () {
  92. $('#delete-input-id').val($(this).attr('data-id'));
  93. $('#delete-modal').modal('show');
  94. });
  95. })
  96. </script>
  97. @endsection