?
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_client_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->client_timesheet_start_date)." to ".$this->mastermodel->convertdatenormalformat($viewinfo->client_timesheet_end_date)."</strong></td></tr> </table>"; ?> <table class="sorttimesheet"> <?php $diff = abs(strtotime($viewinfo->client_timesheet_end_date) - strtotime($viewinfo->client_timesheet_start_date)); $days = floor($diff/(60*60*24)); $days++; ?> <tr> <th class="sltd">Sl No</th> <th class="large">Employee Name</th> <th class="medium">Employee No</th> <th class="large">Company Name</th> <?php $date=$viewinfo->client_timesheet_start_date; while (strtotime($date) <= strtotime($viewinfo->client_timesheet_end_date)) { echo "<th class='tiny'>".date ("d", strtotime($date))."</th>"; $date = date ("Y-m-d", strtotime("+1 day", strtotime($date))); } ?> <th class="medium">Normal Hrs</th> <th class="medium">OT Hrs</th> <th class="medium">HOT Hrs</th> <th class="medium">Total Hrs</th> <th class="medium">Normal Rate</th> <th class="medium">OT Rate</th> <th class="medium">HOT Rate</th> <th class="medium">Normal Amount</th> <th class="medium">OT Amount</th> <th class="medium">HOT Amount</th> <th class="medium">Total Amount</th> <th class="large">Status</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($viewinfo->client_timesheet_id); $x=1; $grand_working_hours=0; $grand_hours_basic=0; $grand_ot_hours=0; $grand_hot_hours=0; $grand_normal_amount=0; $grand_ot_amount=0; $grand_hot_amount=0; $grand_total_amount=0; $flag=''; $slno=1; foreach ($timesheet_details as $key => $row) { $trade[$key] = $row['trade_name']; } array_multisort($trade, SORT_ASC, $timesheet_details); foreach ($timesheet_details as $timesheet) { $alt=$slno%2; ?> <?php if($flag!=$timesheet['trade_name']) { $flag=$timesheet['trade_name']; if(isset ($trade_working_hours)) { ?> <tr> <td class="sltd"></td> <td class="large"></td> <td class="medium"></td> <td class="large"></td> <td colspan="<?=$days;?>" style="background-color: #DFE5E5;text-align: right;font-weight: bold;">Total</td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;"><?=number_format($trade_hours_basic,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;"><?=number_format($trade_ot_hours,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;"><?=number_format($trade_hot_hours,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;"><?=number_format($trade_working_hours,2);?></td> <td style="background-color: #DFE5E5;" colspan="3"></th> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;"><?=number_format($trade_normal_amount,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;"><?=number_format($trade_ot_amount,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;"><?=number_format($trade_hot_amount,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;"><?=number_format($trade_total_amount,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" class="large"></td> </tr> <?php } ?> <tr> <td class="sltd"></td> <td class="large"><strong><?=rtrim($flag,'-');?></strong></td> <td class="medium"></td> <td class="large"></td> <td colspan="<?=$days+11;?>"></td> </tr> <?php $slno=1; $trade_working_hours=0; $trade_hours_basic=0; $trade_ot_hours=0; $trade_hot_hours=0; $trade_normal_amount=0; $trade_ot_amount=0; $trade_hot_amount=0; $trade_total_amount=0; } if($slno%2==0) $alt="alt"; else $alt="alt1"; ?> <tr class="<?=$alt;?>" style="height:60px;" > <td class="sltd"><?=$slno++;?></td> <td class="large"><?=$timesheet['emp_non_full_name'];?></td> <td class="medium"><?=$timesheet['emp_non_no'];?><input type="hidden" name="employee_id[]" value="<?=$timesheet['client_timesheet_employee_id'];?>"/></td> <td class="large"><span style="width:500px"><?=substr($timesheet['0']?$timesheet['0']:'Horeitia',0,22);?></span></td> <?php $i=1; $total_hours=0; $normal_ot_hours=0; $holiday_ot_hours=0; $working_days=$days; $working_days=$days; $total_amount=0; $normal_hours=0; $attendance_days = $this->mastermodel->get_data('payroll_client_timesheet_details',$timesheet['client_timesheet_main_id'],'client_timesheet_main_id','client_timesheet_date'); $total_hours=0; foreach ($attendance_days as $att) { ?> <td class="tiny" style="text-align: right;"> <?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']; $total_hours+=$att['client_timesheet_no_hours']; } ?> </td> <?php $i++; } $normal_hours=$timesheet['normal_hours']; $holiday_ot_hours=$timesheet['hot_hours']; $normal_ot_hours=$timesheet['ot_hours']; ?> <td class="medium" style="text-align: right;"> <?php echo number_format($normal_hours, 2); ?> </td> <td class="medium" style="text-align: right;"> <?=number_format($normal_ot_hours, 2);?> </td> <td class="medium" style="text-align: right;"> <?=number_format($holiday_ot_hours, 2);?> </td> <td class="medium" style="text-align: right;"> <?=number_format($total_hours, 2);?> </td> <td class="medium" style="text-align: right;"> <?=number_format($timesheet['basic_rate'], 2);?> </td> <td class="medium" style="text-align: right;"> <?php $ot_rate=$timesheet['ot_rate']; echo number_format($ot_rate,2); ?> </td> <td class="medium" style="text-align: right;"> <?php $hot_rate=$timesheet['hot_rate']; echo number_format($hot_rate,2); ?> </td> <td class="medium" style="text-align: right;"> <?php $normal_amount=$normal_hours*$timesheet['basic_rate']; echo number_format($normal_amount,2); ?> </td> <td class="medium" style="text-align: right;"> <?php $ot_amount=$normal_ot_hours*$ot_rate; echo number_format($ot_amount,2); ?> </td> <td class="medium" style="text-align: right;"> <?php $hot_amount=$holiday_ot_hours*$hot_rate; echo number_format($hot_amount,2); ?> </td> <td class="medium" style="text-align: right;"> <?php $total_amount=$normal_amount+$ot_amount+$hot_amount; echo number_format($total_amount,2); ?> </td> <td class="large"><?=$timesheet['timesheet_status'];?></td> </tr> <?php $trade_working_hours+=$total_hours; $trade_hours_basic+=$normal_hours; $trade_ot_hours+=$normal_ot_hours; $trade_hot_hours+=$holiday_ot_hours; $trade_normal_amount+=$normal_amount; $trade_ot_amount+=$ot_amount; $trade_hot_amount+=$hot_amount; $trade_total_amount+=$total_amount; $grand_working_hours+=$total_hours; $grand_hours_basic+=$normal_hours; $grand_ot_hours+=$normal_ot_hours; $grand_hot_hours+=$holiday_ot_hours; $grand_normal_amount+=$normal_amount; $grand_ot_amount+=$ot_amount; $grand_hot_amount+=$hot_amount; $grand_total_amount+=$total_amount; } ?> <tr> <td class="sltd"></td> <td class="large"></td> <td class="medium"></td> <td class="large"></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" colspan="<?=$days;?>" style="text-align: right;font-weight: bold;">Total</td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" class="medium" style="text-align: right;font-weight: bold;"><?=number_format($trade_hours_basic,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" class="medium" style="text-align: right;font-weight: bold;"><?=number_format($trade_ot_hours,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" class="medium" style="text-align: right;font-weight: bold;"><?=number_format($trade_hot_hours,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" class="medium" style="text-align: right;font-weight: bold;"><?=number_format($trade_working_hours,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" colspan="3"></th> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" class="medium" style="text-align: right;font-weight: bold;"><?=number_format($trade_normal_amount,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" class="medium" style="text-align: right;font-weight: bold;"><?=number_format($trade_ot_amount,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" class="medium" style="text-align: right;font-weight: bold;"><?=number_format($trade_hot_amount,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" class="medium" style="text-align: right;font-weight: bold;"><?=number_format($trade_normal_amount+$trade_ot_amount+$trade_hot_amount,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" class="large"></td> </tr> <tr> <td class="sltd"></td> <td class="large"></td> <td class="medium"></td> <td class="large"></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" colspan="<?=$days;?>" style="text-align: right;font-weight: bold;">Grand Total</td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" class="medium" style="text-align: right;font-weight: bold;"><?=number_format($grand_hours_basic,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" class="medium" style="text-align: right;font-weight: bold;"><?=number_format($grand_ot_hours,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" class="medium" style="text-align: right;font-weight: bold;"><?=number_format($grand_hot_hours,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" class="medium" style="text-align: right;font-weight: bold;"><?=number_format($grand_working_hours,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" colspan="3"></th> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" class="medium" style="text-align: right;font-weight: bold;"><?=number_format($grand_normal_amount,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" class="medium" style="text-align: right;font-weight: bold;"><?=number_format($grand_ot_amount,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" class="medium" style="text-align: right;font-weight: bold;"><?=number_format($grand_hot_amount,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" class="medium" style="text-align: right;font-weight: bold;"><?=number_format($grand_normal_amount+$grand_ot_amount+$grand_hot_amount,2);?></td> <td style="background-color: #DFE5E5;text-align: right;font-weight: bold;" class="large"></td> </tr> </table> <?php $filename = "ClientTimesheet"; header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=".$filename.".xls"); header("Pragma: no-cache"); header("Expires: 0"); exit; ?>