work_experience_load.blade.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. @extends('admin.sub_contents.base')
  2. @section('main')
  3. <div class="table-responsive mt-2">
  4. @if(count($work_experience)>0)
  5. <table class="table table-bordered list_table" style="margin-bottom: 10px;">
  6. <thead>
  7. <tr>
  8. <th>Company Name</th>
  9. <th>Designation</th>
  10. <th>Currently working</th>
  11. <th>Start Date</th>
  12. <th>End Date</th>
  13. {{-- @if(profile_permission($work_experience[0]->student_id)) --}}
  14. <th>Action</th>
  15. {{-- @endif --}}
  16. </tr>
  17. </thead>
  18. <tbody>
  19. @foreach($work_experience as $row)
  20. <tr>
  21. <td style="font-size: 11px;">{{$row->company_name}}</td>
  22. <td style="font-size: 11px;">{{$row->designation}}</td>
  23. <td style="font-size: 11px;">{{$row->currently_working == 0 ? 'off' : 'on'}}</td>
  24. <td style="font-size: 11px;">@if(!empty($row->start_date)){{date("d M, Y", strtotime($row->start_date))}} @else @endif</td>
  25. <td style="font-size: 11px;">@if(!empty($row->end_date)) {{date("d M, Y", strtotime($row->end_date))}} @else @endif</td>
  26. <td class="text-center" style="width: 100px;">
  27. <div class="icon_bar" style="border: none;">
  28. <span class="edit_work_experience_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>
  29. <span class="delete_work_experience_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>
  30. </div>
  31. </td>
  32. </tr>
  33. <?php
  34. $edit_cls_name = "edit_cls_".$row->id;
  35. ?>
  36. <tr class="edit_data {{$edit_cls_name}} d-none">
  37. <td colspan="7">
  38. <div class="edit_work_experience_form"></div>
  39. </td>
  40. </tr>
  41. @endforeach
  42. </tbody>
  43. </table>
  44. @else
  45. <div class="alert mt-1 mb-3" style="border-color: #e9f0f3; font-size: 12px !important; color: #dc3545; border-radius: 30px; padding: 8px 15px;">
  46. <span>No Work Experience available.</span>
  47. </div>
  48. @endif
  49. </div>
  50. @endsection
  51. <script>
  52. $(function(){
  53. $('.edit_work_experience_info').on('click', function(){
  54. $('.edit_work_experience_form').empty();
  55. var self = $(this);
  56. var id = self.attr("data-id");
  57. var edit_cls = "edit_cls_"+id;
  58. $('.edit_edu_data').addClass('d-none');
  59. $("."+edit_cls).removeClass('d-none');
  60. var edit_work_experience_form = self.closest('tbody').find('.edit_work_experience_form');
  61. fetch_sub_content(
  62. edit_work_experience_form,
  63. "{!! route('sub-content', ['name'=>'edit_work_experience_form','action'=>'edit']) !!}&edit_id="+id
  64. );
  65. });
  66. $('.delete_work_experience_info').on('click', function(){
  67. var id = $(this).attr("data-id");
  68. var form_data={
  69. _token: "{{ csrf_token() }}",
  70. delete_id: id,
  71. }
  72. swal({
  73. title: "Are you sure?",
  74. text: "You will not be able to recover this data!",
  75. type: "warning",
  76. showCancelButton: true,
  77. confirmButtonClass: "btn-danger",
  78. cancelButtonClass: "btn-info",
  79. confirmButtonText: "Yes, delete!",
  80. cancelButtonText: "No, cancel!",
  81. }, function(isConfirm){
  82. if(isConfirm){
  83. $.post("{{ route('ajax-post', ['name'=>'delete_work_experience_info']) }}",form_data
  84. ).done(function(res){
  85. pop_up_msg(res.msg);
  86. fetch_sub_content(
  87. '#work_experience_load',
  88. "{{ route('sub-content', ['name'=>'work_experience_load']) }}"
  89. );
  90. }).fail(function(err){
  91. pop_up_msg(err_msg(err), 'error');
  92. });
  93. }
  94. });
  95. });
  96. });
  97. </script>