index.blade.php 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. <table class="table table-striped table-bordered table-hover dataTables-example dataTable" id="sg-main-table">
  21. <thead>
  22. <tr>
  23. <th>ID</th>
  24. <th>状态</th>
  25. <th>付款状态</th>
  26. <th>时间</th>
  27. <th>操作</th>
  28. </tr>
  29. </thead>
  30. <tbody>
  31. @if($list->count() <= 0)
  32. <tr>
  33. <td colspan="5" style="text-align: center;">暂无{{ $model_name }}</td>
  34. </tr>
  35. @else
  36. @foreach($list as $item)
  37. <tr>
  38. <td>{{ $item->id }}</td>
  39. <td>{!! $item->getStatusLabel() !!}</td>
  40. <td>{!! $item->getPayStatusLabel() !!}</td>
  41. <td>{{ $item->created_at }}</td>
  42. <td>
  43. <div class="btn-group">
  44. <a class="btn btn-sm btn-info btn-edit" href="{{ $pre_uri . 'show?id=' . $item->id }}">查看</a>
  45. <div class="btn btn-sm btn-danger btn-delete" data-id="{{ $item->id }}">删除</div>
  46. </div>
  47. </td>
  48. </tr>
  49. @endforeach
  50. @endif
  51. </tbody>
  52. </table>
  53. <div class="row">
  54. <div class="col-sm-12">{{ $list->links() }}</div>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. <div class="modal fade" id="delete-modal" tabindex="-1" role="dialog" aria-labelledby="delete-label" aria-hidden="true">
  63. <div class="modal-dialog">
  64. <form id="delete-form" method="POST" action="{{ $pre_uri . 'delete' }}">
  65. {{ csrf_field() }}
  66. <input type="hidden" name="id" id="delete-input-id">
  67. <div class="modal-content">
  68. <div class="modal-header">
  69. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  70. <h4 class="modal-title" id="delete-label">确定要删除吗?</h4>
  71. </div>
  72. <div class="modal-footer">
  73. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  74. <button type="submit" class="btn btn-danger">删除</button>
  75. </div>
  76. </div>
  77. </form>
  78. </div>
  79. </div>
  80. @endsection
  81. @section('footer')
  82. <script type="text/javascript">
  83. $(function () {
  84. $('#sg-main-table').on('click', '.btn-delete', function () {
  85. $('#delete-input-id').val($(this).attr('data-id'));
  86. $('#delete-modal').modal('show');
  87. });
  88. })
  89. </script>
  90. @endsection