?
Current Path : /home1/savoy/public_html/savoyglobal.net/sec/application/views/hr/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/public_html/savoyglobal.net/sec/application/views/hr/hrfunctions.php |
<script type="text/javascript"> function load_employee_details(id) { $("#employee").load("<?= site_url()?>"+'/hr/load_employee_details/' +id); } function checkallcheckbox() { $('#checksalempdet').removeAttr('checked'); $('input[name^=salempdet]').each(function() { if ($(this).is(':checked')) { $('#checksalempdet').attr('checked', 'checked'); } }); if ($('#checksalempdet').is(':checked')) $('#button1').removeAttr('disabled'); else $('#button1').attr('disabled', 'disabled'); } function loadPaymentMethod(val, divid) { if (val > 1) { $('#payment_method_div').css('display', 'table-cell') $("#" + divid).empty().html('<CENTER><img src="<?= base_url() ?>assets/img/loading.gif" class="loading"/></CENTER>'); $("#" + divid).load("<?= site_url('hr/load_payment_method') ?>/" + val); } else { $("#" + divid).html(""); } } function gotopage(controller,controllerfunction,id,table,field,page,returnpage) { $("#inner_content").empty().html('<CENTER><img src="<?= base_url() ?>assets/img/loading.gif" class="loading"/></CENTER>'); $("#inner_content").load("<?= site_url() ?>/"+controller+'/'+controllerfunction+'/'+id+'/'+table+'/'+field+'/'+page+'/'+returnpage); } function suggestemployee(divid) { $("#"+divid).autocomplete("<?= site_url() ?>/master/autosuggestemployee/", { width: 250, selectFirst: false }); } function calculteAllallowancetotal(val,mode,count,emp_id){ var basicsalary=$("input#basic_salary_"+emp_id).val(); if(!basicsalary) { alert("Please set basic salary") $('input#amount_'+emp_id+'_'+count).val(''); } else { if(mode==0) { val=parseFloat(basicsalary)*parseFloat(val)*0.01; } $('input#alltotal_'+emp_id+'_'+count).val(val); var allowcount=$("input#allowcount_"+emp_id).val(); var deduction=$("input#deduction_"+emp_id).val(); var sumallow=0; for(var i=1;i<allowcount;i++) { var allowamount=$("input#alltotal_"+emp_id+i).val(); if(allowamount) sumallow+=parseFloat(allowamount); } $('input#allowance_'+emp_id).val(sumallow); var commission=$("input#commission_").val(); var grosssalary=parseFloat(sumallow)+parseFloat(basicsalary); var netsalary=parseFloat(grosssalary)-parseFloat(deduction); var payamount=parseFloat(netsalary)+parseFloat(commission); $('input#grosssalary_'+emp_id).val(grosssalary); $('input#netsalary_'+emp_id).val(netsalary); $('input#payamount_'+emp_id).val(payamount); } } function calculteallowancetotal(val,mode,count) { var basicsalary=$("input#basic_salary").val(); if(!basicsalary) { alert("Please set basic salary") $('input#amount_'+count).val(''); } else { if(mode==0) { val=parseFloat(basicsalary)*parseFloat(val)*0.01; } $('input#alltotal_'+count).val(val); var allowcount=$("input#allowcount").val(); var deduction=$("input#deduction").val(); var sumallow=0; for(var i=1;i<allowcount;i++) { var allowamount=$("input#alltotal_"+i).val(); if(allowamount) sumallow+=parseFloat(allowamount); } $('input#allowance').val(sumallow); var commission=$("input#commission").val(); var grosssalary=parseFloat(sumallow)+parseFloat(basicsalary); var netsalary=parseFloat(grosssalary)-parseFloat(deduction); var payamount=parseFloat(netsalary)+parseFloat(commission); $('input#grosssalary').val(grosssalary); $('input#netsalary').val(netsalary); $('input#payamount').val(payamount); } } function calcultedeductiontotal(val,mode,count) { var basicsalary=$("input#basic_salary").val(); if(!basicsalary) { alert("Please set basic salary"); $("input#amount_"+count).val(''); } else { if(mode==0) { val=parseFloat(basicsalary)*parseFloat(val)*0.01; } $("input#dedtotal_"+count).val(val); var dedcount=$("input#dedcount").val(); var allowance=$("input#allowance").val(); var sumded=0; for(var i=1;i<dedcount;i++) { var dedamount=$("input#dedtotal_"+i).val(); if(dedamount) sumded+=parseFloat(dedamount); } $('input#deduction').val(sumded); var commission=$("input#commission").val(); var grosssalary=parseFloat(allowance)+parseFloat(basicsalary); var netsalary=parseFloat(grosssalary)-parseFloat(sumded); var payamount=parseFloat(netsalary)+parseFloat(commission); $('input#grosssalary').val(grosssalary); $('input#netsalary').val(netsalary); $('input#payamount').val(payamount); } } function calculteAlldeductiontotal(val,mode,count,emp_id) { var basicsalary=$("input#basic_salary_"+emp_id).val(); if(!basicsalary) { alert("Please set basic salary"); $("input#amount_"+emp_id+'_'+count).val(''); } else { if(mode==0) { val=parseFloat(basicsalary)*parseFloat(val)*0.01; } $("input#dedtotal_"+emp_id+"_"+count).val(val); var dedcount=$("input#dedcount_"+emp_id).val(); var allowance=$("input#allowance_"+emp_id).val(); var sumded=0; for(var i=1;i<dedcount;i++) { var dedamount=$("input#dedtotal_"+emp_id+"_"+i).val(); if(dedamount) sumded+=parseFloat(dedamount); } $('input#deduction_'+emp_id).val(sumded); var commission=$("input#commission_"+emp_id).val(); var grosssalary=parseFloat(allowance)+parseFloat(basicsalary); var netsalary=parseFloat(grosssalary)-parseFloat(sumded); var payamount=parseFloat(netsalary)+parseFloat(commission); $('input#grosssalary_'+emp_id).val(grosssalary); $('input#netsalary_'+emp_id).val(netsalary); $('input#payamount_'+emp_id).val(payamount); } } function changebasicsalary(val) { var allowance=$("input#allowance").val(); var deduction=$("input#deduction").val(); var grosssalary=parseFloat(allowance)+parseFloat(val); var netsalary=parseFloat(grosssalary)-parseFloat(deduction); $('input#grosssalary').val(grosssalary); $('input#netsalary').val(netsalary); } function calculateAllpayamount(commission_amount,emp_id) { var netsalary=$("input#netsalary_"+emp_id).val(); var payamount=parseFloat(netsalary)+parseFloat(commission_amount); $('input#payamount_'+emp_id).val(payamount); } function calculatepayamount(commission_amount) { var netsalary=$("input#netsalary").val(); var payamount=parseFloat(netsalary)+parseFloat(commission_amount); $('input#payamount').val(payamount); } function leave_approval(id) { $.fallr('show', { buttons : { button1 : {text: 'Approve', danger: false, onclick: function() { $.fallr('hide'); change_leave_status('Approved',id); }}, button2 : {text: 'Reject', danger: true, onclick: function(){ $.fallr('hide'); change_leave_status('Reject',id); }}, button3 : {text: 'Cancel', onclick: function(){$.fallr('hide')}} }, content : '<p>Are you sure you want to Approve ?</p>', icon : 'Confirm-like' }); } </script>