61 lines
1.5 KiB
JavaScript
61 lines
1.5 KiB
JavaScript
$(document).ready(function(){
|
|
|
|
$('.employment_online_form').submit(function(){
|
|
if ($('#signature_pad').val() == ''){
|
|
alert('Save to confirm your signature.') ;
|
|
}
|
|
}) ;
|
|
|
|
// hr employment status update
|
|
$('.update_employment_box').submit(function(){
|
|
var thisForm = $(this),
|
|
employmentId = thisForm.find('.update_employment_id').val(),
|
|
employmentStatus = thisForm.find('.update_employment_status').val(),
|
|
warningMessage = $('#click_warning_message').text() + employmentStatus + '!' ;
|
|
|
|
// check confirmation box first
|
|
if (confirm(warningMessage)){
|
|
|
|
// disable button
|
|
lockUnlockInput('lock', '') ;
|
|
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: 'requires/ajax_employment_update.php?type=update-status',
|
|
data: { 'page': employmentId, 'status': employmentStatus },
|
|
dataType: 'json',
|
|
success: function (data) {
|
|
if (data['result']){
|
|
thisForm.find('.update_employment_result_success').fadeIn("fast") ;
|
|
}else{
|
|
thisKey.find('.update_employment_result_error').fadeIn("fast") ;
|
|
}
|
|
|
|
// remove disable
|
|
lockUnlockInput('unlock', '') ;
|
|
|
|
setTimeout(function () {
|
|
$(".update_employment_result").fadeOut("slow") ;
|
|
}, 2000) ;
|
|
}
|
|
});
|
|
}
|
|
|
|
return false ;
|
|
}) ;
|
|
|
|
// datetimepicker
|
|
$('.datetimepicker').datetimepicker({
|
|
timepicker:false,
|
|
format:'d/m/Y',
|
|
formatDate:'Y/m/d',
|
|
scrollInput : false
|
|
});
|
|
|
|
$('.datetimepicker_with_time').datetimepicker({
|
|
format:'d/m/Y H:i',
|
|
formatDate:'Y/m/d',
|
|
scrollInput : false
|
|
});
|
|
|
|
}) ; |