ATTENDANCE ISSUES FIXED
This commit is contained in:
parent
28e1661996
commit
10fa80b1d1
@ -64,7 +64,7 @@ class monthlypay extends BaseController
|
|||||||
|
|
||||||
|
|
||||||
$hname = $d->Holiday_Name;
|
$hname = $d->Holiday_Name;
|
||||||
$hdate = $d->Date;
|
$hdate = date_format(date_create($d->Date),'Y-m-d');
|
||||||
|
|
||||||
$tostore = array('H_Name'=>$hname,'H_Date'=>$hdate);
|
$tostore = array('H_Name'=>$hname,'H_Date'=>$hdate);
|
||||||
$isExist = $this->monthlypay_model->checkHoliday($hdate);
|
$isExist = $this->monthlypay_model->checkHoliday($hdate);
|
||||||
@ -178,7 +178,7 @@ class monthlypay extends BaseController
|
|||||||
|
|
||||||
|
|
||||||
$res = $this->monthlypay_model->saveAttendance($monthattendance,$Month_Year,$EmpID);
|
$res = $this->monthlypay_model->saveAttendance($monthattendance,$Month_Year,$EmpID);
|
||||||
echo $res;
|
// echo $res;
|
||||||
$total = $total + $res;
|
$total = $total + $res;
|
||||||
// die();
|
// die();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -226,7 +226,7 @@ class Payroll_model extends CI_Model
|
|||||||
// echo $source.'-'.$year1.'-'.$year2;
|
// echo $source.'-'.$year1.'-'.$year2;
|
||||||
|
|
||||||
$this->db->distinct();
|
$this->db->distinct();
|
||||||
$this->db->select('Pay.EmpID,Emp.FirstName as FName ,Emp.LastName as Lname,sum(Loan_Amount) as Loan_Amount,sum(Paid_Amount) as Paid_Amount');
|
$this->db->select('Pay.EmpID,Emp.FirstName as FName ,Emp.LastName as Lname,sum(loan.Loan_Amount) as Loan_Amount,sum(loan.Paid_Amount) as Paid_Amount');
|
||||||
$this->db->from('T_Emp_Pay_Data Pay');
|
$this->db->from('T_Emp_Pay_Data Pay');
|
||||||
$this->db->join('T_Employee_Details Emp', 'Pay.EmpID = Emp.EmpID');
|
$this->db->join('T_Employee_Details Emp', 'Pay.EmpID = Emp.EmpID');
|
||||||
$this->db->join('T_Loan_Master loan', 'Pay.EmpID = loan.EmpID');
|
$this->db->join('T_Loan_Master loan', 'Pay.EmpID = loan.EmpID');
|
||||||
|
|||||||
@ -203,7 +203,7 @@ $attendance = array_merge($attendance,$emppay);
|
|||||||
echo form_input($data);?>
|
echo form_input($data);?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<input type="submit" value="Change Month" class="btn btn-primary" onclick="changeMonth();" title='click here for load attendance for specified month'>
|
<input type="submit" value="Change Month" class="btn btn-primary" title='click here for load attendance for specified month'>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@ -313,7 +313,7 @@ $attendance = array_merge($attendance,$emppay);
|
|||||||
|
|
||||||
<th class="celda_encabezado_general" rowspan="2">S.NO</th>
|
<th class="celda_encabezado_general" rowspan="2">S.NO</th>
|
||||||
<th class="celda_encabezado_general" rowspan="2">Employee ID</th>
|
<th class="celda_encabezado_general" rowspan="2">Employee ID</th>
|
||||||
<th class="celda_encabezado_general" rowspan="2">Employee Name</th>
|
<th style="background-color:#3c8dbc;color:#fff;border:5px" rowspan="2">Employee Name</th>
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
@ -369,9 +369,9 @@ $attendance = array_merge($attendance,$emppay);
|
|||||||
foreach($finalarray as $a){ $row++;$index++;?>
|
foreach($finalarray as $a){ $row++;$index++;?>
|
||||||
|
|
||||||
<tr id="<?php echo $row;?>">
|
<tr id="<?php echo $row;?>">
|
||||||
<td class="celda_normal" ><?php echo $index;?></td>
|
<td width="45" height="45" class="celda_normal" ><?php echo $index;?></td>
|
||||||
<td class="celda_normal"><?php echo $a->EmpID;?></td>
|
<td width="79" height="45"class="celda_normal"><?php echo $a->EmpID;?></td>
|
||||||
<td class="celda_normal"><?php echo $a->FirstName.'-'.$a->LastName;?></td>
|
<td width="80" height="45" class="celda_normal"><?php echo $a->FirstName.'-'.$a->LastName;?></td>
|
||||||
|
|
||||||
<?php for ($col =1; $col <= $monthdays;$col++){
|
<?php for ($col =1; $col <= $monthdays;$col++){
|
||||||
$flag =0;
|
$flag =0;
|
||||||
@ -602,6 +602,8 @@ function myFunction(p,i,v)
|
|||||||
var totalDaysWorked=0;
|
var totalDaysWorked=0;
|
||||||
var absent = 0;
|
var absent = 0;
|
||||||
var sundays = <?php echo $noofsundays?>;
|
var sundays = <?php echo $noofsundays?>;
|
||||||
|
var publicholidays = <?php echo $noofpublicholidays?>;
|
||||||
|
|
||||||
var totaldays = <?php echo $monthdays?>;
|
var totaldays = <?php echo $monthdays?>;
|
||||||
totaldays = (totaldays * 2)+3;
|
totaldays = (totaldays * 2)+3;
|
||||||
//console.log(totaldays);
|
//console.log(totaldays);
|
||||||
@ -712,7 +714,7 @@ function myFunction(p,i,v)
|
|||||||
document.getElementById(totalhrsid).innerHTML = parseFloat(totalworkingHrs).toFixed(2);// == ''?0:parseFloat(totalworkingHrs));
|
document.getElementById(totalhrsid).innerHTML = parseFloat(totalworkingHrs).toFixed(2);// == ''?0:parseFloat(totalworkingHrs));
|
||||||
document.getElementById(totalothrsid).innerHTML = parseFloat(totalOTHrs).toFixed(2);// == ''?0:parseFloat(totalOTHrs));
|
document.getElementById(totalothrsid).innerHTML = parseFloat(totalOTHrs).toFixed(2);// == ''?0:parseFloat(totalOTHrs));
|
||||||
document.getElementById(paidleaveid).innerHTML = parseFloat(paidleave).toFixed(2);
|
document.getElementById(paidleaveid).innerHTML = parseFloat(paidleave).toFixed(2);
|
||||||
document.getElementById(daysworkedid).innerHTML = parseFloat((totalworkingHrs/8)+4).toFixed(2);
|
document.getElementById(daysworkedid).innerHTML = parseFloat((totalworkingHrs/8)+sundays+publicholidays).toFixed(2);
|
||||||
document.getElementById(absentid).innerHTML = parseFloat(absent).toFixed(2);
|
document.getElementById(absentid).innerHTML = parseFloat(absent).toFixed(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -329,7 +329,7 @@ $('html').bind('keypress', function(e)
|
|||||||
if(data)
|
if(data)
|
||||||
{
|
{
|
||||||
$('#content').loader('hide');
|
$('#content').loader('hide');
|
||||||
alert(data);
|
// alert(data);
|
||||||
var trHTML="";
|
var trHTML="";
|
||||||
var obj =JSON.parse(data);
|
var obj =JSON.parse(data);
|
||||||
var temparray = [];
|
var temparray = [];
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
$("#hdate").datepicker({
|
$("#hdate").datepicker({
|
||||||
dateFormat: 'yy-mm-dd',changeMonth: true, changeYear: true,yearRange: '-100:+0'
|
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$('html').bind('keypress', function(e)
|
$('html').bind('keypress', function(e)
|
||||||
@ -99,14 +99,15 @@ $('html').bind('keypress', function(e)
|
|||||||
|
|
||||||
{
|
{
|
||||||
$index++;
|
$index++;
|
||||||
|
$date = date_create($day->H_Date);
|
||||||
|
$date = date_format($date,'d-m-Y');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<tr id="<?php echo $index;?>">
|
<tr id="<?php echo $index;?>">
|
||||||
<!-- <td style="text-align:right;"><?php echo $index ?></td> -->
|
<!-- <td style="text-align:right;"><?php echo $index ?></td> -->
|
||||||
|
|
||||||
<td contenteditable='true' style="text-align:right;"><?php if(!empty($day->H_Name)){echo $day->H_Name;}else{echo "NO DATA";}?></td>
|
<td contenteditable='true' style="text-align:left;"><?php if(!empty($day->H_Name)){echo $day->H_Name;}else{echo "NO DATA";}?></td>
|
||||||
<td contenteditable='true' style="text-align:right;"><?php if(!empty($day->H_Date)){echo $day->H_Date;}else{echo "NO DATA";}?></td>
|
<td contenteditable='true' style="text-align:right;"><?php echo $date;?></td>
|
||||||
<td style="text-align:right;"><a href='#' onclick = "DeleteRow(<?php echo $index ; ?>)" id="Del" ><span class="glyphicon glyphicon-trash"></span></a></td>
|
<td style="text-align:right;"><a href='#' onclick = "DeleteRow(<?php echo $index ; ?>)" id="Del" ><span class="glyphicon glyphicon-trash"></span></a></td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
@ -157,7 +158,7 @@ $('html').bind('keypress', function(e)
|
|||||||
</script>
|
</script>
|
||||||
<script type="text/html" id="addList">
|
<script type="text/html" id="addList">
|
||||||
<tr id="<%=index%>">
|
<tr id="<%=index%>">
|
||||||
<td style="text-align:right;" ><%=Holiday_Name%></td>
|
<td style="text-align:left;" contenteditable="true"><%=Holiday_Name%></td>
|
||||||
<td style="text-align:right;" contenteditable="true"><%=Date%></td>
|
<td style="text-align:right;" contenteditable="true"><%=Date%></td>
|
||||||
<td style="text-align:right;">
|
<td style="text-align:right;">
|
||||||
<a href='#' onclick = "DeleteRow(<?php echo $index ; ?>)" id="Del" ><span class="glyphicon glyphicon-trash"></span></a>
|
<a href='#' onclick = "DeleteRow(<?php echo $index ; ?>)" id="Del" ><span class="glyphicon glyphicon-trash"></span></a>
|
||||||
@ -219,6 +220,7 @@ $('#submit').click(function(){
|
|||||||
|
|
||||||
var jsondata = $('#phdays').tableToJSON();
|
var jsondata = $('#phdays').tableToJSON();
|
||||||
var jsondata = JSON.stringify(jsondata);
|
var jsondata = JSON.stringify(jsondata);
|
||||||
|
|
||||||
$('#content').loader('show');
|
$('#content').loader('show');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data:{param1:jsondata},
|
data:{param1:jsondata},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user