?
Current Path : /home1/savoy/public_html/savoyglobal.net/drafthr/system/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/drafthr/system/application/views/HR/salarypayment.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?> <?php $this->load->view('header'); $this->load->view('HR/hrfunctions'); ?> <script type="text/javascript"> $(document).ready(function(){ //Display Loading Image generatesalarypayment(1); // loadsalarypayment(); }); function loadsalarypayment() { $("#salarypaymentdiv").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); $("#salarypaymentdiv").load("<?= site_url('hr/ajaxloadnew/viewsalarypayment/salarypayment') ?>"); } function addsalarypayment(rwd) { $("#ck_permission").load("<?= site_url('master/check_permissions/') ?>"+"/"+rwd,function(data) { if(data==1) { $("#salarypaymentdiv").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); $("#salarypaymentdiv").load("<?= site_url('hr/ajaxload/addsalarypayment/salarypayment') ?>"); } }); } function editsalarypayment(rwd,id) { $("#ck_permission").load("<?= site_url('master/check_permissions/') ?>"+"/"+rwd,function(data) { if(data==1) { $("#salarypaymentdiv").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); $("#salarypaymentdiv").load("<?= site_url('hr/edit/editsalarypayment/salarypayment/id/') ?>"+"/" +id); } }); } function createdir(name) { $("#createddir").load("<?= site_url('claims/createdir/') ?>" +"/" +name); loadparent(); loadtreedirectory(); } function showstaffdiv() { var mydate = document.getElementById('date').value; if (mydate == '') { alert("Please Select Date First"); return false; } else { $("#staffsdiv").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); $("#staffsdiv").load("<?= site_url('sales/ajaxload/searchstaff/staffpersonaldetails/') ?>"); $("#inliexample1").colorbox({width:"75%",height:"70%", inline:true, href:"#staffsdiv"}); } } function searchStaff(serctext,seloption,pagenum) { $('#stafflist').load("<?php echo site_url('sales/listSearchstaff/'); ?>/"+pagenum+ "/"+ seloption + "/" + serctext); } function usestaff(staffname,id) { var mydate = document.getElementById('date').value; $.ajax({ type: "POST", url: "<?= site_url('hr/checksalarymonth') ?>", data: "id="+id+"&date="+mydate, success: function(msg) { if(msg>0) { alert('Payslip already generated for this employee in this month') return false; } else { $("input#staffname").val(staffname); $("input#staffid").val(id); $("#salpay").html("<img src='<?=base_url()?>/assets/images/loading.gif'/>"); $("#salpay").load("<?= site_url('hr/ajaxloadsalpay/viewsalpay/') ?>" +"/" +id+"/"+mydate); $.fn.colorbox.close(); } } }); } function createsubdir(name,dir) { $("#createdsubdir").load("<?= site_url('claims/createsubdir/') ?>" +"/" +dir+"/" +name); loadtreedirectory(); } function loadparent() { $("#parent_div").load("<?= site_url('claims/ajaxload/loaddirectory/directory') ?>"); } function loadtreedirectory() { $("#treediv").load("<?= site_url('claims/ajaxload/loadtreedirectory/directory') ?>"); } function singlesalarypayment(rwd,id) { $("#ck_permission").load("<?= site_url('master/check_permissions/') ?>"+"/"+rwd,function(data) { if(data==1) { $("#salarypaymentdiv").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); $("#salarypaymentdiv").load("<?= site_url('hr/single/singlesalarypayment/salarypayment/id/') ?>"+"/" +id); } }); } function searchsalarypayment(search,selectsearch) { if(selectsearch=='date' ) { search=search.replace(/\//gi,'-') } $("#salarypaymentdiv").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); pagenum = 1; search = search.replace(/ /g,"~"); search = search.replace(/\//g,"_"); $("#salarypaymentdiv").load("<?= site_url('hr/ajaxloadnew/viewsalarypayment/salarypayment/') ?>"+"/"+pagenum+"/"+selectsearch+"/"+search+"/"); } function paginationsalarypaymentsearch(pageNum,search,selectsearch) { $("#salarypaymentdiv").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); $('#salarypaymentdiv').load("<?php echo site_url('hr/ajaxload/viewsalarypayment/salarypayment/'); ?>"+"/" +pageNum+"/"+selectsearch+"/"+search+"/"); } function doallthetwo() { if(validateform('staffname','date')) { converttodate('date'); } else { return false; } } function generatesalarypayment(rwd) { $("#ck_permission").load("<?= site_url('master/check_permissions/') ?>"+"/"+rwd,function(data) { if(data==1) { $("#salarypaymentdiv").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); $("#salarypaymentdiv").load("<?= site_url('hr/ajaxload/generatesalarypayment/emp_salary_slip') ?>",function(){ $('#button1').attr('disabled', 'disabled'); }); } }); } function loadsingleempsalary() { document.getElementById("singleempdiv").style.display="block"; $("#salpay").empty().html(""); document.getElementById("processbutton").style.display="none"; } function loadallempsalary() { document.getElementById("singleempdiv").style.display="none"; $("#salpay").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); $("#salpay").load("<?= site_url('hr/loadallemp/loadallemp/staffpersonaldetails') ?>"); document.getElementById("processbutton").style.display="block"; } function checksalempdetfunc() { var date=document.getElementById('date').value; if (date == '') { alert("Please Select Date First"); $('#checksalempdet').attr('checked', false); return false; } else { var length=document.getElementById('empcount').value; if($('#checksalempdet').is(':checked')) { var checkval=true; $('#button1').attr('disabled', ''); } else { var checkval=false; $('#button1').attr('disabled', 'disabled'); } for(var i=1; i <length; i++) { var empid= $("input#salempdet_"+i).val(); $.ajax({ type: "POST", url: "<?= site_url('hr/checksalarymonth') ?>", data: "id="+empid+"&date="+date, beforeSend: function(){ showPreloaderform('checkloading')}, complete: function(){ hidePreloaderform('checkloading') }, success: function(msg) { if(msg>0) { $("input#salempdet_"+i).attr('checked', false); } else if(msg =='no') { $("input#salempdet_"+i).attr('checked', false); } else { $("input#salempdet_"+i).attr('checked', checkval); } }, async: false }); } } } function checksalarymonthind(count) { if($("#salempdet_"+count).is(':checked')) { var checkval=true; $('#button1').attr('disabled', ''); } else { var checkval=false; $('#button1').attr('disabled', 'disabled'); } var date=document.getElementById('date').value; if (date == '') { alert("Please Select Date First"); $("input#salempdet_"+count).attr('checked', false); return false; } else { var empid= $("input#salempdet_"+count).val(); $.ajax({ type: "POST", url: "<?= site_url('hr/checksalarymonth') ?>", data: "id="+empid+"&date="+date, success: function(msg) { if(msg>0) { alert('Payslip already generated for this employee in this month') $("input#salempdet_"+count).attr('checked', false); } else if(msg =='no') { alert('Salary Not Set') $("input#salempdet_"+count).attr('checked', false); } else { $("input#salempdet_"+count).attr('checked', checkval); } } }); } } function viewsalaryslip(empid) { var mydate = document.getElementById('date').value; if (mydate == '') { alert("Please Select Date First"); return false; } else { $.ajax({ type: "POST", url: "<?= site_url('hr/checksalarymonth') ?>", data: "id="+empid+"&date="+mydate, success: function(msg) { if(msg>0) { alert('Payslip already generated for this employee in this month') $.fn.colorbox.close(); return false; } else if(msg =='no') { alert('Salary Not Set') $.fn.colorbox.close(); return false; } else { $("#staffsaldetdiv").empty().html('<CENTER><img src="<?=base_url()?>/assets/images/loading.gif" class="loading"/></CENTER>'); $("#staffsaldetdiv").load("<?= site_url('hr/ajaxloadsalpay/viewsalpay/') ?>" +"/" +empid+"/"+mydate); $(".slslip").colorbox({width:"75%",height:"90%", inline:true, href:"#staffsaldetdiv"}); } } }); } } function insertsinglesalarypayment() { $('#singlesalaryform').ajaxForm({ beforeSubmit: showPreloaderform('loading'), success: function(data) { alert('Salary Processed Successfully'); $.fn.colorbox.close(); hidePreloaderform('loading'); generatesalarypayment(1); } }); } function multiplesalarypayment() { $('#multiplesalaryform').ajaxForm({ beforeSubmit: showPreloaderform('loading'), success: function(data) { alert('Salary Processed Successfully'); hidePreloaderform('loading'); generatesalarypayment(1); } }); } </script> <body > <div id="main"> <?php $this->load->view('menu'); ?> <div id="middle"> <?php $this->load->view('leftbar'); ?> <div id="center-column"> <?php $this->load->view('topbar'); ?> <div class="table"> <div id="successdiv" align="center"></div> <p> </p> <div id="salarypaymentdiv"> </div> <div style='display:none'> <div id='staffsdiv' style='padding:10px; background:#fff;'> </div> </div> <div id="loading" align="center"></div> </div> </div> </div> <?php $this->load->view('footer'); ?> </div> </body> </html>