?
Current Path : /home1/savoy/public_html/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/public_html/savoyglobal.net/drafthr/system/application/views/Report/plastfwisexls.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); if($fromdate == '') $fromdate = 'fromdate'; if($todate=='') $todate = 'todate'; $string = ""; if ($fromdate != 'fromdate') $string.=" -from $fromdate to $todate"; if($cover_id=='') $cover_id=='cover_id'; if(!$company) $loggo='default_header.jpg'; else { foreach($company as $company) { $loggo=$company['filename']; //echo $loggo; } } $i=1; $cvrid='unknown'; $incr =0; $cctot=0; $actot=0; $nettot=0; $gptot=0; $brcctot=0; $bractot=0; $brnettot=0; $brgptot=0; $stf=$this->mastermodel->get_data_srow('staffpersonaldetails',$search,'id'); $branchname = $this->mastermodel->get_newbranchname($search); $csv_output = "\t\t\t\t'Placing Slip Report - '.$stf->name.$string \n"; $csv_output .= "'Name: '.$stf->name\n"; $this->cezpdf->ezText('Code: '.$stf->employeeid,13); $csv_output .= "'Branch: '.$branchname\n"; $csv_output .= "Sl No\t Type\t Effective Date\t Quotation Ref No\t Insured/Policy No\t Insurer\t Gross Premium\t Brokerage Commission\t Agent Commission\t Net Premium"; $csv_output .= "\n"; if($viewinfo) { foreach($viewinfo as $updata) { $incr++; $comp=$this->mastermodel->get_data_srow('insurance_company',$updata['insurance_company_id'],'id'); $type=$this->customermodel->getSingleFieldValue('customers','type','id',$updata['customer_id']); if($type=="Individual") { $cus=$this->mastermodel->get_data_srow('customer_personal_ind',$updata['customer_id'],'customer_id'); } else { $cus=$this->mastermodel->get_data_srow('customer_corp_info',$updata['customer_id'],'customer_id'); } if($updata['cover_id']!=$cvrid && $incr!=1) { $i=1; $cov=$this->mastermodel->get_data_srow('covers',$cvrid,'id'); var_dump($cov); die(); $csv_output .= 'Cover: '. $cov->cover."\n"; $csv_output .= "\t\t\t\t\t\tTotal (".$updata['currencycode'].")\t".number_format($gptot, 2, '.', ',')."\t".number_format($cctot, 2, '.', ',')."\t".number_format($actot, 2, '.', ',')."\t".number_format($nettot, 2, '.', ',')."\t \n"; $cctot=0; $actot=0; $nettot=0; $gptot=0; } $bc=(($updata['premium']*$updata['brokerage'])/100); $ac=(($updata['premium']*$updata['percentage'])/100); $cc=$bc-$ac; $net=($updata['premium']- ($bc)); $net=($updata['premium']- ($bc)); $gp= $updata['premium']; $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'); $csv_output .= $i++."\t ".$updata['typeof_policy']."\t ".$this->mastermodel->convdatformat($updata['fromdate'])."\t ".$updata['quotation_ref']."\t ".$cus->insured."\t ". $updata['policyno']."\t ".$comp->company_name."\t ".number_format($updata['premium'], 2, '.', ',')."\t ".number_format($cc, 2, '.', ',')."\t ".number_format($cc, 2, '.', ',')."\t ".number_format($ac, 2, '.', ',')."\t ".number_format($net, 2, '.', ',')."\t "; $csv_output .= "\n"; $cvrid=$updata['cover_id']; } $csv_output .= "\t\t\t\t\t\tTotal (".$updata['currencycode'].")\t".number_format($gptot, 2, '.', ',')."\t".number_format($cctot, 2, '.', ',')."\t".number_format($actot, 2, '.', ',')."\t".number_format($nettot, 2, '.', ',')."\t \n"; $csv_output .= "\n"; $csv_output .= "\t\t\t\t\t\tTotal (".$updata['currencycode'].")\t".number_format($brgptot, 2, '.', ',')."\t".number_format($brcctot, 2, '.', ',')."\t".number_format($bractot, 2, '.', ',')."\t".number_format($brnettot, 2, '.', ',')."\t \n"; $csv_output .= "\n"; $cov=$this->mastermodel->get_data_srow('covers',$cvrid,'id'); } $filename = "Report_".date("Y-m-d_H-i",time()); header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=".$filename.".xls"); header("Pragma: no-cache"); header("Expires: 0"); print $csv_output; exit; ?>