// JavaScript Document $(function () { var pagenum = $('#pagenum').val(); /* MEMORANDUM */ $('#madd form').iframePostForm ({ json : true, post : function () { var madd_msg; if (!$('.madd_msg').length) { $('#madd_title').after('
'); } if ($('#memo_title').val().length && $('#memo_attach').val().length) { $('.madd_msg') .html(' Creating memo…') .css({ color : '#006100', background : '#c6efce', border : '2px solid #006100', height : 'auto' }) .slideDown(); } else { $('.madd_msg') .html('Memo title and file is required.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } }, complete : function (response) { var style, width, html = ''; if (!response.success) { $('.madd_msg').slideUp(function () { $(this) .html('There was a problem on creating memo') .css({ color : '#9c0006', background : '#ffc7ce', borderColor : '#9c0006', height : 'auto' }) .slideDown(); }); } else { html += 'Memo has been successfully created.
'; $('.madd_msg').slideUp(function () { $(this) .html(html) .css({ color : '#006100', background : '#c6efce', borderColor : '#006100', height : 'auto' }) .slideDown(); }); searchmemo = $("#searchmemo").val(); memofrom = $("#memofrom").val(); memoto = $("#memoto").val(); memopage = 1; $.ajax( { url: "https://www.marketingsalesagents.com/lib/requests/memo_request.php?sec=table", data: "searchmemo=" + searchmemo + "&memofrom=" + memofrom + "&memoto=" + memoto, type: "POST", complete: function(){ $("#loading").hide(); }, success: function(data) { $("#memodata").html(data); } }) } } }); $('#medit form').iframePostForm ({ json : true, post : function () { var medit_msg; if (!$('.medit_msg').length) { $('#medit_title').after(''); } if ($('#umemo_title').val().length) { $('.medit_msg') .html(' Updating memo…') .css({ color : '#006100', background : '#c6efce', border : '2px solid #006100', height : 'auto' }) .slideDown(); } else { $('.medit_msg') .html('Memo title is required.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } }, complete : function (response) { var style, width, html = ''; if (!response.success) { $('.medit_msg').slideUp(function () { $(this) .html('There was a problem on updating memo') .css({ color : '#9c0006', background : '#ffc7ce', borderColor : '#9c0006', height : 'auto' }) .slideDown(); }); } else { if (response.rmailcount) { html += 'Memo has been successfully send to ' + response.rmailcount + ' employees.
'; } else { html += 'Memo has been successfully updated.
'; } $('.medit_msg').slideUp(function () { $(this) .html(html) .css({ color : '#006100', background : '#c6efce', borderColor : '#006100', height : 'auto' }) .slideDown(); }); searchmemo = $("#searchmemo").val(); memofrom = $("#memofrom").val(); memoto = $("#memoto").val(); memopage = 1; $.ajax( { url: "https://www.marketingsalesagents.com/lib/requests/memo_request.php?sec=table", data: "searchmemo=" + searchmemo + "&memofrom=" + memofrom + "&memoto=" + memoto, type: "POST", complete: function(){ $("#loading").hide(); }, success: function(data) { $("#memodata").html(data); } }) } } }); /* ANNOUNCEMENT */ $('#aadd form').iframePostForm ({ json : true, post : function () { var aadd_msg; if (!$('.aadd_msg').length) { $('#madd_title').after(''); } if ($('#memo_title').val().length && $('#memo_attach').val().length) { $('.aadd_msg') .html(' Creating announcement…') .css({ color : '#006100', background : '#c6efce', border : '2px solid #006100', height : 'auto' }) .slideDown(); } else { $('.aadd_msg') .html('Announcement title and file is required.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } }, complete : function (response) { var style, width, html = ''; if (!response.success) { $('.aadd_msg').slideUp(function () { $(this) .html('There was a problem on creating announcement') .css({ color : '#9c0006', background : '#ffc7ce', borderColor : '#9c0006', height : 'auto' }) .slideDown(); }); } else { html += 'Announcement has been successfully created.
'; $('.aadd_msg').slideUp(function () { $(this) .html(html) .css({ color : '#006100', background : '#c6efce', borderColor : '#006100', height : 'auto' }) .slideDown(); }); searchmemo = $("#searchmemo").val(); memofrom = $("#memofrom").val(); memoto = $("#memoto").val(); memopage = 1; $.ajax( { url: "https://www.marketingsalesagents.com/lib/requests/announcement_request.php?sec=table", data: "searchmemo=" + searchmemo + "&memofrom=" + memofrom + "&memoto=" + memoto, type: "POST", complete: function(){ $("#loading").hide(); }, success: function(data) { $("#memodata").html(data); } }) } } }); $('#aedit form').iframePostForm ({ json : true, post : function () { var aedit_msg; if (!$('.aedit_msg').length) { $('#medit_title').after(''); } if ($('#umemo_title').val().length) { $('.aedit_msg') .html(' Updating announcement…') .css({ color : '#006100', background : '#c6efce', border : '2px solid #006100', height : 'auto' }) .slideDown(); } else { $('.aedit_msg') .html('Announcement title is required.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } }, complete : function (response) { var style, width, html = ''; if (!response.success) { $('.aedit_msg').slideUp(function () { $(this) .html('There was a problem on updating announcement') .css({ color : '#9c0006', background : '#ffc7ce', borderColor : '#9c0006', height : 'auto' }) .slideDown(); }); } else { if (response.rmailcount) { html += 'Announcement has been successfully send to ' + response.rmailcount + ' employees.
'; } else { html += 'Announcement has been successfully updated.
'; } $('.aedit_msg').slideUp(function () { $(this) .html(html) .css({ color : '#006100', background : '#c6efce', borderColor : '#006100', height : 'auto' }) .slideDown(); }); searchmemo = $("#searchmemo").val(); memofrom = $("#memofrom").val(); memoto = $("#memoto").val(); memopage = 1; $.ajax( { url: "https://www.marketingsalesagents.com/lib/requests/announcement_request.php?sec=table", data: "searchmemo=" + searchmemo + "&memofrom=" + memofrom + "&memoto=" + memoto, type: "POST", complete: function(){ $("#loading").hide(); }, success: function(data) { $("#memodata").html(data); } }) } } }); /* APPLICATION */ /* Overtime */ $('#mainot form').iframePostForm ({ json : true, post : function () { var mot_msg; if (!$('.mot_msg').length) { $('#alert').after(''); } if ($('#ot_reason').val().length && $('#invalid').val() == 0 && $('#txtothours').val() != 0) { $('.mot_msg') .html(' Processing overtime…') .css({ color : '#006100', background : '#c6efce', border : '2px solid #006100', height : 'auto' }) .slideDown(); } else if ($('#txtothours').val() == 0) { $('.mot_msg') .html('OT hours rendered is zero.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } else if ($('#invalid').val() == 1) { $('.mot_msg') .html('This is not a regular day.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } else if ($('#invalid').val() == 2) { $('.mot_msg') .html('This is not a rest day.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } else if ($('#invalid').val() == 3) { $('.mot_msg') .html('This is not a holiday.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } else { $('.mot_msg') .html('Reason is required.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } }, complete : function (response) { var style, width, html = ''; if (!response.success) { $('.mot_msg').slideUp(function () { $(this) .html(response.error) .css({ color : '#9c0006', background : '#ffc7ce', borderColor : '#9c0006', height : 'auto' }) .slideDown(); }); } else { //html += 'Notice of Unavailability has been successfully applied.
'; $('.mot_msg').slideUp(); alert('Overtime has been successfully applied.'); window.location.href='https://www.marketingsalesagents.com/myrequest?type=1'; } } }); /* Notice of Unavailability */ $('#mainleave form').iframePostForm ({ json : true, post : function () { var mleave_msg; if (!$('.mleave_msg').length) { $('#alert').after(''); } if ($('#leave_reason').val().length && $('#tdays').val().length) { $('.mleave_msg') .html(' Processing leave…') .css({ color : '#006100', background : '#c6efce', border : '2px solid #006100', height : 'auto' }) .slideDown(); } else { if ($('#tdays').val().length == 0) { $('.mleave_msg') .html('Please choose the leave\'s date coverage.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); } else { $('.mleave_msg') .html('Reason is required.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); } return false; } }, complete : function (response) { var style, width, html = ''; if (!response.success) { $('.mleave_msg').slideUp(function () { $(this) .html(response.error) .css({ color : '#9c0006', background : '#ffc7ce', borderColor : '#9c0006', height : 'auto' }) .slideDown(); }); } else { //html += 'Notice of Unavailability has been successfully applied.
'; $('.mleave_msg').slideUp(); alert('Notice of Unavailability has been successfully applied.'); window.location.href='https://www.marketingsalesagents.com/myrequest?type=2'; } } }); /* OBT */ $('#mainob form').iframePostForm ({ json : true, post : function () { var mob_msg; if (!$('.mob_msg').length) { $('#alert').after(''); } if ($('#ndays').val() >= 1) { if ($('#obt_destination').val().length && $('#obt_from').val().length && $('#obt_to').val().length && $('#obt_purpose').val().length) { $('.mob_msg') .html(' Processing official business trip…') .css({ color : '#006100', background : '#c6efce', border : '2px solid #006100', height : 'auto' }) .slideDown(); } else { $('.mob_msg') .html('OBT coverage, destination and purpose are required.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } } else { $('.mob_msg') .html('Date coverage is invalid.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } }, complete : function (response) { var style, width, html = ''; if (!response.success) { $('.mob_msg').slideUp(function () { $(this) .html(response.error) .css({ color : '#9c0006', background : '#ffc7ce', borderColor : '#9c0006', height : 'auto' }) .slideDown(); }); } else { //html += 'Notice of Unavailability has been successfully applied.
'; $('.mob_msg').slideUp(); alert('OBT has been successfully applied.'); window.location.href='https://www.marketingsalesagents.com/myrequest?type=4'; } } }); /* Manual DTR */ $('#maindtr form').iframePostForm ({ json : true, post : function () { var mdtr_msg; if (!$('.mdtr_msg').length) { $('#alert').after(''); } if ($('#ndays').val() >= 1) { if ($('#mdtr_from').val().length && $('#mdtr_to').val().length) { $('.mdtr_msg') .html(' Processing manual DTR…') .css({ color : '#006100', background : '#c6efce', border : '2px solid #006100', height : 'auto' }) .slideDown(); } else { $('.mdtr_msg') .html('Date coverage is required.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } } else { $('.mdtr_msg') .html('Date coverage is invalid.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } }, complete : function (response) { var style, width, html = ''; if (!response.success) { $('.mdtr_msg').slideUp(function () { $(this) .html(response.error) .css({ color : '#9c0006', background : '#ffc7ce', borderColor : '#9c0006', height : 'auto' }) .slideDown(); }); } else { //html += 'Notice of Unavailability has been successfully applied.
'; $('.mdtr_msg').slideUp(); alert('Manual DTR has been successfully applied.'); window.location.href='https://www.marketingsalesagents.com/myrequest?type=7'; } } }); /* Non Punch Auhtorization */ $('#mainnpa form').iframePostForm ({ json : true, post : function () { var mnp_msg; if (!$('.mnp_msg').length) { $('#alert').after(''); } if ($('#npa_din').val().length && $('#npa_dout').val().length && $('#npa_in').val().length && $('#npa_out').val().length && $('#npa_reason').val().length) { $('.mnp_msg') .html(' Processing non punching authorization…') .css({ color : '#006100', background : '#c6efce', border : '2px solid #006100', height : 'auto' }) .slideDown(); } else { $('.mnp_msg') .html('Reason, date/time in and out are required.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } }, complete : function (response) { var style, width, html = ''; if (!response.success) { $('.mnp_msg').slideUp(function () { $(this) .html(response.error) .css({ color : '#9c0006', background : '#ffc7ce', borderColor : '#9c0006', height : 'auto' }) .slideDown(); }); } else { //html += 'Notice of Unavailability has been successfully applied.
'; $('.mnp_msg').slideUp(); alert('Non punching authorization has been successfully applied.'); window.location.href='https://www.marketingsalesagents.com/myrequest?type=6'; } } }); /* Time Scheduler */ $('#mainsc form').iframePostForm ({ json : true, post : function () { var msc_msg; if (!$('.msc_msg').length) { $('#alert').after(''); } if ($('#ndays').val() >= 1) { if ($('#tsched_from').val().length && $('#tsched_to').val().length) { $('.msc_msg') .html(' Processing time schedule…') .css({ color : '#006100', background : '#c6efce', border : '2px solid #006100', height : 'auto' }) .slideDown(); } else { $('.msc_msg') .html('Date coverage is required.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } } else { $('.msc_msg') .html('Date coverage is invalid.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } }, complete : function (response) { var style, width, html = ''; if (!response.success) { $('.msc_msg').slideUp(function () { $(this) .html(response.error) .css({ color : '#9c0006', background : '#ffc7ce', borderColor : '#9c0006', height : 'auto' }) .slideDown(); }); } else { //html += 'Notice of Unavailability has been successfully applied.
'; $('.msc_msg').slideUp(); alert('Time schedule has been successfully applied.'); window.location.href='https://www.marketingsalesagents.com/myrequest?type=8'; } } }); /* REGISTRATION */ $('#regis form').iframePostForm ({ json : true, post : function () { var regis_msg; if (!$('.regis_msg').length) { $('#lasttable').after(''); } if ($('#binFile').val().length) { var x = new Array('empnum', 'position', 'lastname', 'firstname', 'middlename', 'nickname', 'address_num', 'address_street', 'address_brgy', 'address_city', 'address_region', 'address_zip', 'address_country', 'provincial_address', 'contact', 'email', 'birthplace', 'sss', 'tin', 'philhealth', 'pagibig', 'father_name', 'father_comp', 'mother_name', 'mother_comp', 'schoolname[0]', 'schoolname[1]', 'skill[0]', 'comp_supervisor[0]', 'department', 'local', 'corp_email', 'emergency_name', 'emergency_address', 'emergency_telno'); for (var i = 0; i < x.length; i += 1) { l = document.forms['formreg'][x[i]]; if (l.value == null || l.value == '' || l.value == 0) { $('.regis_msg') .html('Some fields are required.' + x[i]) .css({ 'color' : '#9c0006', 'background' : '#ffc7ce', 'border' : '2px solid #9c0006', 'margin-top' : '10px', 'height' : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } else { $('.regis_msg') .html(' Registering your profile…') .css({ 'color' : '#006100', 'background' : '#c6efce', 'border' : '2px solid #006100', 'margin-top' : '10px', 'height' : 'auto' }) .slideDown(); } } } else { $('.regis_msg') .html('Please select an image for uploading.') .css({ 'color' : '#9c0006', 'background' : '#ffc7ce', 'border' : '2px solid #9c0006', 'margin-top' : '10px', 'height' : 'auto' }) .slideDown(); return false; } }, complete : function (response) { var style, width, html = ''; if (!response.success) { $('.regis_msg').slideUp(function () { $(this) .html(response.error) .css({ 'color' : '#9c0006', 'background' : '#ffc7ce', 'borderColor' : '#9c0006', 'margin-top' : '10px', 'height' : 'auto' }) .slideDown(); }); } else { html += 'Your profile has been successfully registered and subject for approval.
'; $('.regis_msg').slideUp(function () { $(this) .html(html) .css({ 'color' : '#006100', 'background' : '#c6efce', 'borderColor' : '#006100', 'margin-top' : '10px', 'height' : 'auto' }) .slideDown(); }); $.ajax( { url: "https://www.marketingsalesagents.com/lib/requests/act_request.php?sec=table", success: function(data) { $("#activity_table").html(data); } }); } } }); /* PROFILE */ $('#uprofile form').iframePostForm ({ json : true, post : function () { var uprofile_msg; if (!$('.uprofile_msg').length) { $('#lasttable').after(''); } $('.uprofile_msg') .html(' Updating your profile…') .css({ 'color' : '#006100', 'background' : '#c6efce', 'border' : '2px solid #006100', 'margin-top' : '10px', 'height' : 'auto' }) .slideDown(); }, complete : function (response) { var style, width, html = ''; if (!response.success) { $('.uprofile_msg').slideUp(function () { $(this) .html(response.error) .css({ 'color' : '#9c0006', 'background' : '#ffc7ce', 'borderColor' : '#9c0006', 'margin-top' : '10px', 'height' : 'auto' }) .slideDown(); }); } else { html += 'Your profile has been successfully updated.
'; $('.uprofile_msg').slideUp(function () { $(this) .html(html) .css({ 'color' : '#006100', 'background' : '#c6efce', 'borderColor' : '#006100', 'margin-top' : '10px', 'height' : 'auto' }) .slideDown(); }); } } }); $('#uprofile2 form').iframePostForm ({ json : true, post : function () { var uprofile_msg; if (!$('.uprofile_msg').length) { $('#lasttable').after(''); } $('.uprofile_msg') .html(' Submitting your profile…') .css({ 'color' : '#006100', 'background' : '#c6efce', 'border' : '2px solid #006100', 'margin-top' : '10px', 'height' : 'auto' }) .slideDown(); }, complete : function (response) { var style, width, html = ''; if (!response.success) { $('.uprofile_msg').slideUp(function () { $(this) .html(response.error) .css({ 'color' : '#9c0006', 'background' : '#ffc7ce', 'borderColor' : '#9c0006', 'margin-top' : '10px', 'height' : 'auto' }) .slideDown(); }); } else { html += 'Your profile update has been successfully submitted for approval.
'; $('.uprofile_msg').slideUp(function () { $(this) .html(html) .css({ 'color' : '#006100', 'background' : '#c6efce', 'borderColor' : '#006100', 'margin-top' : '10px', 'height' : 'auto' }) .slideDown(); }); } } }); $('#uprofile3 form').iframePostForm ({ json : true, post : function () { var uprofile_msg; if (!$('.uprofile_msg').length) { $('#lasttable').after(''); } $('.uprofile_msg') .html(' Updating your profile…') .css({ 'color' : '#006100', 'background' : '#c6efce', 'border' : '2px solid #006100', 'margin-top' : '10px', 'height' : 'auto' }) .slideDown(); }, complete : function (response) { var style, width, html = ''; if (!response.success) { $('.uprofile_msg').slideUp(function () { $(this) .html(response.error) .css({ 'color' : '#9c0006', 'background' : '#ffc7ce', 'borderColor' : '#9c0006', 'margin-top' : '10px', 'height' : 'auto' }) .slideDown(); }); } else { html += 'Your profile has been successfully updated.
'; $('.uprofile_msg').slideUp(function () { $(this) .html(html) .css({ 'color' : '#006100', 'background' : '#c6efce', 'borderColor' : '#006100', 'margin-top' : '10px', 'height' : 'auto' }) .slideDown(); }); } } }); /* FORGOT PASSWORD */ $('#forgot form').iframePostForm ({ json : true, post : function () { var forgot_msg; if (!$('.forgot_msg').length) { $('#forgot_title').after(''); } if ($('#empidnum').val().length) { $('.forgot_msg') .html(' Processing…') .css({ color : '#006100', background : '#c6efce', border : '2px solid #006100', height : 'auto' }) .slideDown(); } else { $('.forgot_msg') .html('Employee ID is required.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } }, complete : function (response) { var style, width, html = ''; if (!response.success) { $('.forgot_msg').slideUp(function () { $(this) .html(response.error) .css({ 'color' : '#9c0006', 'background' : '#ffc7ce', 'borderColor' : '#9c0006', 'margin-top' : '10px', 'height' : 'auto' }) .slideDown(); }); } else { html += 'Your password has been successfully reset and sent you your email.
'; $('.forgot_msg').slideUp(function () { $(this) .html(html) .css({ 'color' : '#006100', 'background' : '#c6efce', 'borderColor' : '#006100', 'margin-top' : '10px', 'height' : 'auto' }) .slideDown(); }); } } }); /* CHANGE PASSWORD */ $('#fpass form').iframePostForm ({ json : true, post : function () { var fpass_msg; if (!$('.fpass_msg').length) { $('#fpass_title').after(''); } if ($('#opassword').val().length && $('#npassword').val().length && $('#cpassword').val().length) { $('.fpass_msg') .html(' Processing…') .css({ color : '#006100', background : '#c6efce', border : '2px solid #006100', height : 'auto' }) .slideDown(); } else { $('.fpass_msg') .html('All fields are required.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } }, complete : function (response) { var style, width, html = ''; if (!response.success) { $('.fpass_msg').slideUp(function () { $(this) .html(response.error) .css({ 'color' : '#9c0006', 'background' : '#ffc7ce', 'borderColor' : '#9c0006', 'margin-top' : '10px', 'height' : 'auto' }) .slideDown(); }); } else { html += 'Your password has been successfully changed.
'; alert('Your password has been successfully changed.'); window.location.href='https://www.marketingsalesagents.com'; /*$('.fpass_msg').slideUp(function () { $(this) .html(html) .css({ 'color' : '#006100', 'background' : '#c6efce', 'borderColor' : '#006100', 'margin-top' : '10px', 'height' : 'auto' }) .slideDown(); });*/ } } }); /* * * - Add-ons Performance Appraisal - * * */ /* PERFORMANCE APPRAISAL */ /* ^evaluate */ $('#pafevaluate form').iframePostForm ({ json : true, post : function () { var paf_msg; $('.paf_msg').html(''); if (!$('.paf_msg').length) { $('#alert').after(''); } //var btn = $(this).find("input[type=submit]:focus" ); //var btn = $("input[type=submit][clicked=true]").val(); if ($('.boxRem').val().length) { $('.paf_msg') .html(' Processing…') .css({ color : '#006100', background : '#c6efce', border : '2px solid #006100', height : 'auto' }) .slideDown(); } else { $('.paf_msg') .html('Competency Assessment Form must be filled in, kindly contact the hr if the form is unavailable.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } if ($('.boxPom').val().length) { $('.paf_msg') .html(' Processing…') .css({ color : '#006100', background : '#c6efce', border : '2px solid #006100', height : 'auto' }) .slideDown(); } else { $('.paf_msg') .html('Generated Score from HR must be available, kindly contact the hr if the Conduct and Attendance Score is unavailable.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } }, complete : function (response) { var style, width, html = ''; if (!response.success) { $('.paf_msg').slideUp(function () { $(this) .html(response.error) .css({ 'color' : '#9c0006', 'background' : '#ffc7ce', 'borderColor' : '#9c0006', 'margin-top' : '10px', 'height' : 'auto' }) .slideDown(); }); } else { if (response.type == 1) { html += 'Appraisal rating is successfully initiated.
'; $('.paf_msg').slideUp(function () { $(this) .html(html) .css({ 'color' : '#006100', 'background' : '#c6efce', 'borderColor' : '#006100', 'height' : 'auto' }) .slideDown(); }); $('.subapp').attr('disabled',true); $('.subapp').html('Submitted'); $('.subapp').hide('slow'); $('#saveapp').hide('slow'); $('#viewapp').show('fast'); } else if (response.type == 2) { html += 'Appraisal rating is successfully saved.
'; $('.paf_msg').slideUp(function () { $(this) .html(html) .css({ 'color' : '#006100', 'background' : '#c6efce', 'borderColor' : '#006100', 'height' : 'auto' }) .slideDown(); }); $('#saveapp').hide('slow'); $('.subapp').hide('slow'); $('.relapp').show('fast'); $('#saveapp').attr('disabled',true); $('#saveapp').html('Saved'); } } } }); /* ^global evaluate */ $('#pafevaluateglobal form').iframePostForm ({ json : true, post : function () { var paf_msg; $('.paf_msg').html(''); if (!$('.paf_msg').length) { $('#alert').after(''); } //var btn = $(this).find("input[type=submit]:focus" ); //var btn = $("input[type=submit][clicked=true]").val(); if ($('#globalpart3').val().length) { $('.paf_msg') .html(' Processing…') .css({ color : '#006100', background : '#c6efce', border : '2px solid #006100', height : 'auto' }) .slideDown(); } else { $('.paf_msg') .html('Work Results Form must be filled in, kindly contact the hr if the form is unavailable.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } if ($('#globalpart4').val().length) { $('.paf_msg') .html(' Processing…') .css({ color : '#006100', background : '#c6efce', border : '2px solid #006100', height : 'auto' }) .slideDown(); } else { $('.paf_msg') .html('Personal Core Competencies Form must be filled in, kindly contact the hr if the form is unavailable.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } if ($('#globalhr').val().length) { $('.paf_msg') .html(' Processing…') .css({ color : '#006100', background : '#c6efce', border : '2px solid #006100', height : 'auto' }) .slideDown(); } else { $('.paf_msg') .html('Generated Score from HR must be available, kindly contact the hr if the Conduct and Attendance Score is unavailable.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } }, complete : function (response) { var style, width, html = ''; if (!response.success) { $('.paf_msg').slideUp(function () { $(this) .html(response.error) .css({ 'color' : '#9c0006', 'background' : '#ffc7ce', 'borderColor' : '#9c0006', 'margin-top' : '10px', 'height' : 'auto' }) .slideDown(); }); } else { if (response.type == 1) { html += 'Appraisal rating is successfully initiated.
'; $('.paf_msg').slideUp(function () { $(this) .html(html) .css({ 'color' : '#006100', 'background' : '#c6efce', 'borderColor' : '#006100', 'height' : 'auto' }) .slideDown(); }); $('.subapp').attr('disabled',true); $('.subapp').html('Submitted'); $('.subapp').hide('slow'); $('#saveapp').hide('slow'); $('#viewapp').show('fast'); } else if (response.type == 2) { html += 'Appraisal rating is successfully saved.
'; $('.paf_msg').slideUp(function () { $(this) .html(html) .css({ 'color' : '#006100', 'background' : '#c6efce', 'borderColor' : '#006100', 'height' : 'auto' }) .slideDown(); }); $('#saveapp').hide('slow'); $('.subapp').hide('slow'); $('.relapp').show('fast'); $('#saveapp').attr('disabled',true); $('#saveapp').html('Saved'); } } } }); /* ^pafupdater */ $('#paf .formx').iframePostForm ({ json : true, post : function () { var pafup_msg; if (!$('.pafup_msg').length) { $('#alert').after(''); } if ($('.remarks').val().length) { $('.pafup_msg') .html(' Processing…') .css({ color : '#006100', background : '#c6efce', border : '2px solid #006100', height : 'auto' }) .slideDown(); } else { $('.pafup_msg') .html('Your comment must not be empty.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } }, complete : function (response) { var style, width, html = ''; if (!response.success) { $('.pafup_msg').slideUp(function () { $(this) .html(response.error) .css({ 'color' : '#9c0006', 'background' : '#ffc7ce', 'borderColor' : '#9c0006', 'margin-top' : '10px', 'height' : 'auto' }) .slideDown(); }); } else { html += 'You successfully sent your comment and approved the rating result.
'; $('.pafup_msg').slideUp(function () { $(this) .html(html) .css({ 'color' : '#006100', 'background' : '#c6efce', 'borderColor' : '#006100', 'height' : 'auto' }) .slideDown(); }); //$('.approveapp').attr('disabled',true); //$('.approveapp').val('Submitted'); //$('.subapp').hide('slow'); //$('#saveapp').hide('slow'); $('#approveapp').hide('slow'); $('#viewapp').show('fast'); $('#pow1').slideUp(function () { $(this) .html(html) .slideDown(); }); } } }); /* ^uploader */ $('#paf .formg').iframePostForm ({ json : true, post : function () { var pafup_msg; if (!$('.pafup_msg').length) { $('#alert').after(''); } if ($('.remarks').val().length) { $('.pafup_msg') .html(' Processing…') .css({ color : '#006100', background : '#c6efce', border : '2px solid #006100', height : 'auto' }) .slideDown(); } else { $('.pafup_msg') .html('Comment must not be empty.') .css({ color : '#9c0006', background : '#ffc7ce', border : '2px solid #9c0006', height : 'auto' }) .slideDown() .effect('shake', {times: 3, distance: 5}, 420); return false; } }, complete : function (response) { var style, width, html = ''; if (!response.success) { $('.pafup_msg').slideUp(function () { $(this) .html(response.error) .css({ 'color' : '#9c0006', 'background' : '#ffc7ce', 'borderColor' : '#9c0006', 'margin-top' : '10px', 'height' : 'auto' }) .slideDown(); }); } else { html += 'You successfully sent your comment and accept the appraisal rating result.
'; $('.pafup_msg').slideUp(function () { $(this) .html(html) .css({ 'color' : '#006100', 'background' : '#c6efce', 'borderColor' : '#006100', 'height' : 'auto' }) .slideDown(); }); $('#pow1').slideUp(function () { $(this) .html(html) .slideDown(); }); } } }); /* end of pafupdater */ });