service po pdf s.no issues fixed
This commit is contained in:
parent
10878baee9
commit
acd1ade8ef
19
application/models/monthlypay_model.php
Normal file → Executable file
19
application/models/monthlypay_model.php
Normal file → Executable file
@ -28,20 +28,15 @@ class monthlypay_model extends CI_Model
|
||||
|
||||
function getEmpPayDetails($current="",$s="")
|
||||
{
|
||||
//echo $s;die();
|
||||
if($s == ''){
|
||||
|
||||
$current = '01-'.$current;
|
||||
$current = date_create($current);
|
||||
$current = date_format($current,"Y-m-d");
|
||||
}
|
||||
$this->db->select('T_Emp_Pay_Data.EmpID,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Employee_Details.DateofJoining');
|
||||
$this->db->from('T_Emp_Pay_Data');
|
||||
$this->db->join('T_Employee_Details ','T_Emp_Pay_Data.EmpID=T_Employee_Details.EmpID');
|
||||
$this->db->where('T_Employee_Details.DateofJoining <=',$current);
|
||||
$this->db->select('T_Employee_Details.EmpID,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Employee_Details.DateofJoining');
|
||||
$this->db->from('T_Employee_Details');
|
||||
//$this->db->join('T_Emp_Pay_Data','T_Emp_Pay_Data.EmpID=T_Employee_Details.EmpID','Left');
|
||||
$this->db->where('T_Employee_Details.IsActive',1);
|
||||
$this->db->order_by('EmpID','asc');
|
||||
$query = $this->db->get();
|
||||
$result = $query->result();
|
||||
$result = $query->result();
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@ -113,7 +108,7 @@ class monthlypay_model extends CI_Model
|
||||
|
||||
function deleteHoliday($d)
|
||||
{
|
||||
//echo "from Model" . $d;
|
||||
$d = date_format(date_create($d),'Y-m-d');
|
||||
$this->db->where('H_date',$d);
|
||||
$this->db->delete('T_Public_Holidays');
|
||||
return $this->db->affected_rows();
|
||||
|
||||
318
application/views/attendance.php
Normal file → Executable file
318
application/views/attendance.php
Normal file → Executable file
@ -18,7 +18,9 @@ $datefordropdown = date_create($datefordropdown);
|
||||
$datefordropdown = date_format($datefordropdown,'M-Y');
|
||||
//echo $datefordropdown;
|
||||
$attendance = array_merge($attendance,$emppay);
|
||||
// echo count($attendance) ."<br>";
|
||||
date_default_timezone_set('Asia/Kolkata');
|
||||
$currentday = date('d');
|
||||
|
||||
// print_r($attendance);
|
||||
// echo "<br>------------------------------<br>";
|
||||
|
||||
@ -207,6 +209,7 @@ $attendance = array_merge($attendance,$emppay);
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div><!-- /.box-header -->
|
||||
@ -215,29 +218,7 @@ $attendance = array_merge($attendance,$emppay);
|
||||
<div class="box-body">
|
||||
<?php
|
||||
|
||||
// $year =date('Y');
|
||||
// $month =date('m');
|
||||
// $day = date('d');
|
||||
|
||||
// $monthdays =cal_days_in_month(CAL_GREGORIAN,$month,$year);
|
||||
|
||||
|
||||
// $begin = new DateTime($year.'-'.$month.'-01');
|
||||
// $end = new DateTime($year.'-'.$month.'-'.$monthdays);
|
||||
|
||||
// $ind =array();
|
||||
|
||||
// while ($begin <= $end) // Loop will work begin to the end date
|
||||
// {
|
||||
// if($begin->format("D") == "Sun") //Check that the day is Sunday here
|
||||
// {
|
||||
|
||||
// array_push($ind,$begin->format("d"));
|
||||
// }
|
||||
|
||||
// $begin->modify('+1 day');
|
||||
// }
|
||||
// $noofsundays = count($ind);
|
||||
|
||||
$testarray=array();
|
||||
$finalarray = array();
|
||||
@ -263,42 +244,7 @@ $attendance = array_merge($attendance,$emppay);
|
||||
}
|
||||
}
|
||||
}
|
||||
//print_r($testarray);echo count($testarray);
|
||||
//echo "<br>...........................<br>";
|
||||
//print_r($finalarray);echo count($finalarray);
|
||||
// $index = 0;
|
||||
// foreach($finalarray as $gg )
|
||||
// {
|
||||
// echo "<br>...........................<br>";
|
||||
// $index = $index +1;
|
||||
// echo "S.NO" . $index . "<br>";
|
||||
// echo "EmpID" . $gg->EmpID ."<br>";
|
||||
// //echo $key ."-".$value;
|
||||
|
||||
// for ($col =1; $col <= $monthdays;$col++){
|
||||
// $flag =0;
|
||||
// foreach($ind as $in)
|
||||
// {
|
||||
// if($in == $col)
|
||||
// {
|
||||
// $flag = 1;
|
||||
// }
|
||||
// }
|
||||
// $WH='WH'.$col;
|
||||
// $OT = 'OT'.$col;
|
||||
|
||||
|
||||
// if(!empty($gg->$WH)){echo "WORK" . $gg->$WH."--";}else{echo "WORK" . "0--";}
|
||||
|
||||
// if(!empty($gg->$OT)){echo "OT" . $gg->$OT. "--";}else{echo "OT" . "0--";}
|
||||
// }
|
||||
// // /// echo "$WH";
|
||||
// //print_r($gg);
|
||||
|
||||
// //break;
|
||||
|
||||
// }
|
||||
//die();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@ -322,6 +268,13 @@ $attendance = array_merge($attendance,$emppay);
|
||||
|
||||
$flag =0;
|
||||
$flag2 = 0;
|
||||
$todayflag = 0;
|
||||
|
||||
if($col == $currentday)
|
||||
{
|
||||
$todayflag = 1;
|
||||
|
||||
}
|
||||
foreach($sundayarray as $in) //For Find out Sundays($ind) from $monthdays array
|
||||
{
|
||||
if($in == $col)
|
||||
@ -329,31 +282,32 @@ $attendance = array_merge($attendance,$emppay);
|
||||
$flag = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$title = '';
|
||||
foreach($publicholidaysarray as $h) //For Find out public holidays from $monthdays array
|
||||
{
|
||||
|
||||
$temp = $h->H_Date;
|
||||
$temp = substr($temp,8);
|
||||
$title = '';
|
||||
|
||||
if($temp == $col)
|
||||
{
|
||||
$flag2 = 1;
|
||||
//$title ="Public Holiday-" . str_replace(" ","_",$h->H_Name);
|
||||
$title = str_replace(" ","_",$h->H_Name);
|
||||
//echo $title;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<th <?php if($flag == 1){ ?> title = "Sunday" <?php }else if($flag2 == 1){ ?> title = <?php echo $title; }?> class="celda_encabezado_general"<?php if($flag == 1 or $flag2 == 1){echo "style='background: #f39c12 ;'";}?> ><?php if($flag == 1 or $flag2 == 1){echo "<font style='color:#ff0000;'>".$col . "W<font>";}else{echo $col."W";}?></th>
|
||||
<th <?php if($flag == 1){ ?> title = "Sunday" <?php } else if($flag2 == 1){ ?> title = <?php echo $title; }?> class="celda_encabezado_general" <?php if($flag == 1 or $flag2 == 1){echo "style='background: #f39c12 ;'";}?>><?php if($flag == 1 or $flag2 == 1){echo "<font style='color:#ff0000;'>".$col . "OT<font>";}else{echo $col."OT";}?></th>
|
||||
<th <?php if($flag2 == 1){ ?> title = " <?php echo $title; ?> " <?php } else if($flag == 1 ){ ?> title = "sunday" <?php }?> class="celda_encabezado_general" <?php if($flag == 1 or $flag2 == 1) { echo "style='background: #f39c12 ;'"; } else if($todayflag == 1){ echo "style='background: #dd99ff ;'"; } ?> > <?php if($flag == 1 or $flag2 == 1){ echo "<font style='color:#ff0000;'>".$col."W<font>";} else { echo $col."W"; } ?></th>
|
||||
<th <?php if($flag2 == 1){ ?> title = " <?php echo $title; ?> " <?php } else if($flag == 1 ){ ?> title = "sunday" <?php }?> class="celda_encabezado_general" <?php if($flag == 1 or $flag2 == 1) { echo "style='background: #f39c12 ;'"; } else if($todayflag == 1){ echo "style='background: #dd99ff ;'"; }?> > <?php if($flag == 1 or $flag2 == 1){ echo "<font style='color:#ff0000;'>".$col."OT<font>";} else { echo $col."OT"; }?></th>
|
||||
<?php
|
||||
//echo $flag2;
|
||||
$flag =0;
|
||||
$flag2 =0;
|
||||
$todayflag = 0;
|
||||
}?>
|
||||
<th class="celda_encabezado_general" >Total Hrs</th>
|
||||
<th class="celda_encabezado_general" >OT Hrs</th>
|
||||
@ -371,11 +325,18 @@ $attendance = array_merge($attendance,$emppay);
|
||||
|
||||
<tr id="<?php echo $row;?>">
|
||||
<td width="45" height="45" class="celda_normal" ><?php echo $index;?></td>
|
||||
<td width="79" height="45"class="celda_normal"><?php echo $a->EmpID;?></td>
|
||||
<td width="79" height="45" class="celda_normal"><?php echo $a->EmpID;?></td>
|
||||
<td width="80" height="45" class="celda_normal"><?php echo $a->FirstName.'-'.$a->LastName;?></td>
|
||||
|
||||
<?php for ($col =1; $col <= $monthdays;$col++){
|
||||
$flag =0;
|
||||
$flag2 = 0;
|
||||
|
||||
if($col == $currentday)
|
||||
{
|
||||
$todayflag = 1;
|
||||
|
||||
}
|
||||
foreach($sundayarray as $in)
|
||||
{
|
||||
if($in == $col)
|
||||
@ -390,7 +351,7 @@ $attendance = array_merge($attendance,$emppay);
|
||||
$temp = $h->H_Date;
|
||||
$temp = substr($temp,8);
|
||||
$title = '';
|
||||
$flag2 = 0;
|
||||
//echo $temp.'-'.$col.'/';
|
||||
if($temp == $col)
|
||||
{
|
||||
$flag2 = 1;
|
||||
@ -403,11 +364,12 @@ $attendance = array_merge($attendance,$emppay);
|
||||
$OT = 'OT'.$col;
|
||||
|
||||
?>
|
||||
<td <?php if($flag == 1){ ?> title = "Sunday" <?php }else if($flag2 == 1 ){ ?> title = <?php echo $title; } ?> class="celda_normal" onkeyup="myFunction(this.parentNode.id,this.id,this.textContent);" id ="<?php if($flag == 1 or $flag2 == 1) {echo $row.$col.'WS';}else{echo $row.$col.'W';}?>" <?php if($flag == 1 or $flag2 == 1){echo "style='background: #f9cd86 ;'";}?> contenteditable = "true"><?php if(!empty($a->$WH)){echo $a->$WH;}else{echo "";}?></td>
|
||||
<td <?php if($flag == 1){ ?> title = "Sunday" <?php }else if($flag2 == 1 ){ ?> title = <?php echo $title; } ?> class="celda_normal" onkeyup="myFunction(this.parentNode.id,this.id,this.textContent);" id ="<?php if($flag == 1 or $flag2 == 1) {echo $row.$col.'OTS';}else{echo $row.$col.'OT';}?>" <?php if($flag == 1 or $flag2 == 1){echo "style='background: #f9cd86 ;'";}?> contenteditable = "true"><?php if(!empty($a->$OT)){echo $a->$OT;}else{echo "";}?></td>
|
||||
<td <?php if($flag2 == 1){ ?> title = " <?php echo $title; ?> " <?php } else if($flag == 1 ){ ?> title = "sunday" <?php }?> class="celda_normal" onkeyup="myFunction(this.parentNode.id,this.id,this.textContent);" id = "<?php if($flag == 1 or $flag2 == 1) {echo $row.'row'.$col.'WS';} else { echo $row.'row'.$col.'W';}?>" <?php if($flag == 1 or $flag2 == 1){ echo "style='background: #f9cd86 ;'";} else if($todayflag == 1){ echo "style='background: #f7e6ff ;'"; }?> contenteditable = "true" tabindex="<?php echo $col;?>"> <?php if(!empty($a->$WH)){echo $a->$WH;} else { echo '0';}?></td>
|
||||
<td <?php if($flag2 == 1){ ?> title = " <?php echo $title; ?> " <?php } else if($flag == 1 ){ ?> title = "sunday" <?php }?> class="celda_normal" onkeyup="myFunction(this.parentNode.id,this.id,this.textContent);" id = "<?php if($flag == 1 or $flag2 == 1) {echo $row.'row'.$col.'OTS';} else { echo $row.'row'.$col.'OT';}?>" <?php if($flag == 1 or $flag2 == 1){ echo "style='background: #f9cd86 ;'";} else if($todayflag == 1){ echo "style='background: #f7e6ff ;'"; }?> contenteditable = "true" tabindex="<?php echo $col;?>"> <?php if(!empty($a->$OT)){echo $a->$OT;} else { echo '0';}?></td>
|
||||
|
||||
<?php $flag =0;
|
||||
$flag2 =0;
|
||||
$flag2 =0;
|
||||
$todayflag = 0;
|
||||
}?>
|
||||
<td class="celda_normal" id="<?php echo $row.'TH';?>"><?php if(!empty($a->Total_WHrs)){echo $a->Total_WHrs;}else{echo "0.00";}?></td>
|
||||
<td class="celda_normal" id="<?php echo $row.'OTH';?>"><?php if(!empty($a->Total_OTHrs)){echo $a->Total_OTHrs;}else{echo "0.00";}?></td>
|
||||
@ -464,18 +426,9 @@ $attendance = array_merge($attendance,$emppay);
|
||||
|
||||
//alert(currentmonth);
|
||||
var currentdate = '01-'+currentmonth+'-'+currentyear;
|
||||
//alert(currentdate);
|
||||
// var today = new Date();
|
||||
// alert(today);
|
||||
// var day =today.getDate();
|
||||
// alert(day);
|
||||
// var month =today.getMonth();
|
||||
// month++;
|
||||
// alert(month);
|
||||
// var year = today.getFullYear();
|
||||
// alert(year);
|
||||
var totaldata = 0;
|
||||
$('#content').loader('hide');
|
||||
|
||||
var totaldata = 0;
|
||||
$('.content').loader('show');
|
||||
$.ajax({
|
||||
data:{param1:alldata,param2:currentdate,param3:Totalnoofdays},
|
||||
//dataType:"json",
|
||||
@ -485,7 +438,7 @@ $attendance = array_merge($attendance,$emppay);
|
||||
success:function(data) {
|
||||
if(data)
|
||||
{
|
||||
$('#content').loader('hide');
|
||||
$('.content').loader('hide');
|
||||
alert(data);
|
||||
//totaldata = totaldata + parseFloat(data);
|
||||
//console.log(data);
|
||||
@ -511,8 +464,9 @@ $attendance = array_merge($attendance,$emppay);
|
||||
$("#attendance").CongelarFilaColumna({lboHoverTr:true});
|
||||
$('html').bind('keypress', function(e)
|
||||
{
|
||||
//alert(e.which || e.keyCode);
|
||||
if(((e.which || e.keyCode) == 8) || ((e.which || e.keyCode) == 9) || ((e.which || e.keyCode) == 46) || ((e.which || e.keyCode) == 37) || ((e.which || e.keyCode) == 39))
|
||||
|
||||
|
||||
if(((e.which || e.keyCode) == 8) || ((e.which || e.keyCode) == 9) || ((e.which || e.keyCode) == 46) || ((e.which || e.keyCode) == 37) || ((e.which || e.keyCode) == 39))
|
||||
{
|
||||
|
||||
return true;
|
||||
@ -531,17 +485,44 @@ $attendance = array_merge($attendance,$emppay);
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
$('td').focus(function(e){
|
||||
|
||||
var id = e.target.id;
|
||||
var val = document.getElementById(id).textContent
|
||||
console.log(val);
|
||||
if(val == 0)
|
||||
{
|
||||
window.setTimeout(function(){ document.getElementById(id).textContent = ''; }, 0);
|
||||
}
|
||||
});
|
||||
|
||||
$('td').focusout(function(e){
|
||||
|
||||
var id = e.target.id;
|
||||
var val = document.getElementById(id).textContent
|
||||
if(val == '')
|
||||
{
|
||||
window.setTimeout(function(){ document.getElementById(id).textContent = '0'; }, 0);
|
||||
}
|
||||
console.log(val);
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
function myFunction(p,i,v)
|
||||
function myFunction(p,i,v,k)
|
||||
{
|
||||
//alert(p+"-"+i+"-"+v);
|
||||
//alert(p+"-"+i+"-"+v);
|
||||
//alert(v);
|
||||
// alert(k.keyCode);
|
||||
var v = v;
|
||||
var i =i;
|
||||
var id = i.substr(-1);
|
||||
//alert(id);
|
||||
@ -550,13 +531,6 @@ function myFunction(p,i,v)
|
||||
var nxtvalue = 0;
|
||||
var curvalue = 0;
|
||||
var curid =0;
|
||||
// if(v == 0)
|
||||
// {
|
||||
// // document.getElementById(i).innerHTML = parseFloat(0);
|
||||
// document.getElementById(i).style.backgroundColor="red";
|
||||
// }else{
|
||||
// document.getElementById(i).style.backgroundColor="#fff";
|
||||
// }
|
||||
|
||||
|
||||
if(v > 24)
|
||||
@ -564,27 +538,22 @@ function myFunction(p,i,v)
|
||||
alert('Working Hrs Do Not Exceed 24 HRs');
|
||||
|
||||
$(i).focus();
|
||||
document.getElementById(i).innerHTML = parseFloat(0);
|
||||
document.getElementById(i).textContent = '';
|
||||
return false;
|
||||
}
|
||||
if(id == 'W' && v > 8){ // checking working hrs vallue is more than 8, if it is set as OT Hrs more than 8
|
||||
|
||||
if(len == 3)
|
||||
{
|
||||
nxtid = i.substr(1,1)
|
||||
}
|
||||
else if(len == 4)
|
||||
{
|
||||
nxtid = i.substr(1,2)
|
||||
}
|
||||
var j='#'+i;
|
||||
var nextid = $(j).closest('td').next('td');
|
||||
nxtid = nextid[0].attributes[2].value;
|
||||
//console.log(nextid[0].attributes[2].value);
|
||||
console.log(nextid);
|
||||
|
||||
nxtvalue = v-8;
|
||||
curvalue = 8;
|
||||
|
||||
nxtid = p+nxtid+'OT';
|
||||
curid = i;
|
||||
|
||||
|
||||
|
||||
document.getElementById(i).innerHTML = parseFloat(curvalue)
|
||||
document.getElementById(nxtid).innerHTML = parseFloat(nxtvalue)
|
||||
|
||||
@ -593,8 +562,31 @@ function myFunction(p,i,v)
|
||||
|
||||
alert("OT Should not exceed 16 Hrs");
|
||||
$(i).focus();
|
||||
document.getElementById(i).innerHTML = parseFloat(0);
|
||||
document.getElementById(i).innerHTML = '';
|
||||
}
|
||||
else if(id == 'S' && v > 16)
|
||||
{
|
||||
var j='#'+i;
|
||||
console.log(i);
|
||||
console.log('********************************************');
|
||||
var nextid = $(j).closest('td').next('td');
|
||||
console.log(nextid);
|
||||
console.log('********************************************');
|
||||
nxtid = nextid[0].attributes[3].value;
|
||||
console.log('********************************************');
|
||||
console.log(nxtid);
|
||||
//console.log(nextid[0].attributes[2].value);
|
||||
|
||||
nxtvalue = v-16;
|
||||
curvalue = 16;
|
||||
|
||||
curid = i;
|
||||
|
||||
document.getElementById(i).innerHTML = parseFloat(curvalue)
|
||||
document.getElementById(nxtid).innerHTML = parseFloat(nxtvalue)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
var totalworkingHrs=0;
|
||||
@ -630,74 +622,33 @@ function myFunction(p,i,v)
|
||||
}
|
||||
if((index != 0) && (index !=1) && (index != 2))// && (index > totaldays))
|
||||
{
|
||||
|
||||
//alert(value.id+"-"+value.textContent);
|
||||
|
||||
var str = value.id;
|
||||
|
||||
var str1 = str.substr(-1);
|
||||
var str2 = str.substr(-2);
|
||||
var str3 = str.substr(-3);
|
||||
|
||||
if(str1 == 'W')
|
||||
{
|
||||
var current = value.textContent == '' ? 0:parseFloat(value.textContent);
|
||||
totalworkingHrs += current;
|
||||
if(current == 0){paidleave++;}
|
||||
}
|
||||
else
|
||||
{
|
||||
var current = value.textContent == '' ? 0:parseFloat(value.textContent);
|
||||
totalOTHrs = totalOTHrs+current;
|
||||
|
||||
var str = value.id;
|
||||
var temp = str.length;
|
||||
var res = '';
|
||||
switch(temp)
|
||||
{
|
||||
case 3:
|
||||
var current = value.textContent == '' ? 0:parseFloat(value.textContent);
|
||||
totalworkingHrs += current;
|
||||
if(current == 0){paidleave++;}
|
||||
break;
|
||||
|
||||
case 4: res = str.substr(-2);
|
||||
if(res == 'OT' )
|
||||
{
|
||||
var current = value.textContent == '' ? 0:parseFloat(value.textContent);
|
||||
totalOTHrs = totalOTHrs+current;
|
||||
}
|
||||
else if(res == 'WS')
|
||||
{
|
||||
var current = value.textContent == '' ? 0:parseFloat(value.textContent);
|
||||
totalOTHrs = totalOTHrs+current;
|
||||
}else
|
||||
{
|
||||
var current = value.textContent == '' ? 0:parseFloat(value.textContent);
|
||||
totalworkingHrs += current;
|
||||
if(current == 0){paidleave++;}
|
||||
}
|
||||
break;
|
||||
|
||||
case 5: res = str.substr(-3);
|
||||
if(res == 'OTS' )
|
||||
{
|
||||
var current = value.textContent == '' ? 0:parseFloat(value.textContent);
|
||||
totalOTHrs = totalOTHrs+current
|
||||
}
|
||||
else
|
||||
{
|
||||
res = str.substr(-2);
|
||||
if(res == 'WS')
|
||||
{
|
||||
var current = value.textContent == '' ? 0:parseFloat(value.textContent);
|
||||
totalOTHrs = totalOTHrs+current
|
||||
}
|
||||
else if(res == 'OT')
|
||||
{
|
||||
var current = value.textContent == '' ? 0:parseFloat(value.textContent);
|
||||
totalOTHrs = totalOTHrs+current;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 6: res = str.substr(-3);
|
||||
if(res == 'OTS' )
|
||||
{
|
||||
var current = value.textContent == '' ? 0:parseFloat(value.textContent);
|
||||
totalOTHrs = totalOTHrs+current;
|
||||
}
|
||||
break;
|
||||
|
||||
default://alert('Nothing');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// break;
|
||||
});
|
||||
|
||||
|
||||
|
||||
if(paidleave == 1 )
|
||||
@ -716,7 +667,24 @@ function myFunction(p,i,v)
|
||||
document.getElementById(totalothrsid).innerHTML = parseFloat(totalOTHrs).toFixed(2);// == ''?0:parseFloat(totalOTHrs));
|
||||
document.getElementById(paidleaveid).innerHTML = parseFloat(paidleave).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);
|
||||
}
|
||||
|
||||
function FindInvalide()
|
||||
{
|
||||
var Row = $('#attendance').find('tr');
|
||||
//console.log(Row);
|
||||
$.each(Row,function(index,value){
|
||||
//console.log(index+'-'+value);
|
||||
var td = $(value).find('td');
|
||||
$.each(td,function(iter,val){
|
||||
console.log(iter+'-'+val.id+'-'+val.textContent);
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
$CompanyStateCode='';
|
||||
$SuplierName = '';
|
||||
$SuplierAddress = '';
|
||||
$DeliveryAddress = '';
|
||||
,$DeliveryAddress = '';
|
||||
$Podt = '';
|
||||
$DeliveryDate ='';
|
||||
$DeliverySchedule='';
|
||||
@ -159,7 +159,7 @@
|
||||
" /></td>
|
||||
<td style="text-align: left;border-left-style:hidden;" colspan="5" rowspan="2">
|
||||
<span><strong style="font-size:16px;padding-left: 2px;"> <?php echo $CompanyName; ?></strong></span><br>
|
||||
<span style="padding-left: 2px;"><?php echo $CompanyAddress; ?></span><br><br>
|
||||
<span style="padding-left: 2px;"><?php echo $CompanyAddress; ?></span><br><br> <p> </p>
|
||||
<table style="margin-left: -1px;">
|
||||
<tr>
|
||||
<td style="border: none;">
|
||||
|
||||
@ -4,10 +4,12 @@
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
// print_r($loanrecords);
|
||||
date_default_timezone_set("Asia/Kolkata");
|
||||
$dateflag=0;
|
||||
$statusflag =0;
|
||||
$source = array('company'=>'Select Employee');
|
||||
$overdueflag = 0;
|
||||
$source = array('company'=>'Company');
|
||||
$historytableflag = 0;
|
||||
if(!empty($childdata) )
|
||||
{
|
||||
@ -20,17 +22,43 @@
|
||||
|
||||
foreach($loanrecords as $r)
|
||||
{
|
||||
|
||||
//print_r($r);
|
||||
if(!empty($r->Loan_Issued_Date))
|
||||
{
|
||||
$dateflag=1;
|
||||
$statusflag=1;
|
||||
|
||||
}
|
||||
|
||||
if(!empty($r->Due_Start_Date) && !empty($r->No_of_Dues))
|
||||
{
|
||||
// echo date('Y-m-d h:m:s');
|
||||
// echo $r->Due_Start_Date;
|
||||
$noofdus = $r->No_of_Dues;
|
||||
$time=strtotime($r->Due_Start_Date);
|
||||
$month=date("m",$time);
|
||||
$finalmonth = $month+($noofdus-1);
|
||||
//echo $finalmonth;
|
||||
$curmonth = date('m');
|
||||
//echo $curmonth;
|
||||
if($curmonth > $finalmonth)
|
||||
{
|
||||
// echo 'overdue';
|
||||
//echo ($curmonth - $finalmonth);
|
||||
$overdueflag = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(!empty($loanemployees))
|
||||
{
|
||||
foreach($loanemployees as $l)
|
||||
@ -182,6 +210,7 @@
|
||||
$totalloangiven = 0;
|
||||
$totalrecovered = 0;
|
||||
$totalbalance = 0;
|
||||
//$overdue = 0;
|
||||
$base=base_url();
|
||||
if(!empty($loanrecords))
|
||||
{
|
||||
@ -201,8 +230,30 @@
|
||||
<td style="text-align:right;"><?php if(!empty($rec->Loan_Issued_Date)){echo $rec->Loan_Issued_Date;}else{echo "-";}?></td>
|
||||
<?php }?>
|
||||
<td style="text-align:right;"><?php if(!empty($rec->Paid_Amount)){$totalrecovered+=$rec->Paid_Amount ;echo $rec->Paid_Amount;}else{echo "0.00";} ?></td>
|
||||
<?php if($statusflag == 1) {?>
|
||||
<td style="text-align:center;" ><?php $final = ''; if($rec->is_Active == 1){$final = "<font color='blue'>Pending</font>"; }else{$final = "<font color='green'>Completed</font>";} if($rec->Remaining_Due < 0 and $rec->is_Active == 1){$final.=",<font color='red'>Over Due</font>";} echo $final;?></td>
|
||||
<?php if($statusflag == 1) {
|
||||
// if(!empty($rec->Due_Start_Date) && !empty($rec->No_of_Dues))
|
||||
// {
|
||||
|
||||
// // echo $rec->Due_Start_Date;
|
||||
// $noofdus = $rec->No_of_Dues;
|
||||
// $time=strtotime($rec->Due_Start_Date);
|
||||
// $month=date("m",$time);
|
||||
// $finalmonth = $month+$noofdus;
|
||||
// // echo $finalmonth;
|
||||
// $curmonth = date('m');
|
||||
// if($curmonth > $finalmonth)
|
||||
// {
|
||||
// //echo 'overdue';
|
||||
// //echo ($curmonth > $finalmonth);
|
||||
// $overdueflag = 1;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// }
|
||||
|
||||
?>
|
||||
<td style="text-align:center;" ><?php $final = ''; if($rec->is_Active == 1){$final = "<font color='blue'>Pending</font>"; }else{$final = "<font color='green'>Completed</font>";} if($overdueflag == 1 and $rec->is_Active == 1){$final.=",<font color='red'>Over Due</font>";} echo $final;?></td>
|
||||
<?php }?>
|
||||
<td style="text-align:right;"><?php if(!empty(($rec->Loan_Amount) and ($rec->Paid_Amount))){ $totalbalance+= ($rec->Loan_Amount - $rec->Paid_Amount);echo number_format(($rec->Loan_Amount - $rec->Paid_Amount),2,'.','');}else {echo "0.00";}?></td>
|
||||
</tr>
|
||||
@ -382,5 +433,4 @@ var name = "<?php echo 'Loan Report - ' . $selsource . ' for ' . $fyear;?>";
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</script>
|
||||
18
application/views/monthlypayinputs.php
Normal file → Executable file
18
application/views/monthlypayinputs.php
Normal file → Executable file
@ -184,10 +184,10 @@ $('html').bind('keypress', function(e)
|
||||
<td style="text-align:right;" style="background-color:blue;"><?php echo $index; ?></td>
|
||||
<td style="text-align:right;"><?php echo $record->EmpID ?></td>
|
||||
<td><?php echo $record->FirstName ." ". $record->LastName ?></td>
|
||||
<td <?php if(empty($record->Key)){echo "contenteditable='true';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> ><?php if(!empty($record->Days_worked)){echo $record->Days_worked;}else{echo "0.00";}?></td>
|
||||
<td <?php if(empty($record->Key)){echo "contenteditable='true';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> ><?php if(!empty($record->LOP_Days)){echo $record->LOP_Days;}else{echo "0.00";}?></td>
|
||||
<td <?php if(empty($record->Key)){echo "contenteditable='true';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> ><?php if(!empty($record->Paid_leave)){echo number_format($record->Paid_leave,2,'.','');}else { echo number_format(0.00,2,'.','');} ?></td>
|
||||
<td <?php if(empty($record->Key)){echo "contenteditable='true';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> ><?php if(!empty($record->OT_Hrs_Worked)){echo $record->OT_Hrs_Worked;}else { echo number_format(0.00,2,'.','');} ?></td>
|
||||
<td <?php if(empty($record->Key)){echo "contenteditable='false';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> ><?php if(!empty($record->Days_worked)){echo $record->Days_worked;}else{echo "0.00";}?></td>
|
||||
<td <?php if(empty($record->Key)){echo "contenteditable='false';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> ><?php if(!empty($record->LOP_Days)){echo $record->LOP_Days;}else{echo "0.00";}?></td>
|
||||
<td <?php if(empty($record->Key)){echo "contenteditable='false';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> ><?php if(!empty($record->Paid_leave)){echo number_format($record->Paid_leave,2,'.','');}else { echo number_format(0.00,2,'.','');} ?></td>
|
||||
<td <?php if(empty($record->Key)){echo "contenteditable='false';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> ><?php if(!empty($record->OT_Hrs_Worked)){echo $record->OT_Hrs_Worked;}else { echo number_format(0.00,2,'.','');} ?></td>
|
||||
<td <?php if(empty($record->Key)){echo "contenteditable='true';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> ><?php if(!empty($record->Loan_Recovered)){if(is_numeric($record->Loan_Recovered)){echo number_format($record->Loan_Recovered,2,'.','');}else {echo $record->Loan_Recovered;}}else{echo number_format(0.00,2,'.','');} ?></td>
|
||||
<td <?php if(empty($record->Key)){echo "contenteditable='true';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> ><?php if(!empty($record->Incentives)){echo $record->Incentives;}else{ echo number_format(0.00,2,'.','');;} ?></td>
|
||||
<td <?php if(empty($record->Key)){echo "contenteditable='true';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> ><?php if(!empty($record->Other_Deductions)){echo $record->Other_Deductions; }else{ echo number_format(0.00,2,'.','');;} ?></td>
|
||||
@ -318,6 +318,7 @@ $('html').bind('keypress', function(e)
|
||||
var finaldate = month.concat(hyphan);
|
||||
var finaldate = finaldate.concat(res[1]);
|
||||
//alert(finaldate);
|
||||
$('.content').loader('show');
|
||||
$.ajax({
|
||||
data:{param1:finaldate},
|
||||
|
||||
@ -371,10 +372,10 @@ $('html').bind('keypress', function(e)
|
||||
'<td style="text-align:right;">' + (i) + '</td>' +
|
||||
'<td style="text-align:right;">' + val.EmpID + '</td>' +
|
||||
'<td>' + val.FirstName+" "+ val.LastName + '</td>' +
|
||||
'<td contenteditable="true" style="text-align:right;">' + Days_Worked + '</td>' +
|
||||
'<td contenteditable="true" style="text-align:right;">' + LOP_Days + '</td>' +
|
||||
'<td contenteditable="true" style="text-align:right;">' + Paid_leave + '</td>' +
|
||||
'<td contenteditable="true" style="text-align:right;">' + OT_Hrs_Worked + '</td>' +
|
||||
'<td contenteditable="false" style="text-align:right;">' + Days_Worked + '</td>' +
|
||||
'<td contenteditable="false" style="text-align:right;">' + LOP_Days + '</td>' +
|
||||
'<td contenteditable="false" style="text-align:right;">' + Paid_leave + '</td>' +
|
||||
'<td contenteditable="false" style="text-align:right;">' + OT_Hrs_Worked + '</td>' +
|
||||
'<td contenteditable="true" style="text-align:right;">' + Loan_Recovered + '</td>' +
|
||||
'<td contenteditable="true" style="text-align:right;">' + Incentives + '</td>' +
|
||||
'<td contenteditable="true" style="text-align:right;">' + Other_Deductions+ '</td>' +
|
||||
@ -386,6 +387,7 @@ $('html').bind('keypress', function(e)
|
||||
// //alert(trHTML);
|
||||
//alert(temparray);
|
||||
$('#monthlyListings > tbody').append(trHTML);
|
||||
$('.content').loader('hide');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
0
application/views/paysliplist.php
Normal file → Executable file
0
application/views/paysliplist.php
Normal file → Executable file
4
application/views/publicholidays.php
Normal file → Executable file
4
application/views/publicholidays.php
Normal file → Executable file
@ -144,7 +144,7 @@ $('html').bind('keypress', function(e)
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
$('#phday0s').DataTable({
|
||||
$('#phdays').DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": true,
|
||||
"searching": true,
|
||||
@ -196,7 +196,7 @@ function DeleteRow(rowid)
|
||||
$('#Add').click(function(){
|
||||
|
||||
var index = $('#phdays tr').length;
|
||||
|
||||
//alert(index);
|
||||
var temp = index;
|
||||
var H_name = $('#hname').val();
|
||||
var H_date = $('#hdate').val();
|
||||
|
||||
@ -166,7 +166,7 @@
|
||||
<tbody>
|
||||
|
||||
<tr style="border: none;"><td style="border-right: 1px solid black;
|
||||
border-left: 1px solid black;"></td><td style="border-right: 1px solid black;
|
||||
border-left: 1px solid black;" class="sortable asc"></td><td style="border-right: 1px solid black;
|
||||
border-left: 1px solid black;"> <strong><?php if ($serviceDescription != ''){echo $serviceDescription;} else { echo '<br/>';} ?></strong></td><td style="border-right: 1px solid black;
|
||||
border-left: 1px solid black;"></td><td style="border-right: 1px solid black;
|
||||
border-left: 1px solid black;"></td><td style="border-right: 1px solid black;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user