?
Current Path : /home1/savoy/public_html/savoyglobal.net/sgms/application/views/Report/ |
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/sgms/application/views/Report/xls_report_salary.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); $company_details= $this->mastermodel->get_data_srow('company','1','company_id'); $html='<html><head><body>'; $html.='<table width="100%"> <tr><td colspan="3" style="font-size:16px;" align="center"><b><u>HR Report - Salary</u></b></td></tr> <tr><td colspan="3">Printout Date: '.date('d-m-Y').', '.date('h:i:s a').'</td></tr> </table><br><br>'; $html.='<hr>'; $html.='<table cellspacing="-1" style="width:100%;text-align:left"> <thead> <tr><th style="text-align:left" bgcolor="#7FCEFF">Sl No</th>'; foreach($report as $key=>$val) { $column_name = array_keys($val); } foreach($column_name as $key) $html .= '<th style="text-align:left" bgcolor="#7FCEFF">'.str_replace('_', ' ', $key).'</th>'; $html .='</tr></thead><tbody>'; $i=1; foreach($report as $rep) { $html.='<tr style="color:#555555"> <td>'.$i.'</td>'; foreach($column_name as $key) { $pos=strpos($key, 'Date'); if($pos !== false) { $rep[$key]=$this->mastermodel->convertdatenormalformat($rep[$key]); } $html .= '<td>'.$rep[$key].'</td>'; } $html .='</tr>'; $i++; } $html.='</tbody></table>'; $html.='<hr>'; $html.='</body></html>'; $filename = "SalaryReport"; header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=".$filename.".xls"); header("Pragma: no-cache"); header("Expires: 0"); print $html; exit; ?>