?
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/pdf_report_branch_target.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"><img src="'.base_url().'assets/images/'.$company_details->logo.'" width="400" height="148"/></td></tr> <tr><td colspan="3" style="font-size:16px;" align="center"><b><u>Sales Report - Branch Target</u></b></td></tr> </table><br><br>'; $html.='<hr>'; foreach($report as $rep) { $html.='<table cellspacing="-1" style="width:100%;text-align:left"> <thead> <tr>'; foreach($report as $key=>$val) { $column_name = array_keys($val); } foreach($column_name as $key) { if($key != 'branch_id') $html .= '<th style="text-align:left" bgcolor="#7FCEFF">'.str_replace('_', ' ', $key).'</th>'; } $html .='</tr></thead><tbody>'; $html.='<tr style="color:#555555">'; foreach($column_name as $key) { if($key != 'branch_id') { $column=strtolower($key); $pos=strpos($key, 'Date'); if($pos !== false) { $rep[$key]=$this->mastermodel->convertdatenormalformat($rep[$key]); } $html .= '<td>'.$rep[$key].'</td>'; $start_date=$rep['Start_Date']; $end_date=$rep['End_Date']; } } $html .='</tr>'; $html.='</tbody></table>'; $html.='<hr>'; $html.='<table cellspacing="-1" style="width:100%;text-align:left" border=1> <thead> <tr> <th style="text-align:left" bgcolor="#7FCEFF">Sl No</th> <th style="text-align:left" bgcolor="#7FCEFF">Customer Name</th> <th style="text-align:left" bgcolor="#7FCEFF">Quotaion Ref</th> <th style="text-align:left" bgcolor="#7FCEFF">Project</th> <th style="text-align:left" bgcolor="#7FCEFF">Date</th> <th style="text-align:left" bgcolor="#7FCEFF">Employee</th> <th style="text-align:left" bgcolor="#7FCEFF">Amount</th> </tr>'; $html .='</tr></thead><tbody>'; $target_details=$this->reportmodel->branch_target_details($rep['branch_id'],$start_date,$end_date); $i=1; foreach ($target_details as $target) { $html.='<tr>'; $html.="<td>".$i++."</td>"; $html.="<td>".$target['customer_name']."</td>"; $html.="<td>".$target['quotation_ref']."</td>"; $html.="<td>".$target['activity_name']."</td>"; $html.="<td>".$this->mastermodel->convertdatenormalformat($target['date'])."</td>"; $html.="<td>".$target['employee_name']."</td>"; $html.="<td>".$target['amount']."</td>"; $html.="</tr>"; } $html.="</tbody></table>"; } $html.='</body></html>'; $html.='<script type="text/php"> if ( isset($pdf) ) { $font = Font_Metrics::get_font("verdana", "normal"); $pdf->page_text(75, 570, "'.$company_details->footer.' Page {PAGE_NUM} of {PAGE_COUNT}", $font, 10, array(0,0,0)); } </script> </body></html>'; pdf_create($html, 'BranchTargetReport',1); ?>