?
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/claimbranchwisepdf.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?> <?php $branc=$this->customermodel->getSingleFieldValue('ourbranch','branchname','id',$branch); if($fromdate == '') $fromdate = 'fromdate'; if($todate=='') $todate = 'todate'; $string = "Claim Report-".$branc; if ($fromdate != 'fromdate') $string.=" -from $fromdate to $todate"; $i=1; if(!$company) $loggo='default_header.jpg'; else { foreach($company as $company) { $loggo=$company['filename']; //echo $loggo; } } $k=0; $cctot=0; $actot=0; $nettot=0; $gptot=0; $brcctot=0; $bractot=0; $brnettot=0; $brgptot=0; $cvrid='unknown'; $i=1; $col_names = array('col1' => 'Sl No','col2' => 'Insured','col3' => 'Cover/Policy No.','col4' => 'Insurer','col5' => 'Effective Date','col6' => 'Expiry Date','col7' => 'Account Holder','col8' => 'Gross Premium','col9' => 'Premium Received','col10' => 'Payments','col11' => 'Loss Ratio'); $this->cezpdf->cezpdf('a4', 'landscape'); $this->cezpdf->ezSetMargins(0,0,10,150); $image=base_url() .'/logo/'.$loggo; $this->cezpdf->ezImage($image,'0','150','','left',''); $this->cezpdf->ezSetMargins(0,0,30,30); $opt=array('justification' => 'center'); $this->cezpdf->ezText($string,15,$opt); $this->cezpdf->ezText(''); if($viewinfo) { foreach($viewinfo as $updata) { if($updata['premium']==0) $loss_ratio=0; else $loss_ratio=(($updata['settlement']/$updata['premium'])*100); $cov=$this->mastermodel->get_data_srow('covers',$updata['cover_id'],'id'); $k++; if($updata['cover_id']!=$cvrid && $k!=1) { $i=1; $cov=$this->mastermodel->get_data_srow('covers',$cvrid,'id'); $this->cezpdf->ezSetMargins(20,20,30,30); $this->cezpdf->ezText('Cover: '. $cov->cover,14); $this->cezpdf->ezText(''); $db_data1[] = array('col1' => '','col2' =>'','col3' =>'','col4' => '','col5' => '','col6' => '','col7' => '','col8' => '','col9' => '', 'col10' => '','col11' => ''); $db_data1[] = array('col1' => '','col2' =>'','col3' =>'','col4' => '','col5' => '','col6' => '','col7' => 'Total('.$updata['currencycode'].')','col8' =>number_format($gptot, 2, '.', ','),'col9' => number_format($cctot, 2, '.', ','), 'col10' => number_format($actot, 2, '.', ','),'col11' => number_format($nettot, 2, '.', ',')); $this->cezpdf->ezTable($db_data1, $col_names, '', array('showHeadings'=>1,'width'=>800, 'shaded'=>1,'cols'=>0,'showLines'=> 1 )); $cctot=0; $actot=0; $nettot=0; $gptot=0; $db_data1=""; } $gp= $updata['premium']; $cc=$updata['amount']; $ac=$updata['settlement']; $net=round($loss_ratio, 2); $cctot+=$cc; $actot+=$ac; $nettot+=$net; $gptot+=$gp; $brcctot+=$cc; $bractot+=$ac; $brnettot+=$net; $brgptot+=$gp; $this->cezpdf->ezSetMargins(20,20,30,30); $cov=$this->mastermodel->get_data_srow('covers',$updata['cover_id'],'id'); $db_data1[] = array('col1' => $i++,'col2' => $updata['insured'],'col3' => $updata['cover']."/".$updata['policyno'],'col4' => $updata['company_name'],'col5' => $this->mastermodel->convdatformat($updata['fromdate']),'col6' => $this->mastermodel->convdatformat($updata['todate']),'col7' => $updata['name'],'col8' => number_format($updata['premium'], 2, '.', ','),'col9' => number_format($updata['amount'], 2, '.', ','),'col10' => number_format($updata['settlement'], 2, '.', ','),'col11' => number_format($loss_ratio, 2, '.', ',')); $cvrid=$updata['cover_id']; } $db_data1[] = array('col1' => '','col2' =>'','col3' =>'','col4' => '','col5' => '','col6' => '','col7' => '','col8' => '','col9' => '', 'col10' => '','col11' => ''); $db_data1[] = array('col1' => '','col2' =>'','col3' =>'','col4' => '','col5' => '','col6' => '','col7' => 'Total ('.$updata['currencycode'].')','col8' =>number_format($gptot, 2, '.', ','),'col9' => number_format($cctot, 2, '.', ','), 'col10' => number_format($actot, 2, '.', ','),'col11' => number_format($nettot, 2, '.', ',')); $db_data1[] = array('col1' => '','col2' =>'','col3' =>'','col4' => '','col5' => '','col6' => '','col7' => 'Gross Total ('.$updata['currencycode'].')','col8' =>number_format($brgptot, 2, '.', ','),'col9' =>number_format($brcctot, 2, '.', ',') , 'col10' => number_format($bractot, 2, '.', ','),'col11' => number_format($brnettot, 2, '.', ',')); $cov=$this->mastermodel->get_data_srow('covers',$cvrid,'id'); $this->cezpdf->ezText(''); $this->cezpdf->ezText(''); $this->cezpdf->ezSetMargins(20,20,30,30); $this->cezpdf->ezText('Cover: '. $cov->cover,14); $this->cezpdf->ezText(''); } $this->cezpdf->ezTable($db_data1, $col_names, '', array('showHeadings'=>1,'width'=>800, 'shaded'=>1,'cols'=>0,'showLines'=> 1 )); $footer = $this->cezpdf->openObject(); $company=$this->mastermodel->get_data_srow('mycompany','1','id'); $this->cezpdf->addText(20, 10, 8, $company->company); $this->cezpdf->addText(710, 10, 8, $company->website); $this->cezpdf->line(0,20,900,20); $this->cezpdf->closeObject(); $this->cezpdf->addObject($footer, "all"); $this->cezpdf->ezStream(); ?>