';
for (var count = 0; count < data.errors.length; count++) {
html += '
' + data.errors[count] + '
';
}
html += '
';
}
if (data.success) {
html = '
' + data.success + '
';
$('#job_experience_form')[0].reset();
$('#job_experience-table').DataTable().ajax.reload();
}
$('.job_experience_result').html(html).slideDown(300).delay(5000).slideUp(300);
}
});
});
$(document).on('click', '.job_experience_edit', function () {
var id = $(this).attr('id');
$('.job_experience_result').html('');
var target = "{{ route('job_experience.index') }}/" + id + '/edit';
$.ajax({
url: target,
dataType: "json",
success: function (html) {
console.log(html);
$('input[name="job_experience_title_edit"]').val(html.data.title);
$('#hidden_job_experience_id').val(html.data.id);
$('#jobExperienceEditModal').modal('show');
}
});
});
$('#job_experience_edit_submit').on('click', function (event) {
event.preventDefault();
let job_experience_title_edit = $('input[name="job_experience_title_edit"]').val();
let hidden_job_experience_id = $('#hidden_job_experience_id').val();
$.ajax({
url: "{{ route('job_experience.update') }}",
method: "POST",
data: { title: job_experience_title_edit, hidden_job_experience_id: hidden_job_experience_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 + '
';
$('#job_experience_form_edit')[0].reset();
$('#jobExperienceEditModal').modal('hide');
$('#job_experience-table').DataTable().ajax.reload();
}
$('.job_experience_result_edit').html(html).slideDown(300).delay(3000).slideUp(300);
setTimeout(function () {
$('#jobExperienceEditModal').modal('hide')
}, 5000);
}
});
});
$(document).on('click', '.job_experience_delete', function () {
let delete_id = $(this).attr('id');
let target = "{{ route('job_experience.index') }}/" + delete_id + '/delete';
if (confirm('{{__('Are You Sure you want to delete this data')}}')) {
$.ajax({
url: target,
success: function (data) {
var html = '';
html = '