edit_teacher_load.blade.php 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <form method="POST" action="{{route('ajax-post', ['name'=>'edit_register_teacher_save'])}}" class="edit_register_pending_teacher_form">
  2. <input type="hidden" name="_token" value="{{ csrf_token() }}" />
  3. <input type="hidden" name="edit_id" value="{{$edit_data->id}}">
  4. <input type="hidden" name="action" value="edit">
  5. <div class="panel-body" style="padding:10px; background-color: #4b4c6824; border: 1px solid #e9e5e5; border-radius: 5px;">
  6. <div class="row">
  7. <div class="col-md-4">
  8. <div class="mb-2">
  9. <label class="form-label config">First Name</label>
  10. <div class="form-icon position-relative">
  11. <input type="text" class="form-control" placeholder="First Name" id="first_name" name="first_name" value="{{$edit_data->first_name}}" required="" style="font-size: 13px;">
  12. </div>
  13. </div>
  14. </div>
  15. <div class="col-md-4">
  16. <div class="mb-2">
  17. <label class="form-label config">Last Name</label>
  18. <div class="form-icon position-relative">
  19. <input type="text" class="form-control" placeholder="Last Name" id="last_name" name="last_name" value="{{$edit_data->last_name}}" required="" style="font-size: 13px;">
  20. </div>
  21. </div>
  22. </div>
  23. <div class="col-md-4">
  24. <div class="mb-2">
  25. <label class="form-label config">Designation</label>
  26. <div class="form-icon position-relative">
  27. <input type="text" class="form-control" placeholder="Designation" id="designation" name="designation" value="{{$edit_data->designation}}" required="" style="font-size: 13px;">
  28. </div>
  29. </div>
  30. </div>
  31. <div class="col-md-4">
  32. <div class="mb-2">
  33. <label class="form-label config">Department</label>
  34. <div class="form-icon position-relative">
  35. <select name="department" class="form-control" required="" style="font-size: 13px;">
  36. <option selected disabled>Select Department</option>
  37. @foreach($departments as $row)
  38. <option value="{{$row->id}}" @if($row->id==$edit_data->department) selected @endif>{{$row->name}}</option>
  39. @endforeach
  40. </select>
  41. </div>
  42. </div>
  43. </div>
  44. <div class="col-md-4">
  45. <div class="mb-2">
  46. <label class="form-label config">Destination</label>
  47. <div class="form-icon position-relative">
  48. <select name="destination" id="destination_id" class="form-control" required="" style="font-size: 13px;">
  49. <option selected disabled>Select Destination</option>
  50. @foreach($market_countries as $row)
  51. <option value="{{$row->country_id}}" @if($row->country_id==$edit_data->nationality) selected @endif>{{$row->name}}</option>
  52. @endforeach
  53. </select>
  54. </div>
  55. </div>
  56. </div>
  57. <div class="col-md-4">
  58. <div class="mb-2">
  59. <label class="form-label config">University</label>
  60. <div class="form-icon position-relative">
  61. <input type="hidden" id="edit_university_id" value="{{$edit_data->university_id}}">
  62. <select name="university" id="university_id" class="form-control" required="" style="font-size: 13px;">
  63. <option selected disabled>Select University</option>
  64. {{-- @foreach($universities as $row)
  65. <option value="{{$row->id}}" @if($row->id==$edit_data->university_id) selected @endif>{{$row->name}}</option>
  66. @endforeach --}}
  67. </select>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. <div class="row">
  73. <div class="col-md-12">
  74. <div class="text-end">
  75. <button type="button" class="btn cancel_button mr-1 btn-cancel close_form" style="background-color: #ffbd59 !important; border: 2px solid #ffbd59; color: white;border-radius: 18px; padding: 2px 6px;">
  76. <i aria-hidden="true" class="fa fa-refresh"></i>
  77. </button>
  78. <button class="btn btn2">Update</button>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </form>
  84. <script>
  85. $(function(){
  86. $('#destination_id').change(function(){
  87. var self=$(this);
  88. var id = $(this).val();
  89. var url="{{ route('destination-wise-university')}}";
  90. if(id){
  91. $.get(url, {country_id:id}).done(function(res){
  92. $("#university_id").empty();
  93. $("#university_id").append('<option value="">Select One..</option>');
  94. res.data.universities.forEach(function(row){
  95. $("#university_id").append('<option value="'+row.id+'">'+row.name+'</option>');
  96. })
  97. })
  98. }else{
  99. $("#university_id").empty();
  100. }
  101. });
  102. var destination_id =$("#destination_id").val();
  103. var edit_university_id =$("#edit_university_id").val();
  104. if (destination_id) {
  105. var self=$(this);
  106. var url="{{ route('destination-wise-university')}}";
  107. $.get(url, {country_id:destination_id}).done(function(res){
  108. $("#university_id").empty();
  109. var selected = 'selected'
  110. res.data.universities.forEach(function(row){
  111. if(row.id ==edit_university_id){
  112. $("#university_id").append('<option selected="'+selected+'" value="'+row.id+'">'+row.name+'</option>');
  113. }
  114. if(row.id !=edit_university_id){
  115. $("#university_id").append('<option value="'+row.id+'">'+row.name+'</option>');
  116. }
  117. })
  118. });
  119. }
  120. $('.edit_register_pending_teacher_form').on('submit', function(event){
  121. event.preventDefault();
  122. var self = $(this);
  123. ajax_form(self, function(self){
  124. fetch_sub_content(
  125. '#pending_teacher_load',
  126. "{{ route('sub-content', ['name'=>'register_pending_teacher_load']) }}"
  127. );
  128. });
  129. });
  130. });
  131. $('.btn-cancel').on('click', function(){
  132. $('.edit_data').addClass('d-none')
  133. });
  134. </script>