';
for (var count = 0; count < data.errors.length; count++) {
html += '
' + data.errors[count] + '
';
}
html += '
';
}
if (data.success) {
html = '
' + data.success + '
';
$('#education_level_form')[0].reset();
$('#education_level-table').DataTable().ajax.reload();
}
$('.education_level_result').html(html).slideDown(300).delay(5000).slideUp(300);
}
});
});
$(document).on('click', '.education_level_edit', function(){
var id = $(this).attr('id');
$('.education_level_result').html('');
var target = "{{ route('education_level.index') }}/"+id+'/edit';
$.ajax({
url:target,
dataType:"json",
success:function(html){
$('#education_level_name_edit').val(html.data.name);
$('#hidden_education_level_id').val(html.data.id);
$('#EducationLevelEditModal').modal('show');
}
})
});
$('#education_level_edit_submit').on('click', function(event) {
event.preventDefault();
let education_level_name_edit = $('input[name="education_level_name_edit"]').val();
let hidden_education_level_id= $('#hidden_education_level_id').val();
$.ajax({
url: "{{ route('education_level.update') }}",
method: "POST",
data: { education_level_name_edit:education_level_name_edit,hidden_education_level_id:hidden_education_level_id},
success: function (data) {
var html = '';
if (data.errors) {
html = '
';
for (var count = 0; count < data.errors.length; count++) {
html += '
' + data.errors[count] + '
';
}
html += '
';
}
if (data.success) {
html = '
' + data.success + '
';
$('#education_level_form_edit')[0].reset();
$('#education_level-table').DataTable().ajax.reload();
}
$('.education_level_result_edit').html(html).slideDown(300).delay(3000).slideUp(300);
setTimeout(function(){
$('#EducationLevelEditModal').modal('hide')
}, 5000);
}
});
});
$(document).on('click', '.education_level_delete', function() {
let delete_id = $(this).attr('id');
let target = "{{ route('education_level.index') }}/" + delete_id + '/delete';
if (confirm('{{__('Are You Sure you want to delete this data')}}')) {
$.ajax({
url: target,
success: function (data) {
var html = '';
html = '