route_mail.blade.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. @extends('base.base')
  2. @section('base')
  3. <div class="main-panel">
  4. <div class="content-wrapper">
  5. <div class="page-header">
  6. <h3 class="page-title">
  7. <span class="page-title-icon bg-gradient-primary text-white mr-2">
  8. <i class="mdi mdi-email"></i>
  9. </span>
  10. Route Mail Config
  11. </h3>
  12. </div>
  13. <div class="row">
  14. <div class="col-lg-12 grid-margin stretch-card">
  15. <div class="card">
  16. <div class="card-body">
  17. <div style="margin-bottom: 15px;">
  18. <button type="button" class="btn btn-sm btn-gradient-success btn-icon-text" onclick="add()">
  19. <i class="mdi mdi-plus btn-icon-prepend"></i>
  20. Add Mail
  21. </button>
  22. </div>
  23. <table class="table table-bordered">
  24. <thead>
  25. <tr>
  26. <th>ID</th>
  27. <th>Mark</th>
  28. <th>Title</th>
  29. <th>Content</th>
  30. <th>Status</th>
  31. <th>Updated At</th>
  32. <th>Actions</th>
  33. </tr>
  34. </thead>
  35. <tbody>
  36. @foreach($list as $item)
  37. <tr>
  38. <td>{{ $item->ID }}</td>
  39. <td>{{ $item->MailMark }}</td>
  40. <td>{{ $item->TitleString }}</td>
  41. <td style="max-width: 360px; white-space: normal;">{{ $item->TextString }}</td>
  42. <td>{{ $item->Status ? 'Enabled' : 'Disabled' }}</td>
  43. <td>{{ $item->UpdatedAt }}</td>
  44. <td>
  45. <button type="button" class="btn btn-sm btn-gradient-dark" onclick="update({{ $item->ID }})">Edit</button>
  46. <button type="button" class="btn btn-sm btn-gradient-warning" onclick="switchStatus({{ $item->ID }})">
  47. {{ $item->Status ? 'Disable' : 'Enable' }}
  48. </button>
  49. <button type="button" class="btn btn-sm btn-gradient-danger" onclick="del({{ $item->ID }})">Delete</button>
  50. </td>
  51. </tr>
  52. @endforeach
  53. </tbody>
  54. </table>
  55. <div class="box-footer clearfix">
  56. Total <b>{{ $list->total() }}</b> rows, <b>{{ $list->lastPage() }}</b> pages
  57. {!! $list->links() !!}
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. <script>
  66. function add() {
  67. layer.open({
  68. type: 2,
  69. title: 'Add Route Mail',
  70. shadeClose: true,
  71. shade: 0.8,
  72. area: ['60%', '75%'],
  73. content: '/admin/notice/route_mail/add'
  74. });
  75. }
  76. function update(id) {
  77. layer.open({
  78. type: 2,
  79. title: 'Edit Route Mail',
  80. shadeClose: true,
  81. shade: 0.8,
  82. area: ['60%', '75%'],
  83. content: '/admin/notice/route_mail/update/' + id
  84. });
  85. }
  86. function switchStatus(id) {
  87. myConfirm('Confirm status change?', function () {
  88. myRequest('/admin/notice/route_mail/switch/' + id, 'post', {}, function (res) {
  89. layer.msg(res.msg);
  90. setTimeout(function () {
  91. window.location.reload();
  92. }, 1000);
  93. });
  94. });
  95. }
  96. function del(id) {
  97. myConfirm('Delete config and related send logs?', function () {
  98. myRequest('/admin/notice/route_mail/delete/' + id, 'post', {}, function (res) {
  99. layer.msg(res.msg);
  100. setTimeout(function () {
  101. window.location.reload();
  102. }, 1000);
  103. });
  104. });
  105. }
  106. </script>
  107. @endsection