?
Current Path : /home1/savoy/public_html/savoyglobal.net/hr/application/views/Timesheet/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/public_html/savoyglobal.net/hr/application/views/Timesheet/xls_manpower_timesheet.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); $this->load->view('documentreadyfunctions'); echo " <table> <tr><td colspan='7'><strong>".$viewinfo->purchase_order_company_name."</strong></td></tr> <tr><td colspan='7'><strong>Timesheet for ".$this->mastermodel->getSingleFieldValue('payroll_customer','customer_name','customer_id',$viewinfo->customer_id)." for ".$this->mastermodel->getSingleFieldValue('site','site_name','site_id',$viewinfo->purchase_order_site_id)." for the Period of ".$this->mastermodel->convertdatenormalformat($viewinfo->manpower_timesheet_end_date)." to ".$this->mastermodel->convertdatenormalformat($viewinfo->manpower_timesheet_end_date)."</strong></td></tr> <tr><td colspan='7'><strong>Company : ".$this->mastermodel->getSingleFieldValue('payroll_manpower_hiring','company_name','company_id',$viewinfo->manpower_timesheet_company_id)." for ".$this->mastermodel->getSingleFieldValue('site','site_name','site_id',$viewinfo->purchase_order_site_id)." for the Period of ".$this->mastermodel->convertdatenormalformat($viewinfo->manpower_timesheet_end_date)." to ".$this->mastermodel->convertdatenormalformat($viewinfo->manpower_timesheet_end_date)."</strong></td></tr> </table>"; ?> <table class="sorttimesheet"> <?php $diff = abs(strtotime($viewinfo->manpower_timesheet_end_date) - strtotime($viewinfo->manpower_timesheet_start_date)); $days = floor($diff/(60*60*24)); $days++; ?> <tr> <th class="sltd">Sl No</th> <th class="medium">Employee Name</th> <th class="medium">Employee No</th> <?php $date=$viewinfo->manpower_timesheet_start_date; while (strtotime($date) <= strtotime($viewinfo->manpower_timesheet_end_date)) { echo "<th class='tiny'>".date ("d", strtotime($date))."</th>"; $date = date ("Y-m-d", strtotime("+1 day", strtotime($date))); } ?> <th class='tiny'> Total Hrs </th> </tr> <?php $weekly_holidays=$this->mastermodel->getdatas('payroll_weekly_holiday','payroll_weekly_holiday_id'); $holiday=array(); foreach ($weekly_holidays as $weekly) { $holiday[]=$weekly['payroll_weekly_holiday']; } $timesheet_details=$this->timesheetmodel->get_timesheet_employee_details_manpower($viewinfo->manpower_timesheet_company_id,$viewinfo->purchase_order_id,$viewinfo->manpower_timesheet_start_date,$viewinfo->manpower_timesheet_end_date); if(!empty ($timesheet_details)) { $x=1; $grand_working_hours=0; $flag=''; foreach ($timesheet_details as $timesheet) { ?> <?php if($flag!=$timesheet['trade_name']) { $flag=$timesheet['trade_name']; if(isset ($trade_working_hours)) { ?> <tr> <td class="sltd" style="background-color: #DFE5E5;"></td> <td class="medium" style="background-color: #DFE5E5;"></td> <td class="medium" style="background-color: #DFE5E5;text-align: right;font-weight: bold;">Total</td> <td colspan="<?=$days+1;?>" style="background-color: #DFE5E5;text-align: right;font-weight: bold;"><?=number_format($trade_working_hours,2);?></td> </tr> <?php } ?> <tr> <td class="sltd"></td> <td class="medium"></td> <td class="medium"><strong><?=rtrim($flag,'-');?></strong></td> <td colspan="<?=$days+1;?>"></td> </tr> <?php $slno=1; $trade_working_hours=0; $trade_hours_basic=0; $trade_ot_hours=0; $trade_hot_hours=0; } ?> <tr> <td class="sltd"><?=$slno++;?></td> <td class="medium"><?=$timesheet['manpower_hiring_employee_name'];?></td> <td class="medium"><?=$timesheet['manpower_hiring_employee_no'];?> <input type="hidden" name="employee_id[]" value="<?=$timesheet['client_timesheet_employee_id'];?>"/> </td> <?php $i=1; $total_hours=0; $normal_hours=0; $normal_ot_hours=0; $holiday_ot_hours=0; $working_days=$days; $attendance_days = $this->timesheetmodel->get_attendance_days_manpower($timesheet['client_timesheet_main_id'],$viewinfo->manpower_timesheet_start_date,$viewinfo->manpower_timesheet_end_date); foreach ($attendance_days as $att) { ?> <td style="text-align: right;" class='tiny'> <?php if(!is_numeric($att['client_timesheet_no_hours'])) echo "<font color='#ff0000'>".$att['client_timesheet_no_hours']."</font>"; else echo $att['client_timesheet_no_hours']; ?> </td> <?php $i++; } ?> <?php $normal_hours = $timesheet['normal_hours']; $normal_ot_hours = $timesheet['ot_hours']; $holiday_ot_hours = $timesheet['hot_hours']; ?> <td style="text-align: right;" class='tiny'> <?php $total_hours = $normal_hours + $normal_ot_hours + $holiday_ot_hours ;?> <?=number_format($total_hours, 2);?> </td> </tr> <?php $trade_working_hours+=$total_hours; $grand_working_hours+=$total_hours; } ?> <tr> <td class="sltd" style="background-color: #DFE5E5;"></td> <td class="medium" style="background-color: #DFE5E5;"></td> <td class="medium" style="background-color: #DFE5E5;text-align: right;font-weight: bold;">Total</td> <td colspan="<?=$days+1;?>" style="background-color: #DFE5E5;text-align: right;font-weight: bold;"><?=number_format($trade_working_hours,2);?></td> </tr> <tr> <td class="sltd" style="background-color: #DFE5E5;"></td> <td class="medium" style="background-color: #DFE5E5;"></td> <td class="medium" style="background-color: #DFE5E5;text-align: right;font-weight: bold;">Grand Total</td> <td colspan="<?=$days+1;?>" style="background-color: #DFE5E5;text-align: right;font-weight: bold;"><?=number_format($grand_working_hours,2);?></td> </tr> <?php } ?> </table> <?php $filename = "ManpowerTimesheet"; header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=".$filename.".xls"); header("Pragma: no-cache"); header("Expires: 0"); exit; ?>