Server IP : 108.163.255.210 / Your IP : 3.15.186.27 Web Server : Apache System : Linux blossom.urlnameserver.com 3.10.0-1160.80.1.el7.x86_64 #1 SMP Tue Nov 8 15:48:59 UTC 2022 x86_64 User : ( 1172) PHP Version : 7.2.34 Disable Function : eval,escapeshellarg,proc_close,proc_get_status,proc_nice,proc_open,symlink,system,pcntl_exec,getrusage,chown,chgp,closelog,openlog,syslog,define_syslog_variables,php_ini_loaded_file,getservbyname,getservbyport,posix_getgid,posix_getgrgid,proc_terminate,pfsockopen,apache_child_terminate,posix_mkfifo,posix_setpgid,posix_setuid,hypot,pg_host,pos,posix_access,posix_getcwd,posix_getservbyname,myshellexec,getpid,posix_getsid,posix_isatty,posix_kill,posix_mknod,posix_setgid,posix_setsid,posix_setuid,posix_times,posix_uname,ps_fill,posix_getpwuid,global,ini_restore,zip_open,zip_read,rar_open,bzopen,bzread,bzwrite,apache_get_modules,apache_get_version,phpversionphpinfo,php_ini_scanned_files,get_current_user,disk_total_space,diskfreespace,leak,imap_list,hypo,filedump,safe_mode,getmygid,apache_getenv,apache_setenv,bzread,bzwrite,bzopen,phpini,higlight_file,dos_conv,get_cwd,er_log,cmd,e_name,vdir,get_dir,only_read,ftok,ftpexec,posix_getpwnam,mysql_list_dbs,disk_free_space,session_save_path,confirm_phpdoc_compiled,zip_entry_rea,php_u,psockopen,crack_opendict,crack_getlastmessage,crack_closedict,crack_check,fpassthru,posix_get_last_error,posix_getlogin,posix_getgroups,posix_strerror,posix_getrlimit,posix_getpgrp,posix_getgrnam,pos,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/unilinki/public_html/payroll/admin/ |
Upload File : |
<?php session_start(); //check if user is login or not. If the user is not login redirect it to login.php if(!isset($_SESSION["adminuser"]) || $_SESSION["adminuser"]=="") { header("Location:login.php"); exit; } if ($_SESSION['role_id']=="5"){ echo "<script>window.location='../index.php' </script>"; exit(); } //require database connection file and it's supporting file. require_once("../include/db.php"); $obj=new query_execution(); $uid=md5(uniqid(rand())); $sysdate=date("d/m/Y"); if(isset($_POST['submitsal'])){ $empid=$_POST['empid']; foreach ($empid as $i=>$meet_details) { $cc="select * from `attendance` where `id`='".$_POST['empid'][$i]."' && `company`='".$_POST['co'][$i]."' && `date1`='".$da."'"; $check=mysql_query($cc); $check1=mysql_num_rows($check); if($check1>0) { $s="UPDATE `attendance` SET `wd`='".$_POST['wd'][$i]."',`wo`='".$_POST['wo'][$i]."',`wp`='".$_POST['wp'][$i]."',`pd`='".$_POST['pd'][$i]."',`ot`='".$_POST['ot'][$i]."', `gbpay`='".$_POST['gbpay'][$i]."',`hra`='".$_POST['hra'][$i]."',`da`='".$_POST['daa'][$i]."',`conv`='".$_POST['conv'][$i]."',`splallow`='".$_POST['splallow'][$i]."', `washallow`='".$_POST['washallow'][$i]."',`total`='".$_POST['total'][$i]."',`gbpay1`='".$_POST['gbpay1'][$i]."',`hra1`='".$_POST['hra1'][$i]."', `da1`='".$_POST['daa1'][$i]."', `conv1`='".$_POST['conv1'][$i]."',`splallow1`='".$_POST['splallow1'][$i]."',`washallow1`='".$_POST['washallow1'][$i]."', `overtime`='".$_POST['overtime'][$i]."',`total1`='".$_POST['total1'][$i]."',`gbpay2`='".$_POST['gbpay2'][$i]."',`hra2`='".$_POST['hra2'][$i]."', `da2`='".$_POST['daa2'][$i]."', `conv2`='".$_POST['conv2'][$i]."',`total2`='".$_POST['total2'][$i]."',`epf`='".$_POST['epf'][$i]."',`esi`='".$_POST['esi'][$i]."', `lwf`='".$_POST['lwf'][$i]."',`canteen`='".$_POST['canteen'][$i]."',`total3`='".$_POST['total3'][$i]."',`net`='".$_POST['net'][$i]."', `employer_pf`='".$_POST['employer_pf'][$i]."',`employer_esi`='".$_POST['employer_esi'][$i]."',`ctc`='".$_POST['ctc1'][$i]."' WHERE id='".$_POST['empid'][$i]."' && company='".$_POST['co'][$i]."' && date1='".$da."'"; $sql=mysql_query($s); //cl pl and adjestment insert if(isset($_POST['clcheck'][$i])){ $insertcl="insert into leave_management (`uid`,`type`,`number`,`month`) values('".$_POST['empid'][$i]."','cl','".$_POST['clnet'][$i]."','".$da."')"; $ic=mysql_query($insertcl); }else{ $insertcl="insert into leave_management (`uid`,`type`,`number`,`month`) values('".$_POST['empid'][$i]."','cl','0','".$da."')"; $ic=mysql_query($insertcl); } if(isset($_POST['plcheck'][$i])){ $insertpl="insert into leave_management (`uid`,`type`,`number`,`month`) values('".$_POST['empid'][$i]."','pl','".$_POST['plnet'][$i]."','".$da."')"; $ip=mysql_query($insertpl); }else{ $insertpl="insert into leave_management (`uid`,`type`,`number`,`month`) values('".$_POST['empid'][$i]."','pl','0','".$da."')"; $ip=mysql_query($insertpl); } if(isset($_POST['adcheck'][$i])){ $insertad="insert into leave_management (`uid`,`type`,`number`,`month`) values('".$_POST['empid'][$i]."','ad','".$_POST['adnet'][$i]."','".$da."')"; $iad=mysql_query($insertad); }else{ $insertad="insert into leave_management (`uid`,`type`,`number`,`month`) values('".$_POST['empid'][$i]."','ad','0','".$da."')"; $iad=mysql_query($insertad); } //cl pl and adjestment insert }else{ if($_POST['overtime'][$i]=='0'){ $sysdate1=''; }else{ $sysdate1=date("d/m/Y"); } $s="INSERT INTO `attendance` (`id`,`company`,`date1`,`date2`,`wd`,`wo`,`wp`,`pd`,`ot`,`gbpay`,`hra`,`da`,`conv`,`splallow`,`washallow`,`gbpay1`,`hra1`,`da1`,`conv1`,`splallow1`, `washallow1`,`total`,`overtime`,`overtime_date`, `total1`, `gbpay2`, `hra2`,`da2`, `conv2`, `total2`, `epf`, `esi`, `lwf`, `canteen`, `total3`, `net`, `employer_pf`,`employer_esi`,`ctc`) VALUES ( '".$_POST['empid'][$i]."','".$_POST['co'][$i]."','".$da."','".$sysdate."','".$_POST['wd'][$i]."','".$_POST['wo'][$i]."','".$_POST['wp'][$i]."', '".$_POST['pd'][$i]."','".$_POST['ot'][$i]."','".$_POST['gbpay'][$i]."','".$_POST['hra'][$i]."','".$_POST['daa'][$i]."','".$_POST['conv'][$i]."', '".$_POST['splallow'][$i]."','".$_POST['washallow'][$i]."','".$_POST['gbpay1'][$i]."','".$_POST['hra1'][$i]."','".$_POST['daa1'][$i]."', '".$_POST['conv1'][$i]."','".$_POST['splallow1'][$i]."','".$_POST['washallow1'][$i]."','".$_POST['total'][$i]."', '".$_POST['overtime'][$i]."','".$sysdate1."','".$_POST['total1'][$i]."','".$_POST['gbpay2'][$i]."','".$_POST['hra2'][$i]."', '".$_POST['daa2'][$i]."', '".$_POST['conv2'][$i]."','".$_POST['total2'][$i]."','".$_POST['epf'][$i]."','".$_POST['esi'][$i]."','".$_POST['lwf'][$i]."', '".$_POST['canteen'][$i]."','".$_POST['total3'][$i]."','".$_POST['net'][$i]."','".$_POST['employer_pf'][$i]."', '".$_POST['employer_esi'][$i]."','".$_POST['ctc1'][$i]."')"; $sql=mysql_query($s) or die(mysql_error()); //cl pl and adjestment insert if(isset($_POST['clcheck'][$i]) ){ $insertcl="insert into leave_management (`uid`,`type`,`number`,`month`) values('".$_POST['empid'][$i]."','cl','".$_POST['clnet'][$i]."','".$da."')"; $ic=mysql_query($insertcl); } /*else{ $insertcl="insert into leave_management (`uid`,`type`,`number`,`month`) values('".$_POST['empid'][$i]."','cl','0','".$da."')"; $ic=mysql_query($insertcl); }*/ if(isset($_POST['plcheck'][$i]) ){ $insertpl="insert into leave_management (`uid`,`type`,`number`,`month`) values('".$_POST['empid'][$i]."','pl','".$_POST['plnet'][$i]."','".$da."')"; $ip=mysql_query($insertpl); } /*else{ $insertpl="insert into leave_management (`uid`,`type`,`number`,`month`) values('".$_POST['empid'][$i]."','pl','0','".$da."')"; $ip=mysql_query($insertpl); }*/ if(isset($_POST['adcheck'][$i]) ){ $insertad="insert into leave_management (`uid`,`type`,`number`,`month`) values('".$_POST['empid'][$i]."','ad','".$_POST['adnet'][$i]."','".$da."')"; $iad=mysql_query($insertad); } /*else{ $insertad="insert into leave_management (`uid`,`type`,`number`,`month`) values('".$_POST['empid'][$i]."','ad','0','".$da."')"; $iad=mysql_query($insertad); }*/ //cl pl and adjestment insert } } } $var=$_GET['var']; if($var==NULL){ $option="<option value='' disabled selected>Select Branch</option>"; }else{ $option="<option value='$var' selected>$var</option>"; } require_once("header.php"); ?> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css"> <script language="javascript" type="text/javascript"> function getval(sel){ var url = sel.value; var url1="generate_salery.php?var="; // get selected value if (url) { // require a URL window.location =url1+ url; // redirect } return false; } function x(){ } function round(x, digits){ return parseFloat(x.toFixed(digits)) } </script> <script type="text/javascript" language="javascript"> // When the document is ready $(document).ready(function (){ $('#startDate').datepicker({ format: "mm/yyyy", viewMode: "months", minViewMode: "months" }); }); </script> <style> .modal-body .row .col-md-4 { margin-bottom: 10px; text-align: center; } </style> <!----header ends--> <!-- Left side column. contains the logo and sidebar --> <?php require_once("left.php"); ?> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <h1>Generate salary</h1> <ol class="breadcrumb"> <li><a href="dashboard.php"><i class="fa fa-dashboard"></i> Home</a></li> <li class="active">Generate salary</li> </ol> </section> <?PHP $count1=$_GET['count1']; $count2=$_GET['count2']; ?> <!-- Main content --> <section class="content"> <div class="row"> <div class="col-xs-12"> <div class="box"> <div class="box-header"> <h3 class="box-title">Generate Salary </h3> </div><!-- /.box-header --> <div class="box-body"> <form name="" action="generate_salery.php?count1=<?php echo $count1; ?>&count2=<?php echo $count2; ?>" method="post"> <table class="table table-bordered table-hover"> <tr> <td> <?php if($_SESSION['branch']!=""){?> <input type="hidden" name="company1" value="<?php echo $_SESSION['branch'] ?>" > <?php } else {?> <select name="company1" required class="form-control"> <?php echo $option ; $sql=mysql_query("select * from companies"); while($f=mysql_fetch_array($sql)){ $compname=$f['name']; ?> <option value="<?php echo $compname ?>" <?php if($compname==$_REQUEST['company1']){?> selected <?php } ?>><?php echo $compname ?></option> <?php } ?> </select> <?php } ?> </td> <td> <select name="arrear" required class="form-control"> <option value="1">Normal</option> <option value="2">Arrears wise</option> </select> </td> <td> <input type="text" class="form-control" name="search_name" placeholder="Filter By Name"> </td> <td><input type="text" name="datee" required id="startDate" placeholder="Select Month" class="form-control" value="<?php echo $_REQUEST['datee'] ?>" /></td> <td><input type="submit" name="submit" value="Check Details" class="btn btn-info pull-left" /></td> </tr> </table> </form> <?php if(isset($_POST['submit'])){?> <form name="frm_del" action="generate_salery.php?count1=<?php echo $count1; ?>&count2=<?php echo $count2+$count1; ?>" method="post" > <?php $da=$_POST['datee']; $da1=explode("/",$_POST['datee']); $cret_dt=$da1[1]."-".$da1[0]."-01"; $cret_dt1="01/".$da; $com=$_POST['company1']; if($_POST['search_name']!="") { $search_query="&& name='".$_POST['search_name']."'"; } ?> <input type="hidden" name="datee" value="<?php echo $da; ?>" > <input type="hidden" name="company1" value="<?php echo $com; ?>" > <input type="hidden" name="search_name" value="<?php echo $_POST['search_name']; ?>" > <input type="hidden" name="arrear" value="<?php echo $_POST['arrear']; ?>" > <input type ="hidden" name="submit" value="submit"> <?php $fetch=mysql_query("select * from employee where company='$com' $search_query && status='yes' limit $count1 offset $count2"); $num_fetch1=mysql_num_rows($fetch); if($num_fetch1==0) { echo "<script>window.location='generate_salery.php?count1=5&count2=0'</script>"; } while($fe=mysql_fetch_array($fetch)){ $sno=$fe['sno']; $name=$fe['name']; $id=$fe['id']; $fname=$fe['fname']; $pf=$fe['pf']; $esi=$fe['esi']; $pca=$fe['pca']; $doj=$fe['d_o_J']; $emp_code=$fe['emp_id']; $area=$fe['area']; $daa=$fe['da']; //calculating difference of months //echo "select * from `cl-pl_data` where `pf`='".$id."'"; $myselect=mysql_query("select * from `cl-pl_data` where `pf`='".$id."'"); $ms=mysql_fetch_array($myselect); $cl_pl_data_aug1="06/2017"; $cl_pl_data_aug="2017-06-01"; /*echo $ts1 = strtotime($cl_pl_data_aug); echo $ts2 = strtotime($da); $year1 = date('Y', $ts1); $year2 = date('Y', $ts2); if($year2==$year1){ $cl_month=date('m', $ts1); }else{ $cl_month=0; } $month1 = date('m', $ts1); $month2 = date('m', $ts2); $diff_month_cl = ($month2 - $cl_month); $diff_month = (($year2 - $year1) * 12) + ($month2 - $month1);*/ $date_var="01/".$da; $date_new = str_replace('/', '-', $date_var); $con_date=strtotime($date_new); $startTimeStamp = strtotime($cl_pl_data_aug); $endTimeStamp = $con_date; $timeDiff = abs($endTimeStamp - $startTimeStamp); $numberDays = $timeDiff/86400; // 86400 seconds in one day // and you might want to convert to integer $numberDays = intval($numberDays); $tot_cl_days =round($numberDays/30); $tot_pf_days =round($numberDays/24); $check_taken_cl=mysql_query("select * from leave_management where uid='$id' && type='cl' && month between '$cl_pl_data_aug1' and '$da'"); while($cl_num1=mysql_fetch_array($check_taken_cl)){ $cl_num=$cl_num1['number']+$cl_num; } // echo $cl_num; $check_taken_pl=mysql_query("select * from leave_management where uid='$id' && type='pl' && month between '$cl_pl_data_aug1' and '$da'"); while($pl_num1=mysql_fetch_array($check_taken_pl)){ $pl_num=$pl_num1['number']+$pl_num; } //calculating difference of months $coo=$fe['company']; $b_salary=$fe['b_salary']; $ne="select * from `attendance` where id='$id' && company='$com' && date1='$da'"; $next=mysql_query($ne); $totrecord=mysql_num_rows($next); $num_of_days=cal_days_in_month($cret_dt1,$month2,$year2); if($totrecord==0){ $wd5=$num_of_days; $wo5=0; $wp5=0; $pd5=0; $ot5=0; $gbpay5=0; $hra5=0; $conv5=0; $splallow5=0; $washallow5=0; $total5=0; $gbpay15=0; $hra15=0; $conv15=0; $splallow15=0; $washallow15=0; $overtime5=0; $total15=0; $gbpay25=0; $hra25=0; $conv25=0; $total25=0; $epf5=0; $esi5=0; $lwf5=0; $canteen5=0; $total35=0; $net5=0; $pd5=0; $employer_pf=0; $employer_esi=0; $ctc=0; $daa15=0; }else{ $n=mysql_fetch_array($next); $id5=$n['id']; $date5=$n['date1']; $wd5=$n['wd']; $wo5=$n['wo']; $wp5=$n['wp']; $pd5=$n['pd']; $ot5=$n['ot']; $gbpay5=$n['gbpay']; $hra5=$n['hra']; $conv5=$n['conv']; $splallow5=$n['splallow']; $washallow5=$n['washallow']; $total5=$n['total']; $gbpay15=$n['gbpay1']; $hra15=$n['hra1']; $conv15=$n['conv1']; $splallow15=$n['splallow1']; $washallow15=$n['washallow1']; $overtime5=$n['overtime']; $total15=$n['total1']; $gbpay25=$n['gbpay2']; $hra25=$n['hra2']; $conv25=$n['conv2']; $total25=$n['total2']; $epf5=$n['epf']; $esi5=$n['esi']; $lwf5=$n['lwf']; $canteen5=$n['canteen']; $total35=$n['total3']; $net5=$n['net']; $pd5=$n['pd']; $employer_pf=$n['employer_pf']; $employer_esi=$n['employer_esi']; $ctc=$n['ctc']; $daa15=$n['da']; } $past=mysql_query("select * from companies where name='$com'"); $p=mysql_fetch_array($past); $over=$p['over_time']; $checking_adjst=mysql_query("select * from leave_management where uid='$id5' && month='$da'"); $ca=mysql_fetch_array($checking_adjst); $tca=$ca['number']+$tca; if($tca>0){ $class="block"; }else{ $class="none"; } /*$tcl=mysql_query("select * from leave_management where uid='$id5' && month='$da' && type='cl'"); while($tcl1=mysql_fetch_array($tcl)) { $tcl2=$tcl1['number']+$tcl2;} $tpl=mysql_query("select * from leave_management where uid='$id5' && month='$da' && type='pl'"); while($tpl1=mysql_fetch_array($tpl)) { $tpl2=$tpl1['number']+$tpl2;} $tad=mysql_query("select * from leave_management where uid='$id5' && month='$da' && type='ad'"); while($tad1=mysql_fetch_array($tad)) { $tad2=$tcl1['number']+$tad2;}*/ ?> <table id="example1" class="table table-bordered table-hover"> <thead> <tr> <th>Employee Particulars </th> <th colspan="2"><--Days--></th> <th>Earnings</th> <th>Rate of Wages</th> <th>Amount Payable</th> <?php if($_POST['arrear']=="2"){?> <th >Arrears</th> <?php } ?> <th>Deductions</th> <th>Amount</th> <th>Net Pay</th> </tr> </thead> <tbody> <tr> <td> <label>Sno : <?php echo $sno ?></label> <label>Emp.Cd. : <?php echo $emp_code; ?></label><br/> <label>Name : <?php echo $name ?></label><br/> <label>F/H : <?php echo $fname ?></label><br/> <label>Pf No. : <?php echo $pf ?></label><br/> <label>Esi : <?php echo $esi ?></label><br/> <label>Area : <?php echo $area; ?></label><br/> <label>DOJ : <?php echo $doj ?></label><br/> <label style="background-color:green;color:white; text-align:center;display:<?php echo $class ?>;" id="label<?php echo $sno; ?>"> Adjestment Applied: CL(<span id="cl1<?php echo $sno ?>"><?php echo $tcl2 ?></span>),PL(<span id="pl1<?php echo $sno ?>"> <?php echo $tpl2?></span>),AD(<span id="ad1<?php echo $sno ?>"><?php echo $tad2?></span>)</label><br/> </td> <td> <label class="col-sm-2 control-label labelht">WD</label><br/> <label class="col-sm-2 control-label labelht">WO</label><br/><br><br><br> <label class="col-sm-2 control-label labelht">PD</label><br/> <label class="col-sm-2 control-label labelht">WP</label><br/> <label class="col-sm-2 control-label labelht" style='display:none;'>OT</label><br/> </td> <td> <input type="hidden" name="empid[]" value="<?php echo $id ?>" /> <input type="hidden" name="co[]" value="<?php echo $com ?>" /> <input type="hidden" name="da" value="<?php echo $da ?>" /> <label><input type="text" name="wd[]" id="wd<?php echo $sno ?>" value="<? $date_val=(explode("/",$_REQUEST['datee'])) ;echo date("t",mktime(0,0,0,$date_val[0],1,$date_val[1]));?>" class="form-control" /></label><br/> <label><input type="text" name="wo[]" id="wof<?php echo $sno ?>" value="<?php echo $wo5 ?>" class="form-control" onkeyup="checkval<?php echo $sno ?>();document.getElementById('wp<?php echo $sno ?>').value=document.getElementById('wd<?php echo $sno ?>').value-document.getElementById('wof<?php echo $sno ?>').value;pdays<?php echo $sno ?>();grsal<?php echo $sno ?>();grhra<?php echo $sno ?>();totalbasic<?php echo $sno ?>();checkleave<?php echo $sno ?>();total_salary<?php echo $sno ?>();epf_emppf<?php echo $sno ?>();esi_empesi<?php echo $sno ?>();total_deduction<?php echo $sno ?>();total_netsal<?php echo $sno ?>(); " /> <!---popup for leave adjustment -----> <?php if($tca==0){?> <a data-toggle="modal" data-target="#myModal<?php echo $sno ?>" style="cursor:pointer;">Adjust Leave</a><?php } ?> <!-- Modal --> <div class="modal fade" id="myModal<?php echo $sno ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title" id="myModalLabel">Leave Adjustment for <?php echo $name ?></h4> </div> <div class="modal-body"> <div class="row"> <div class="col-md-4"> <label for="exampleInputName2">Total CL (<?php echo (($tot_cl_days+$ms['cl'])-$cl_num); ?>)</label> </div> <div class="col-md-4"> <input type="text" class="form-control" name="clnet[]" value="0" disabled id="myText<?php echo $sno ?>"> </div> <div class="col-md-4"> <input type="checkbox" name="clcheck[]" onchange="valueChanged<?php echo $sno ?>()" id="clcheck<?php echo $sno ?>" value="option1" > </div> </div> <div class="row"> <div class="col-md-4"> <label for="exampleInputName2">Total PL (<?php echo ($tot_pf_days-$pl_num+$ms['pl']); ?>)</label> </div> <div class="col-md-4"> <input type="text" name="plnet[]" class="form-control" value="0" disabled id="myText12<?php echo $sno ?>"> </div> <div class="col-md-4"> <input type="checkbox" name="plcheck[]" onchange="valueChanged<?php echo $sno ?>()" id="plcheck<?php echo $sno ?>" value="option1"> </div> </div> <div class="row"> <div class="col-md-4"> <label for="exampleInputName2">ADJUST</label> </div> <div class="col-md-4"> <input type="text" name="adnet[]" class="form-control" value="0" disabled id="myText23<?php echo $sno ?>"> </div> <div class="col-md-4"> <input type="checkbox" name="adcheck[]" onchange="valueChanged<?php echo $sno ?>()" id="adcheck<?php echo $sno ?>" value="option1" > </div> </div> </div> <div class="modal-footer"> <button type="button" id="skip<?php echo $sno ?>" class="btn btn-primary" data-dismiss="modal" aria-label="Skip" onclick="remove_leave<?php echo $sno ?>();">Skip</button> <button type="button" id="button<?php echo $sno ?>" onclick="paid_days<?php echo $sno ?>();grs<?php echo $sno ?>();total_salary<?php echo $sno ?>();epf_emppf<?php echo $sno ?>();esi_empesi<?php echo $sno ?>();total_deduction<?php echo $sno ?>();total_netsal<?php echo $sno ?>();myFunction<?php echo $sno ?>(); " class="btn btn-primary" data-dismiss="modal" style="display:none;">Apply</button> </div> </div> </div> </div> <script language="javascript" > function myFunction<?php echo $sno ?>() { if(($('#clcheck<?php echo $sno ?>').is(":checked")) && ($('#plcheck<?php echo $sno ?>').is(":checked")) && ($('#adcheck<?php echo $sno ?>').is(":checked"))) { document.getElementById("cl1<?php echo $sno ?>").innerHTML=document.getElementById("myText<?php echo $sno ?>").value; document.getElementById("pl1<?php echo $sno ?>").innerHTML=document.getElementById("myText12<?php echo $sno ?>").value; document.getElementById("ad1<?php echo $sno ?>").innerHTML=document.getElementById("myText23<?php echo $sno ?>").value; }else if(($('#clcheck<?php echo $sno ?>').is(":checked")) && ($('#plcheck<?php echo $sno ?>').is(":checked")) ) { document.getElementById("cl1<?php echo $sno ?>").innerHTML=document.getElementById("myText<?php echo $sno ?>").value; document.getElementById("pl1<?php echo $sno ?>").innerHTML=document.getElementById("myText12<?php echo $sno ?>").value; document.getElementById("ad1<?php echo $sno ?>").innerHTML=0; }else if(($('#clcheck<?php echo $sno ?>').is(":checked")) && ($('#adcheck<?php echo $sno ?>').is(":checked"))) { document.getElementById("cl1<?php echo $sno ?>").innerHTML=document.getElementById("myText<?php echo $sno ?>").value; document.getElementById("pl1<?php echo $sno ?>").innerHTML=0; document.getElementById("ad1<?php echo $sno ?>").innerHTML=document.getElementById("myText23<?php echo $sno ?>").value; }else if(($('#clcheck<?php echo $sno ?>').is(":checked"))) { document.getElementById("cl1<?php echo $sno ?>").innerHTML=document.getElementById("myText<?php echo $sno ?>").value; document.getElementById("pl1<?php echo $sno ?>").innerHTML=0; document.getElementById("ad1<?php echo $sno ?>").innerHTML=0; }else if(($('#plcheck<?php echo $sno ?>').is(":checked")) && ($('#adcheck<?php echo $sno ?>').is(":checked"))) { document.getElementById("cl1<?php echo $sno ?>").innerHTML=0; document.getElementById("pl1<?php echo $sno ?>").innerHTML=document.getElementById("myText12<?php echo $sno ?>").value; document.getElementById("ad1<?php echo $sno ?>").innerHTML=document.getElementById("myText23<?php echo $sno ?>").value; }else if(($('#plcheck<?php echo $sno ?>').is(":checked")) ) { document.getElementById("cl1<?php echo $sno ?>").innerHTML=0; document.getElementById("pl1<?php echo $sno ?>").innerHTML=document.getElementById("myText12<?php echo $sno ?>").value; document.getElementById("ad1<?php echo $sno ?>").innerHTML=0; }else if(($('#adcheck<?php echo $sno ?>').is(":checked"))) { document.getElementById("cl1<?php echo $sno ?>").innerHTML=0; document.getElementById("pl1<?php echo $sno ?>").innerHTML=0; document.getElementById("ad1<?php echo $sno ?>").innerHTML=document.getElementById("myText23<?php echo $sno ?>").value; } document.getElementById("label<?php echo $sno ?>").style.display = "block"; } function checkleave<?php echo $sno ?>(){ var lv=document.getElementById("wof<?php echo $sno ?>").value; if(lv!='' & lv!='0') { var cl_total=<?php echo ($diff_month_cl-$cl_num) ?>; var cl= Math.abs(cl_total-lv); var pl_total=<?php echo ($diff_month-$pl_num) ?>; var ad= Math.abs(pl_total-cl); if(lv<=cl_total){ var cl_net=lv; var cl=0; var ad=0; var pl=0; }else if(lv>cl_total){ var cl_net=cl_total; varpl_cal=(lv-cl_total); if(varpl_cal>pl_total){ var cl=pl_total; var ad_cal=(varpl_cal-pl_total); var ad=ad_cal; }else{ var ad=0; var cl=varpl_cal; } } else if(pl_total<= cl) { var cl_net=cl_total; var cl=pl_total; var ad=ad; } else{ var cl_net=0; var cl=0; var ad=0; } document.getElementById("myText<?php echo $sno ?>").value=cl_net; document.getElementById("myText12<?php echo $sno ?>").value=cl; document.getElementById("myText23<?php echo $sno ?>").value=ad; } } function remove_leave<?php echo $sno ?>() { document.getElementById("label<?php echo $sno ?>").style.display = "none"; } function valueChanged<?php echo $sno?>() { if($('#clcheck<?php echo $sno ?>').is(":checked")){ $("#button<?php echo $sno ?>").show(); document.getElementById("myText<?php echo $sno ?>").disabled=false; }else{ document.getElementById("myText<?php echo $sno ?>").disabled=true; } if ($('#plcheck<?php echo $sno ?>').is(":checked")) { $("#button<?php echo $sno ?>").show(); document.getElementById("myText12<?php echo $sno ?>").disabled=false; }else{ document.getElementById("myText12<?php echo $sno ?>").disabled=true; } if ($('#adcheck<?php echo $sno ?>').is(":checked")){ $("#button<?php echo $sno ?>").show(); document.getElementById("myText23<?php echo $sno ?>").disabled=false; }else{ document.getElementById("myText23<?php echo $sno ?>").disabled=true; } } </script> <!---popup for leave adjustment -----> </label><br/> <label><input type="text" name="pd[]" readonly id="pd<?php echo $sno ?>" value="<?php echo $pd5 ?>" class="form-control"/></label><br/> <label><input type="text" name="wp[]" readonly id="wp<?php echo $sno ?>" value="<?php echo $wp5 ?>" class="form-control"/></label><br/> <label style="display:none;"><input type="text" name="ot[]" id="ot<?php echo $sno ?>" value="<?php echo $ot5; ?>" class="form-control" onkeyup="b<?php echo $sno ?>(); total_salary<?php echo $sno ?>();esi_empesi<?php echo $sno ?>();total_deduction<?php echo $sno ?>();total_netsal<?php echo $sno ?>();" /></label><br/> </td> <td> <label class="labelht">Basic Pay</label><br/> <label class="labelht">HRA</label><br/> <label class="labelht">Conveyance</label><br/> <label class="labelht">Spl Allow</label><br/> <label class="labelht">Wash Allow</label><br/> <label class="labelht">DA</label><br/> <label class="labelht" style="display:none;">Over Time</label><br/> </td> <td align="center" valign="middle"> <label><input type="text" name="gbpay[]" readonly id="gbpay<?php echo $sno ?>" value="<?php echo $b_salary ?>" class="form-control" /></label><br/> <label><input type="text" name="hra[]" id="hra<?php echo $sno ?>" value="<?php echo $fe['hra']; ?>" class="form-control" readonly onkeyup="document.getElementById('hra1<?php echo $sno ?>').value=this.value;totalbasic<?php echo $sno ?>();total_salary<?php echo $sno ?>();esi_empesi<?php echo $sno ?>();total_deduction<?php echo $sno ?>();total_netsal<?php echo $sno ?>();ctc<?php echo $sno ?>();"/></label><br/> <label><input type="text" name="conv[]" id="conv<?php echo $sno ?>" value="<?php echo $fe['conv']; ?>" class="form-control" readonly onkeyup="document.getElementById('conv1<?php echo $sno ?>').value=this.value;totalbasic<?php echo $sno ?>();total_salary<?php echo $sno ?>();esi_empesi<?php echo $sno ?>();total_deduction<?php echo $sno ?>();total_netsal<?php echo $sno ?>();ctc<?php echo $sno ?>();"/></label><br/> <label><input type="text" name="splallow[]" id="splallow<?php echo $sno ?>" value="<?php echo $fe['sallow'] ; ?>" readonly class="form-control" onkeyup="document.getElementById('splallow1<?php echo $sno ?>').value=this.value;totalbasic<?php echo $sno ?>();total_salary<?php echo $sno ?>();esi_empesi<?php echo $sno ?>();total_deduction<?php echo $sno ?>();total_netsal<?php echo $sno ?>();ctc<?php echo $sno ?>();" /></label><br/> <label><input type="text" name="washallow[]" id="washallow<?php echo $sno ?>" value="<?php echo $fe['wash']; ?>" readonly class="form-control" onkeyup="document.getElementById('washallow1<?php echo $sno ?>').value=this.value;totalbasic<?php echo $sno ?>();total_salary<?php echo $sno ?>();esi_empesi<?php echo $sno ?>();total_deduction<?php echo $sno ?>();total_netsal<?php echo $sno ?>();ctc<?php echo $sno ?>();" /></label><br/> <label><input type="text" name="daa[]" id="daa<?php echo $sno ?>" value="<?php echo $daa; ?>" readonly class="form-control" onkeyup="document.getElementById('daa1<?php echo $sno ?>').value=this.value;totalbasic<?php echo $sno ?>();total_salary<?php echo $sno ?>();esi_empesi<?php echo $sno ?>();total_deduction<?php echo $sno ?>();total_netsal<?php echo $sno ?>();ctc<?php echo $sno ?>();" /></label><br/> <label>Reimbursement</label> </td> <td> <label><input type="text" name="gbpay1[]" readonly id="gbpay1<?php echo $sno ?>" value="<?php echo $gbpay15 ?>" class="form-control" /></label><br/> <label><input type="text" name="hra1[]" readonly id="hra1<?php echo $sno ?>" value="<?php echo $hra15 ?>" class="form-control" /></label><br/> <label><input type="text" name="conv1[]" readonly id="conv1<?php echo $sno ?>" value="<?php echo $conv15?>" class="form-control" /></label><br/> <label><input type="text" name="splallow1[]" readonly id="splallow1<?php echo $sno ?>" value="<?php echo $splallow15 ?>" class="form-control" /></label><br/> <label><input type="text" name="washallow1[]" readonly id="washallow1<?php echo $sno ?>" value="<?php echo $washallow15 ?>" class="form-control" /></label><br/> <label><input type="text" name="daa1[]" readonly id="daa1<?php echo $sno ?>" value="<?php echo $daa15 ?>" class="form-control" /></label><br/> <label><input type="text" name="overtime[]" id="overtime<?php echo $sno ?>" value="<?php echo $overtime5; ?>" class="form-control" onkeyup="total_salary<?php echo $sno ?>();total_netsal<?php echo $sno ?>()" /></label><br/> <script language="javascript" type="text/javascript"> /*function b<?php echo $sno ?>() { var ot1=document.getElementById('ot<?php echo $sno ?>').value; var x=<?php echo $over ?>; var overtime1=parseFloat(ot1)*parseFloat(x); document.getElementById('overtime<?php echo $sno ?>').value=parseFloat(overtime1); }*/ function grsal<?php echo $sno ?>(){ var gr1=document.getElementById('gbpay<?php echo $sno ?>').value; var da1=document.getElementById('daa<?php echo $sno ?>').value; var wp1=document.getElementById('wp<?php echo $sno ?>').value; var wd1=document.getElementById('wd<?php echo $sno ?>').value; var grbasicsalary=((parseFloat(gr1)/parseFloat(wd1))*(parseFloat(wp1))); document.getElementById('gbpay1<?php echo $sno ?>').value=round(grbasicsalary); var totda=((parseFloat(da1)/parseFloat(wd1))*(parseFloat(wp1))); var pfvalue=grbasicsalary+totda; <?php if($_POST['arrear']=="2"){ ?> var gbpay_arr2=document.getElementById("gbpay2<?php echo $sno ?>").value; var daa_arr2=document.getElementById("daa2<?php echo $sno ?>").value; if((gbpay_arr2==0) || (daa_arr2==0)){ gbpay_arr2=0; daa_arr2=0; }else{ gbpay_arr2=gbpay_arr2; daa_arr2=daa_arr2; } <?php }else{ ?> var gbpay_arr2=0; var daa_arr2=0; <?php }?> //var gbpay3=parseFloat(document.getElementById("gbpay1<?php echo $sno ?>").value); // alert(totda); if(pfvalue>25000){ var pf=0; }else{ var totalsal=(parseFloat(grbasicsalary)+parseFloat(totda)+parseFloat(gbpay_arr2)+parseFloat(daa_arr2)); var pf=parseFloat((12*(totalsal))/100);} document.getElementById('epf<?php echo $sno ?>').value=Math.round(pf); //alert(document.getElementById('epf<?php echo $sno ?>').value); //var employer_pf=parseFloat((13.61*grbasicsalary)/100); //document.getElementById('employer_pf<?php echo $sno ?>').value=employer_pf; } function grhra<?php echo $sno ?>(){ var wp1=document.getElementById('wp<?php echo $sno ?>').value; var wd1=document.getElementById('wd<?php echo $sno ?>').value; var hr1=document.getElementById('hra<?php echo $sno ?>').value; var con1=document.getElementById('conv<?php echo $sno ?>').value; var spl1=document.getElementById('splallow<?php echo $sno ?>').value; var wshal1=document.getElementById('washallow<?php echo $sno ?>').value; var daa1=document.getElementById('daa<?php echo $sno ?>').value; var grosshra=((parseFloat(hr1)/parseFloat(wd1))*(parseFloat(wp1))); document.getElementById('hra1<?php echo $sno ?>').value=round(grosshra); var grossConv=((parseFloat(con1)/parseFloat(wd1))*(parseFloat(wp1))); document.getElementById('conv1<?php echo $sno ?>').value=round(grossConv); var grosssplallow=((parseFloat(spl1)/parseFloat(wd1))*(parseFloat(wp1))); document.getElementById('splallow1<?php echo $sno ?>').value=round(grosssplallow); var grosswashallow=((parseFloat(wshal1)/parseFloat(wd1))*(parseFloat(wp1))); document.getElementById('washallow1<?php echo $sno ?>').value=round(grosswashallow); var grossda=((parseFloat(daa1)/parseFloat(wd1))*(parseFloat(wp1))); document.getElementById('daa1<?php echo $sno ?>').value=round(grossda); } function grs<?php echo $sno ?>(){ if($('#clcheck<?php echo $sno ?>').is(":checked")) var g=document.getElementById("myText<?php echo $sno ?>").value; else var g=0; if ($('#plcheck<?php echo $sno ?>').is(":checked")) var u=document.getElementById("myText12<?php echo $sno ?>").value; else var u=0; if ($('#adcheck<?php echo $sno ?>').is(":checked")) var n=document.getElementById("myText23<?php echo $sno ?>").value; else var n=0; var gunj=parseFloat(g)+parseFloat(u)+parseFloat(n); var gr1=document.getElementById('gbpay<?php echo $sno ?>').value; var daa1=document.getElementById('daa<?php echo $sno ?>').value; var wp1=document.getElementById('wp<?php echo $sno ?>').value; var wd1=document.getElementById('wd<?php echo $sno ?>').value; var hr1=document.getElementById('hra<?php echo $sno ?>').value; var con1=document.getElementById('conv<?php echo $sno ?>').value; var spl1=document.getElementById('splallow<?php echo $sno ?>').value; var wshal1=document.getElementById('washallow<?php echo $sno ?>').value; var grbasicsalary=((parseFloat(gr1)/parseFloat(wd1))*(parseFloat(wp1)+(parseFloat(gunj)))); document.getElementById('gbpay1<?php echo $sno ?>').value=round(grbasicsalary); var grosshra=((parseFloat(hr1)/parseFloat(wd1))*(parseFloat(wp1)+(parseFloat(gunj)))); document.getElementById('hra1<?php echo $sno ?>').value=round(grosshra); var grossConv=((parseFloat(con1)/parseFloat(wd1))*(parseFloat(wp1)+(parseFloat(gunj)))); document.getElementById('conv1<?php echo $sno ?>').value=round(grossConv); var grosssplallow=((parseFloat(spl1)/parseFloat(wd1))*(parseFloat(wp1)+(parseFloat(gunj)))); document.getElementById('splallow1<?php echo $sno ?>').value=round(grosssplallow); var grosswashallow=((parseFloat(wshal1)/parseFloat(wd1))*(parseFloat(wp1)+(parseFloat(gunj)))); document.getElementById('washallow1<?php echo $sno ?>').value=round(grosswashallow); var grossda=((parseFloat(daa1)/parseFloat(wd1))*(parseFloat(wp1)+(parseFloat(gunj)))); document.getElementById('daa1<?php echo $sno ?>').value=round(grossda); var pfvalue=grbasicsalary+grossda; <?php if($_POST['arrear']=="2"){ ?> var gbpay_arr2=document.getElementById("gbpay2<?php echo $sno ?>").value; var daa_arr2=document.getElementById("daa2<?php echo $sno ?>").value; if((gbpay_arr2==0) || (daa_arr2==0)){ gbpay_arr2=0; daa_arr2=0; }else{ gbpay_arr2=gbpay_arr2; daa_arr2=daa_arr2; } <?php }else{ ?> var gbpay_arr2=0; var daa_arr2=0; <?php }?> //var gbpay3=parseFloat(document.getElementById("gbpay1<?php echo $sno ?>").value); // alert(totda); if(pfvalue>25000){ var pf=0; }else{ var totalsal=(parseFloat(grbasicsalary)+parseFloat(grossda)+parseFloat(gbpay_arr2)+parseFloat(daa_arr2)); var pf=parseFloat((12*(totalsal))/100);} document.getElementById('epf<?php echo $sno ?>').value=Math.round(pf); } function checkval<?php echo $sno ?>(){ var workday1=parseFloat(document.getElementById('wd<?php echo $sno ?>').value); var workoff1=parseFloat(document.getElementById('wof<?php echo $sno ?>').value); if(workoff1<0 ) { alert('working off Should not be negative.'); document.getElementById('wof<?php echo $sno ?>').value='0'; document.getElementById('wof<?php echo $sno ?>').focus(); document.getElementById('pd<?php echo $sno ?>').value='0'; document.getElementById('wp<?php echo $sno ?>').value='0'; document.getElementById('gbpay1<?php echo $sno ?>').value='0'; document.getElementById('hra1<?php echo $sno ?>').value='0'; document.getElementById('conv1<?php echo $sno ?>').value='0'; document.getElementById('splallow1<?php echo $sno ?>').value='0'; document.getElementById('washallow1<?php echo $sno ?>').value='0'; document.getElementById('epf<?php echo $sno ?>').value='0'; document.getElementById('esi<?php echo $sno ?>').value='0'; document.getElementById('total<?php echo $sno ?>').value='0'; document.getElementById('total1<?php echo $sno ?>').value='0'; document.getElementById('total3<?php echo $sno ?>').value='0'; document.getElementById('net<?php echo $sno ?>').value='0'; document.getElementById('da<?php echo $sno ?>').value='0'; return false; }else if(workoff1>workday1){ alert('working off is greater then working days'); document.getElementById('wof<?php echo $sno ?>').value='0'; document.getElementById('wof<?php echo $sno ?>').focus(); document.getElementById('pd<?php echo $sno ?>').value='0'; document.getElementById('wp<?php echo $sno ?>').value='0'; document.getElementById('gbpay1<?php echo $sno ?>').value='0'; document.getElementById('hra1<?php echo $sno ?>').value='0'; document.getElementById('conv1<?php echo $sno ?>').value='0'; document.getElementById('splallow1<?php echo $sno ?>').value='0'; document.getElementById('washallow1<?php echo $sno ?>').value='0'; document.getElementById('epf<?php echo $sno ?>').value='0'; document.getElementById('esi<?php echo $sno ?>').value='0'; document.getElementById('total<?php echo $sno ?>').value='0'; document.getElementById('total1<?php echo $sno ?>').value='0'; document.getElementById('total3<?php echo $sno ?>').value='0'; document.getElementById('net<?php echo $sno ?>').value='0'; document.getElementById('da<?php echo $sno ?>').value='0'; return false; } } </script> </td> <?php if($_POST['arrear']=="2"){?><td valign="top"> <label><input type="text" name="gbpay2[]" id="gbpay2<?php echo $sno ?>" value="0" class="form-control" onkeyup="d<?php echo $sno ?>();epf_emppf_arr<?php echo $sno ?>();esi_empesi_arr<?php echo $sno ?>();total_deduction<?php echo $sno ?>();total_netsal<?php echo $sno ?>();"/></label><br/> <label><input type="text" name="hra2[]" id="hra2<?php echo $sno ?>" value="0" class="form-control" onkeyup="d<?php echo $sno ?>();esi_empesi_arr<?php echo $sno ?>();total_deduction<?php echo $sno ?>();total_netsal<?php echo $sno ?>();"/></label><br/> <label><input type="text" name="conv2[]" id="conv2<?php echo $sno ?>" value="0" class="form-control" onkeyup="d<?php echo $sno ?>();esi_empesi_arr<?php echo $sno ?>();total_deduction<?php echo $sno ?>();total_netsal<?php echo $sno ?>();"/></label><br/> <label><input type="text" name="splallow2[]" id="splallow2<?php echo $sno ?>" value="0" class="form-control" onkeyup="d<?php echo $sno ?>();esi_empesi_arr<?php echo $sno ?>();total_deduction<?php echo $sno ?>();total_netsal<?php echo $sno ?>();"/></label><br/> <label><input type="text" name="washallow2[]" id="washallow2<?php echo $sno ?>" value="0" class="form-control" onkeyup="d<?php echo $sno ?>();total_deduction<?php echo $sno ?>();total_netsal<?php echo $sno ?>();"/></label><br/> <label><input type="text" name="daa2[]" id="daa2<?php echo $sno ?>" value="0" class="form-control" onkeyup="d<?php echo $sno ?>();epf_emppf_arr<?php echo $sno ?>();esi_empesi_arr<?php echo $sno ?>();total_deduction<?php echo $sno ?>();total_netsal<?php echo $sno ?>();"/></label><br/> </td> <?php } ?> <td> <label class="labelht">EPF@12.00%</label><br/> <label class="labelht">ESI @ 1.75%</label><br/> <label class="labelht" style="display:none;">LWF</label><br/> <label class="labelht">Other</label><br/> <label class="labelht" style="display:none;">Employer PF</label><br/> <label class="labelht" style="display:none;">Employer ESI</label><br/> <label class="labelht" style="display:none;">CTC</label><br/> </td> <td> <label><input type="text" name="epf[]" id="epf<?php echo $sno ?>" value="<?php echo $epf5 ?>" class="form-control" /></label><br/> <label><input type="text" name="esi[]" id="esi<?php echo $sno ?>" value="<?php echo $esi5 ?>" class="form-control" /></label><br/> <label><input type="text" name="lwf[]" id="lwf<?php echo $sno ?>" value="0" class="form-control" style="display:none;" /></label><br/> <label><input type="text" name="canteen[]" id="canteen<?php echo $sno ?>" value="<?php echo $canteen5 ?>" class="form-control" onkeyup="total_deduction<?php echo $sno ?>();total_netsal<?php echo $sno ?>()" /></label><br/> <label style="display:none;"><input type="text" name="employer_pf[]" id="employer_pf<?php echo $sno ?>" value="<?php echo $employer_pf ?>" class="form-control" readonly /></label><br/> <label style="display:none;"><input type="text" name="employer_esi[]" id="employer_esi<?php echo $sno ?>" value="<?php echo $employer_esi ?>" class="form-control" readonly /></label><br/> <label style="display:none;"><input type="text" name="ctc1[]" id="ctc1<?php echo $sno ?>" value="<?php echo $ctc ?>" class="form-control" readonly /></label><br/> </td> <td valign="top"> </td> </tr> <script type="text/javascript" language="javascript"> function totalbasic<?php echo $sno ?>() { var gbpay=parseFloat(document.getElementById("gbpay<?php echo $sno ?>").value); var conv=parseFloat(document.getElementById("conv<?php echo $sno ?>").value); var hra=parseFloat(document.getElementById("hra<?php echo $sno ?>").value); var splallow=parseFloat(document.getElementById("splallow<?php echo $sno ?>").value); var washallow=parseFloat(document.getElementById("washallow<?php echo $sno ?>").value); var daa=parseFloat(document.getElementById("daa<?php echo $sno ?>").value); var total= hra+conv+gbpay+splallow+washallow+daa; document.getElementById("total<?php echo $sno ?>").value=Math.round(total); } function total_salary<?php echo $sno ?>() { var gbpay1=parseFloat(document.getElementById('gbpay1<?php echo $sno ?>').value); var conv1=parseFloat(document.getElementById('conv1<?php echo $sno ?>').value); var hra1=parseFloat(document.getElementById('hra1<?php echo $sno ?>').value); var splallow1=parseFloat(document.getElementById('splallow1<?php echo $sno ?>').value); var washallow1=parseFloat(document.getElementById('washallow1<?php echo $sno ?>').value); var daa1=parseFloat(document.getElementById('daa1<?php echo $sno ?>').value); var overtime=parseFloat(document.getElementById('overtime<?php echo $sno ?>').value); var total1= round(hra1+conv1+gbpay1+splallow1+washallow1+daa1+overtime,2); //alert(conv1); document.getElementById('total1<?php echo $sno ?>').value=Math.round(total1); } function d<?php echo $sno ?>() { var gbpay2=parseFloat(document.getElementById("gbpay2<?php echo $sno ?>").value); var conv2=parseFloat(document.getElementById("conv2<?php echo $sno ?>").value); var hra2=parseFloat(document.getElementById("hra2<?php echo $sno ?>").value); var splallow2=parseFloat(document.getElementById("splallow2<?php echo $sno ?>").value); var washallow2=parseFloat(document.getElementById("washallow2<?php echo $sno ?>").value); var daa2=parseFloat(document.getElementById("daa2<?php echo $sno ?>").value); var total2= round((hra2+conv2+gbpay2+splallow2+washallow2+daa2),2); document.getElementById("total2<?php echo $sno ?>").value=Math.round(total2); } function epf_emppf<?php echo $sno ?>() { var gbpayy=parseFloat(document.getElementById("gbpay1<?php echo $sno ?>").value); var da11=parseFloat(document.getElementById('daa1<?php echo $sno ?>').value); var totemplpff=round(gbpayy+da11,2); var pff=Math.ceil(parseFloat((12*gbpayy)/100)); //document.getElementById('epf<?php echo $sno ?>').value=pff; var employer_pf1=13.61*totemplpff; var employer_pf=Math.ceil(parseFloat((employer_pf1 )/100)); //alert(employer_pf); document.getElementById('employer_pf<?php echo $sno ?>').value=Math.round(employer_pf); } function esi_empesi<?php echo $sno ?>() { var me1=parseFloat(document.getElementById("gbpay1<?php echo $sno ?>").value); var me2=parseFloat(document.getElementById("hra1<?php echo $sno ?>").value); var me3=parseFloat(document.getElementById("splallow1<?php echo $sno ?>").value); var me4=parseFloat(document.getElementById("conv1<?php echo $sno ?>").value); var me5=parseFloat(document.getElementById("daa1<?php echo $sno ?>").value); <?php if($_POST['arrear']=="2"){?> var me6=parseFloat(document.getElementById("gbpay2<?php echo $sno ?>").value); var me7=parseFloat(document.getElementById("conv2<?php echo $sno ?>").value); var me8=parseFloat(document.getElementById("hra2<?php echo $sno ?>").value); var me9=parseFloat(document.getElementById("splallow2<?php echo $sno ?>").value); var me10=parseFloat(document.getElementById("daa2<?php echo $sno ?>").value); <?php }else{ ?> var me6=0; var me7=0; var me8=0; var me9=0; var me10=0; <?php }?> var me_total=round((me1+me2+me3+me4+me5+me6+me7+me8+me9+me10),2); var pftot=me1+me5; if(me1>25000) { var total11=0; }else{ var total11= round(((me_total)*1.75)/100,2); } var employer_total11= round(((me_total)*4.75)/100,2); document.getElementById("esi<?php echo $sno ?>").value=Math.round(total11); document.getElementById("employer_esi<?php echo $sno ?>").value=Math.round(employer_total11); } function epf_emppf_arr<?php echo $sno ?>(){ var gr2_basic=document.getElementById('gbpay<?php echo $sno ?>').value; var gr1_basic=document.getElementById('gbpay1<?php echo $sno ?>').value; var da1_basic=document.getElementById('daa1<?php echo $sno ?>').value; //alert(da1_basic); var gr1_arr=document.getElementById('gbpay2<?php echo $sno ?>').value; var da1_arr=document.getElementById('daa2<?php echo $sno ?>').value; var wp1_arr=document.getElementById('wp<?php echo $sno ?>').value; var wd1_arr=document.getElementById('wd<?php echo $sno ?>').value; //alert(gr1_arr); var grbasicsalary_arr=((parseFloat(gr1_arr)/parseFloat(wd1_arr))*(parseFloat(wp1_arr))); //alert(grbasicsalary_arr); var totda_arr=((parseFloat(da1_arr)/parseFloat(wd1_arr))*(parseFloat(wp1_arr))); if((gr1_arr==0) && (da1_arr==0)){ gbpay_arr2=0; daa_arr2=0; }else{ gbpay_arr2=gr1_arr; daa_arr2=da1_arr; } if(gr2_basic>25000){ var pf_arr=0; }else{ var totalsal_arr=(parseFloat(grbasicsalary_arr)+parseFloat(totda_arr)+parseFloat(gr1_basic)+parseFloat(da1_basic)); //alert(totalsal_arr); var pf_arr=parseFloat((12*(totalsal_arr))/100);} document.getElementById('epf<?php echo $sno ?>').value=Math.round(pf_arr); } function esi_empesi_arr<?php echo $sno ?>() { var me11=parseFloat(document.getElementById("gbpay1<?php echo $sno ?>").value); var me21=parseFloat(document.getElementById("hra1<?php echo $sno ?>").value); var me31=parseFloat(document.getElementById("splallow1<?php echo $sno ?>").value); var me41=parseFloat(document.getElementById("conv1<?php echo $sno ?>").value); var me51=parseFloat(document.getElementById("daa1<?php echo $sno ?>").value); var me61=parseFloat(document.getElementById("gbpay2<?php echo $sno ?>").value); var me71=parseFloat(document.getElementById("conv2<?php echo $sno ?>").value); var me81=parseFloat(document.getElementById("hra2<?php echo $sno ?>").value); var me91=parseFloat(document.getElementById("splallow2<?php echo $sno ?>").value); var me101=parseFloat(document.getElementById("daa2<?php echo $sno ?>").value); var me_total1=round((me11+me21+me31+me41+me51+me61+me71+me81+me91+me101),2); //alert(me_total1); if(me11>25000) { var total111=0; }else{ var total111= round(((me_total1)*1.75)/100,2); } var employer_total111= round(((me_total1)*4.75)/100,2); document.getElementById("esi<?php echo $sno ?>").value=Math.round(total111); document.getElementById("employer_esi<?php echo $sno ?>").value=Math.round(employer_total111); } function total_deduction<?php echo $sno ?>() { var epff=parseFloat(document.getElementById("epf<?php echo $sno ?>").value); var esii=parseFloat(document.getElementById("esi<?php echo $sno ?>").value); var lwff=parseFloat(document.getElementById("lwf<?php echo $sno ?>").value); var canteenn=parseFloat(document.getElementById("canteen<?php echo $sno ?>").value); var total15= round((epff+esii+lwff+canteenn),2); document.getElementById("total3<?php echo $sno ?>").value=Math.round(total15); } function total_netsal<?php echo $sno ?>() { var t1=t2=t3=t4=0; var t1=document.getElementById("total<?php echo $sno ?>").value; var t2=document.getElementById("total1<?php echo $sno ?>").value; var t3=document.getElementById("total2<?php echo $sno ?>").value; var t4=document.getElementById("total3<?php echo $sno ?>").value; var t5=(parseFloat(t2)+parseFloat(t3)); var tt=((parseFloat(t2)+parseFloat(t3))-parseFloat(t4)); var ttt= parseFloat(tt,2); document.getElementById("net<?php echo $sno ?>").value=Math.round(ttt); } function paid_days<?php echo $sno ?>(){ var wp=document.getElementById("wp<?php echo $sno ?>").value; if($('#clcheck<?php echo $sno ?>').is(":checked")) var mt1=document.getElementById("myText<?php echo $sno ?>").value; else var mt1=0; if ($('#plcheck<?php echo $sno ?>').is(":checked")) var mt2=document.getElementById("myText12<?php echo $sno ?>").value; else var mt2=0; if ($('#adcheck<?php echo $sno ?>').is(":checked")) var mt3=document.getElementById("myText23<?php echo $sno ?>").value; else var mt3=0; var pd1=parseFloat(mt1)+parseFloat(mt2)+parseFloat(mt3); var pd2=parseFloat(pd1)+parseFloat(wp) document.getElementById("pd<?php echo $sno ?>").value=pd2; } function pdays<?php echo $sno ?>(){ document.getElementById("pd<?php echo $sno ?>").value=document.getElementById("wp<?php echo $sno ?>").value; } function ctc<?php echo $sno ?>() { var ctc1=parseFloat(document.getElementById("total<?php echo $sno ?>").value); var ctc2=parseFloat(document.getElementById("employer_pf<?php echo $sno ?>").value); var ctc3=parseFloat(document.getElementById("employer_esi<?php echo $sno ?>").value); var ctc=round(ctc1+ctc2+ctc3); document.getElementById("ctc1<?php echo $sno ?>").value=Math.round(ctc); } $('document').on('click', function() { $('#gbpay1<?php echo $sno ?>').val('hi') // get the current value of the input field. }); </script> <tr > <th style="border-bottom:2px solid #333; border-top:dotted;"> </th> <th colspan="2" style="border-bottom:2px solid #333; border-top:dotted;"> </th> <th style="border-bottom:2px solid #333; border-top:dotted;">Total</th> <th style="border-bottom:2px solid #333; border-top:dotted;"><input type="text" name="total[]" readonly onclick="totalbasic<?php echo $sno ?>()" value="<?php echo $total5 ?>" id="total<?php echo $sno ?>" class="form-control" /></th> <th style="border-bottom:2px solid #333; border-top:dotted;"><input type="text" name="total1[]" id="total1<?php echo $sno ?>" onkeyup="esi_empesi<?php echo $sno ?>();" value="<?php echo $total15 ?>" class="form-control" readonly /></th> <?php if($_POST['arrear']=="2"){ ?><th style="border-bottom:2px solid #333; border-top:dotted; " ><input type="text" name="total2[]" id="total2<?php echo $sno ?>" value="0" class="form-control" readonly /></th> <?php }else{ ?> <input type="hidden" name="total2[]" id="total2<?php echo $sno ?>" value="0" class="form-control" readonly /><?php }?> <th style="border-bottom:2px solid #333; border-top:dotted;">Total</th> <th style="border-bottom:2px solid #333; border-top:dotted;"><input type="text" name="total3[]" id="total3<?php echo $sno ?>" onclick="total_deduction<?php echo $sno ?>()" value="<?php echo $total35?>" class="form-control" readonly /></th> <th style="border-bottom:2px solid #333; border-top:dotted;"><input type="text" name="net[]" id="net<?php echo $sno ?>" onkeyup="total_netsal<?php echo $sno ?>()" value="<?php echo $net5 ?>" class="form-control" readonly /></th> </tr> </tbody> </tfoot> </table> <?php $tca=0;} ?> <input type="submit" name="submitsal" value="Submit Salary" class="btn btn-info " > </form> <?php } ?> </div><!-- /.box-body --> </div><!-- /.box --> </div><!-- /.col --> </div><!-- /.row --> </section><!-- /.content --> </div><!-- /.content-wrapper --> <?php require_once("footer.php"); ?>