?
Current Path : /home1/savoy/www/savoyglobal.net/drafthr/system/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/www/savoyglobal.net/drafthr/system/application/views/Report/hrleavebranchxls.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?> <?php if(!$company) $images=base_url() .'logo/default_header.jpg'; else { foreach($company as $company) { $loggo=$company['filename']; $images=base_url() .'logo/'.$loggo; // echo $image; } } $html =''; $image = '<img src="'.$images.'" width="285px" height="100px">'; $bullet = '<img src="'.base_url().'/assets/images/li_bullet.jpg" align="bottom">'; $html='<html><head><body style="margin: 20px 20px 30px 20px;"> <table width="100%" border="0" cellpadding="2" cellspacing="2"> <tr><td colspan="2" align="left">'.$image.'</td></tr></table><br/>'; $html.='<div style="text-align:center"><b><u>LEAVE REPORT</u></b> </div><br/><br/>'; if ($search == "") $search = 'search'; if($fromdate == '') $fromdate = 'fromdate'; if($todate=='') $todate = 'todate'; $branchname = $this->mastermodel->get_data_srow('ourbranch',$search,'id'); $html.='<table width="100%" class="sort">'; $stid='unknown'; if(count($viewinfo) > 0) { $staffidsort=array(); foreach($viewinfo as $key => $row) { $staffidsort[$key]=$row['staffid']; } array_multisort($staffidsort, SORT_DESC, $viewinfo); foreach($viewinfo as $row) { if($row['staffid']!=$stid) { $i=1; $stf=$this->mastermodel->get_data_srow('staffpersonaldetails',$row['staffid'],'id'); $html.='</table> <table class="reportheader"> <tr><td style="width:20%">Employee:</td><td>'.$stf->name.'</td></tr> <tr><td style="width:20%">Branch:</td><td>'.$branchname->branchname.'</td></tr> <tr><td style="width:20%">Period:</td><td>'; if ($todate != 'todate'){ $html.=$fromdate.' to '.$todate; } $html.='</td></tr> </table> <table width="100%" class="sort" border="1" cellpadding="1" cellspacing="-1"><thead><tr> <th style="background-color:#80C0FF;">Sl No.</th> <th style="background-color:#80C0FF;">Employee Name</th> <th style="background-color:#80C0FF;">From Date</th> <th style="background-color:#80C0FF;">To Date</th> <th style="background-color:#80C0FF;">No of Days</th> <th style="background-color:#80C0FF;">Type of Leave</th> <th style="background-color:#80C0FF;">Status</th> </tr></thead>'; $stid=$row['staffid']; } $fromdate1 = $this->mastermodel->convdatformat($row['fromdate']); $todate1 = $this->mastermodel->convdatformat($row['todate']); $noofdays=(strtotime($row['todate']) - strtotime($row['fromdate'])) / (60 * 60 * 24)+1; $html.='<tr ><td>'.$i++.'</td><td>'.$stf->name.'</td> <td>'.$fromdate1.'</td><td>'.$todate1.'</td><td>'.$noofdays.'</td><td>'.$row['leavename'].'</td><td>'.$row['leavestatus'].'</td> </tr>'; } } $html.='</table>'; $html.='</body></head></html>'; $filename = "Leave-Branch wise"; header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=".$filename.".xls"); header("Pragma: no-cache"); header("Expires: 0"); print $html; exit; ?>