?
Current Path : /home1/savoy/www/savoyglobal.net/sibs_draft/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/sibs_draft/system/application/views/Report/customersoarep.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?> <?php if($fromdate == '') $fromdate = 'fromdate'; if($todate=='') $todate = 'todate'; if($search=='') $search = 'search'; ?> <div class="select-bar"> <table width="100%"> <tr> <td> <label> <img src="<?=base_url()?>/assets/images/backbutton.png" title="Back" class="clickimage" onclick="loadproduction()" alt="Back" align = "center" width="25" height="25" /> </label> </td> <td align="center"> Customer SOA </td> <td align="right"> <label> <?=anchor('report/genrepcustomersoa/customersoarepxls/'.$fromdate.'/'.$todate.'/'.$search.'/'.$payment_status.'/'.$payment_mode.'/', '<img src="'.base_url().'/assets/images/xls.png" title="Excel" align = "center" width="20" height="20">',array('class'=>'delete','onclick'=>"return confirm('Are you sure want to download')"))?> </label> <label> <?=anchor('report/genrepcustomersoa/customersoareppdf/'.$fromdate.'/'.$todate.'/'.$search.'/'.$payment_status.'/'.$payment_mode.'/', '<img src="'.base_url().'/assets/images/pdf.png" title="PDF" align = "center" width="20" height="20">',array('class'=>'delete','onclick'=>"return confirm('Are you sure want to download')"))?> </label> </td> </tr> </table> </div> <table class="reportheader"> <tr> <td style="width:20%">Period:</td> <td> <?php if ($todate != 'todate') { ?> <?=$fromdate?> to <?=$todate?> <?php } ?> </td> </tr> </table> <table width="100%" class="sort"> <thead> <tr> <th>Sl No</th> <th style="width:10%">Policy Date</th> <th>Insured</th> <th>Quotation Ref No</th> <th>Policy No</th> <th>Insurance Company</th> <th>Cover</th> <th>Description</th> <th>Premium Amount</th> <th>Premium Received</th> <th>Balance</th> <th>Due (days)</th> </tr> </thead> <tbody> <?php $i=1; $premiumtotal = 0; $receivedtotal = 0; $pendingtotal = 0; foreach($viewinfo as $customer_id=>$customerArray) { $type=$this->customermodel->getSingleFieldValue('customers','type','id',$customer_id); if($type=="Individual") { $customer_name = $this->mastermodel->getSingleFieldValue('customer_personal_ind','insured','customer_id',$customer_id); } else { $customer_name = $this->mastermodel->getSingleFieldValue('customer_corp_info','insured','customer_id',$customer_id); } foreach ($customerArray as $insuranceArray) { $insuranc_premium_total = 0; $insuranc_received_total = 0; $insuranc_pending_total = 0; foreach ($insuranceArray as $updata) { ?> <tr> <td><?=$i++;?></td> <td><?php echo $this->mastermodel->convdatformat($updata['qdate']);?></td> <td><?=$customer_name;?></td> <td><?=$updata['qtnref'];?></td> <td><?=$updata['policy_no'];?> </td> <td><?=$updata['company_name'];?></td> <td><?=$updata['cover'];?></td> <td><?=$updata['description'];?></td> <td style="text-align:right"> <?=number_format($updata['premium']+$updata['policy_fees'], 2, '.', ',');?> </td> <?php $net = $updata['premium'] + $updata['policy_fees']; $premiumtotal+=$net; $insuranc_premium_total+=$net; $received = $updata['received_premium']; $pending = $net - $updata['received_premium']; $receivedtotal += $received; $pendingtotal += $pending; $insuranc_received_total += $received; $insuranc_pending_total += $pending; $now = time(); // or your date as well $your_date = strtotime($updata['qdate']); $datediff = $now - $your_date; ?> <td style="text-align:right"><?=number_format($received, 2, '.', ',');?></td> <td style="text-align:right"><?=number_format($pending, 2, '.', ',');?></td> <td><?php echo ($pending == 0) ? '0' : floor($datediff / (60 * 60 * 24));?></td> </tr> <?php } ?> <tr> <td colspan="8" align="center">Total premium due to <?=$updata['company_name'];?> by <?=$customer_name;?> (<?=$updata['currencycode'];?>) : </td> <td style="text-align:right"><?=number_format($insuranc_premium_total, 2, '.', ',')?></td> <td style="text-align:right"><?=number_format($insuranc_received_total, 2, '.', ',')?></td> <td style="text-align:right"><?=number_format($insuranc_pending_total, 2, '.', ',')?></td> <td></td> </tr> <?php } } if($viewinfo) { ?> <tr> <td colspan="8" align="center">Total (<?=$updata['currencycode'];?>)</td> <td style="text-align:right"><?=number_format($premiumtotal, 2, '.', ',')?></td> <td style="text-align:right"><?=number_format($receivedtotal, 2, '.', ',')?></td> <td style="text-align:right"><?=number_format($pendingtotal, 2, '.', ',')?></td> <td></td> </tr> <?php } ?> </tbody> </table>