load.blade.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <div class="card">
  2. @if(count($courses) > 0)
  3. <table class="table table-basic">
  4. <thead>
  5. <tr>
  6. <th style="width: 5%;">#</th>
  7. <th>Course Details</th>
  8. <th>Institute Details</th>
  9. <th>Intakes</th>
  10. <th>Tution Fees</th>
  11. <th>Requirements</th>
  12. <th class="text-center">Actions</th>
  13. </tr>
  14. </thead>
  15. <tbody>
  16. @php
  17. $serial = $courses->perPage() * ($courses->currentPage() - 1);
  18. @endphp
  19. @foreach($courses as $key => $row)
  20. <tr>
  21. <td>{{ ++$serial }}</td>
  22. <td>
  23. {{ $row->name }}
  24. <br>
  25. <small>{{ $row->department }}, {{ $row->level->name }}</small>
  26. <br>
  27. <span class="label label-default">{{ $row->length }} <small>months</small></span>
  28. </td>
  29. <td>
  30. {{ $row->institute->name }}
  31. <br>
  32. <small>
  33. @foreach($row->campuses as $single)
  34. {{str_replace(' Campus', '', $single->campus->name)}}
  35. @if(!$loop->last) , @endif
  36. @endforeach
  37. </small>
  38. <br>
  39. <small>{{ $row->destination->name }}</small>
  40. </td>
  41. <td>
  42. <small>
  43. @foreach($row->intakes as $intake)
  44. {{date("M", mktime(0, 0, 0, $intake->intake, 1))}}
  45. @if(!$loop->last) , @endif
  46. @endforeach
  47. </small>
  48. </td>
  49. <td>
  50. {{$row->destination->currency}}{{ $row->tution_fee }}
  51. </td>
  52. <td>
  53. @if($row->ielts)
  54. <span class="label label-default"><small>IELTS : {{$row->ielts}}</small></span>
  55. @endif
  56. @if($row->toefl)
  57. <span class="label label-default"><small>TOEFL : {{$row->toefl}}</small></span>
  58. @endif
  59. @if($row->pte)
  60. <span class="label label-default"><small>PTE : {{$row->pte}}</small></span>
  61. @endif
  62. @if($row->duolingo)
  63. <span class="label label-default"><small>Duolingo : {{$row->duolingo}}</small></span>
  64. @endif
  65. </td>
  66. <td class="text-center">
  67. <div class="list-icons">
  68. <div class="dropdown">
  69. <a href="#" class="list-icons-item" data-toggle="dropdown">
  70. <i class="icon-menu9"></i>
  71. </a>
  72. <div class="dropdown-menu dropdown-menu-right">
  73. <a href="{{ url('admin/courses/view') }}/{{ $row->id }}" class="dropdown-item">
  74. <i class="icon-eye"></i> View
  75. </a>
  76. <a href="{{ url('admin/courses/edit') }}/{{ $row->id }}" class="dropdown-item">
  77. <i class="icon-pencil7"></i> Edit
  78. </a>
  79. {!! Form::model($courses, ['method' => 'delete', 'url' => ['admin/courses/delete', $row->id], 'class' =>'dropdown-item form-delete']) !!}
  80. {!! Form::hidden('id', $row->id) !!}
  81. <i class="icon-trash"></i> Delete
  82. {!! Form::close() !!}
  83. </div>
  84. </div>
  85. </div>
  86. </td>
  87. </tr>
  88. @endforeach
  89. </tbody>
  90. </table>
  91. <div class="col-md-12 mt-1 mb-2">
  92. {{ $courses->appends(request()->query())->links('paginator')}}
  93. </div>
  94. @else
  95. <p class="text-center text-danger mt-1">No Course Found. Please try again.</p>
  96. @endif
  97. </div>
  98. <script type="text/javascript">
  99. $(document).ready(function(){
  100. $('[data-toggle="tooltip"]').tooltip();
  101. var elem = document.querySelector('.switchery');
  102. var init = new Switchery(elem);
  103. });
  104. $('.form-delete').click(function(e){
  105. e.preventDefault();
  106. $form = $(this);
  107. swal({
  108. title: 'Are you sure?',
  109. text: "You won't be able to revert this!",
  110. type: 'warning',
  111. showCancelButton: true,
  112. confirmButtonColor: '#3085d6',
  113. cancelButtonColor: '#d33',
  114. confirmButtonText: 'Yes, delete it!'
  115. }).then((result) => {
  116. if (result.value) {
  117. $form.submit();
  118. }
  119. });
  120. });
  121. $("input[type='checkbox']").on('click', function(){
  122. var id = $(this).data('id');
  123. var urll="{{ url('admin/courses/status') }}/"+id;
  124. var msg_success = 'Status Updated Successfully.';
  125. var msg_error = 'Something went wrong!';
  126. $.ajax({
  127. url:urll,
  128. success: function(data){
  129. notify('success',msg_success);
  130. },
  131. error: function (data) {
  132. notify('error',msg_error);
  133. }
  134. });
  135. });
  136. $('.page-link').on('click',function() {
  137. $('#loadData').load($(this).attr('href'));
  138. });
  139. </script>