education_history_load.blade.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. @extends('admin.sub_contents.base')
  2. @section('main')
  3. <div class="table-responsive mt-2">
  4. @if(count($institution)>0)
  5. <table class="table table-bordered list_table" style="margin-bottom:10px;">
  6. <thead>
  7. <tr>
  8. <th style="width: 30%;">Institution</th>
  9. <th style="width: 20%;">Academic level</th>
  10. <th style="width: 30%;">Subject</th>
  11. <th>Result</th>
  12. <th style="width: 10%;">Passing Year</th>
  13. {{-- @if(profile_permission($institution[0]->student_id)) --}}
  14. <th style="width: 10%;">Action</th>
  15. {{-- @endif --}}
  16. </tr>
  17. </thead>
  18. <tbody>
  19. @foreach($institution as $row)
  20. <tr>
  21. <td style="font-size: 11px;">{{$row->institution}}</td>
  22. <td style="font-size: 11px;">
  23. <span class="label_badge_radius" style="background-image: linear-gradient(90deg,rgba(46,17,83,.19),#f5f4fd) !important;">{{$row->academic_level_info->name}}</span>
  24. </td>
  25. <td style="font-size: 11px;">{{$row->subject}}</td>
  26. <td style="font-size: 11px;">{{$row->result}}</td>
  27. <td style="font-size: 11px;">
  28. <span style="font-weight: 400; font-size: 12px;">{{$row->passing_year}}</span>
  29. </td>
  30. <!-- <td style="font-size: 11px;">{{date("d M, Y", strtotime($row->start_date)).' - '.date("d M, Y", strtotime($row->end_date))}}</td> -->
  31. <td class="text-center" style="width: 75px;">
  32. <div class="icon_bar" style="border: none;">
  33. <span class="edit_education_info" data-id="{{$row->id}}" style="cursor: pointer; @if($is_freez_profile) pointer-events:none; @endif"><i class="fa fa-edit change_pass_btn" ></i></span>
  34. <span class="delete_education_info" data-id="{{$row->id}}" style="cursor: pointer; @if($is_freez_profile) pointer-events:none; @endif"><i class="fa fa-trash change_pass_btn ms-1" ></i></span>
  35. </div>
  36. </td>
  37. </tr>
  38. <?php
  39. $edit_cls_name = "edit_cls_".$row->id;
  40. ?>
  41. <tr class="edit_edu_data {{$edit_cls_name}} d-none">
  42. <td colspan="6">
  43. <div class="edit_education_load"></div>
  44. </td>
  45. </tr>
  46. @endforeach
  47. </tbody>
  48. </table>
  49. @else
  50. <div class="alert mt-1 mb-3" style="border-color: #e9f0f3; font-size: 12px !important; color: #dc3545; border-radius: 30px; padding: 8px 15px;">
  51. <span>No Education History available.</span>
  52. </div>
  53. @endif
  54. </div>
  55. @endsection
  56. <script>
  57. $(function(){
  58. $('.edit_education_info').on('click', function(){
  59. $('.edit_education_load').empty();
  60. var self = $(this);
  61. var id = self.attr("data-id");
  62. var edit_cls = "edit_cls_"+id;
  63. $('.edit_edu_data').addClass('d-none');
  64. $("."+edit_cls).removeClass('d-none');
  65. var edit_education_load = self.closest('tbody').find('.edit_education_load');
  66. fetch_sub_content(
  67. edit_education_load,
  68. "{!! route('sub-content', ['name'=>'edit_education_load','action'=>'edit']) !!}&edit_id="+id
  69. );
  70. });
  71. $('.delete_education_info').on('click', function(){
  72. var id = $(this).attr("data-id");
  73. var form_data={
  74. _token: "{{ csrf_token() }}",
  75. delete_id: id,
  76. }
  77. swal({
  78. title: "Are you sure?",
  79. text: "You will not be able to recover this data!",
  80. type: "warning",
  81. showCancelButton: true,
  82. confirmButtonClass: "btn-danger",
  83. cancelButtonClass: "btn-info",
  84. confirmButtonText: "Yes, delete!",
  85. cancelButtonText: "No, cancel!",
  86. }, function(isConfirm){
  87. if(isConfirm){
  88. $.post("{{ route('ajax-post', ['name'=>'delete_education_info']) }}",form_data
  89. ).done(function(res){
  90. pop_up_msg(res.msg);
  91. fetch_sub_content(
  92. '#education_history_load',
  93. "{{ route('sub-content', ['name'=>'education_history_load']) }}"
  94. );
  95. }).fail(function(err){
  96. pop_up_msg(err_msg(err), 'error');
  97. });
  98. }
  99. });
  100. });
  101. });
  102. </script>