country_wise_university.blade.php 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. @extends('admin.sub_contents.base')
  2. @section('main')
  3. @if(count($universities) > 0)
  4. <table class="table table-bordered list_table">
  5. <thead>
  6. <tr>
  7. <th>Sl</th>
  8. <th>Designation</th>
  9. <th>University Name</th>
  10. <th>University website</th>
  11. <th style="text-align: center;">Action</th>
  12. </tr>
  13. </thead>
  14. <tbody style="border-style: dashed;">
  15. @foreach($universities as $key=>$row)
  16. <tr>
  17. <td style="font-size: 11px;">{{++$key}}</td>
  18. <td style="font-size: 11px;">{{cn($row,'country.name','')}}</td>
  19. <td style="font-size: 11px;">{{$row->name}}</td>
  20. <td style="font-size: 11px;">{{$row->web_address}}</td>
  21. <td style="font-size: 11px; text-align: center;">
  22. <span class="edit_uni_info" data-id="{{$row->id}}" style="cursor: pointer;"><i class="fa fa-edit" ></i></span>
  23. <span class="delete_uni_info" data-id="{{$row->id}}" style="cursor: pointer;"><i class="fa fa-trash ms-1" ></i></span>
  24. </td>
  25. </tr>
  26. <?php
  27. $edit_cls_name = "edit_cls_".$row->id;
  28. ?>
  29. <tr class="edit_data {{$edit_cls_name}} d-none">
  30. <td colspan="5">
  31. <div class="edit_university_load"></div>
  32. </td>
  33. </tr>
  34. @endforeach
  35. </tbody>
  36. </table>
  37. @endif
  38. @endsection
  39. <script>
  40. $(function(){
  41. $('.edit_uni_info').on('click', function(){
  42. $('.edit_university_load').empty();
  43. var self = $(this);
  44. var id = self.attr("data-id");
  45. var edit_cls = "edit_cls_"+id;
  46. $('.edit_data').addClass('d-none');
  47. $("."+edit_cls).removeClass('d-none');
  48. var edit_university_load = self.closest('tbody').find('.edit_university_load');
  49. fetch_sub_content(
  50. edit_university_load,
  51. "{!! route('sub-content', ['name'=>'edit_university_load','action'=>'edit']) !!}&edit_id="+id
  52. );
  53. });
  54. $('.delete_uni_info').on('click', function(){
  55. var id = $(this).attr("data-id");
  56. var form_data={
  57. _token: "{{ csrf_token() }}",
  58. delete_id: id,
  59. }
  60. swal({
  61. title: "Are you sure?",
  62. text: "You will not be able to recover this data!",
  63. type: "warning",
  64. showCancelButton: true,
  65. confirmButtonClass: "btn-danger",
  66. cancelButtonClass: "btn-info",
  67. confirmButtonText: "Yes, delete!",
  68. cancelButtonText: "No, cancel!",
  69. }, function(isConfirm){
  70. if(isConfirm){
  71. $.post("{{ route('ajax-post', ['name'=>'delete_university_info']) }}",form_data
  72. ).done(function(res){
  73. pop_up_msg(res.msg);
  74. $('#country_wise_university').empty();
  75. fetch_sub_content(
  76. '#country_wise_university',
  77. "{{ route('sub-content', ['name'=>'country_wise_university']) }}"
  78. );
  79. }).fail(function(err){
  80. pop_up_msg(err_msg(err), 'error');
  81. });
  82. }
  83. });
  84. });
  85. });
  86. </script>