<table>
	<tr>
		<td style="text-align:center;">
			<img src="<?php echo $this->baseUrl ?>assets/images/LogoBill.bmp" style="width:250px;">
		</td>
	</tr>
    <tr>
		<td>
			<h4 style="border:0;">
				<b><?php echo $this->baseTitle ?></b>
			</h4>
		</td>
	</tr>
	<tr>
		<td>
			AWAL: <?php echo $this->data->awal ?>
		</td>
	</tr>
	<tr>
		<td>
			AKHIR: <?php echo $this->data->akhir ?>
		</td>
	</tr>
</table>
            
<?php
$cash = 0;
$debet = 0;
$credit = 0;
$qris = 0;
$deliv = 0;
$gtot = 0;
$stot = 0;
$diskg_nilai = 0;
$ctr = 0;
foreach($this->data->data as $r){
	$cash += $r->cash;
	$debet += $r->debet;
	$credit += $r->credit;
	$qris += $r->qris;
	$deliv += $r->deliv;
	$gtot += $r->gtot;
	$stot += $r->stot;
	$diskg_nilai += $r->diskg_nilai;
	$ppn_nilai += $r->ppn_nilai;
	$ctr += 1;
}
?>

<div class="totals">
    	<div class="text-center">
       		Total Orders : <?php echo $ctr ?>
    	</div>
		<hr>
    	<table style="width:100%; margin-top:8px; font-size:14px;">
        	<tr>
            	<td style="text-align:left;">SUB TOTAL</td>
            	<td style="text-align:right;">Rp <?php echo number_format($stot); ?></td>
       	 	</tr>
        	<tr>
            	<td style="text-align:left;">DISCOUNT</td>
            	<td style="text-align:right;">Rp <?php echo number_format($diskg_nilai); ?></td>
       	 	</tr>
        	<tr>
            	<td style="text-align:left;">PB1</td>
            	<td style="text-align:right;">Rp <?php echo number_format($ppn_nilai); ?></td>
       	 	</tr>
            <tr>
            	<td style="text-align:left;">GRAND TOTAL</td>
            	<td style="text-align:right;">Rp <?php echo number_format($gtot); ?></td>
       	 	</tr>
            <tr>
            	<td style="text-align:left;">CASH</td>
            	<td style="text-align:right;">Rp <?php echo number_format($cash); ?></td>
       	 	</tr>
            <tr>
            	<td style="text-align:left;">DEBET</td>
            	<td style="text-align:right;">Rp <?php echo number_format($debet); ?></td>
       	 	</tr>
            <tr>
            	<td style="text-align:left;">CREDIT</td>
            	<td style="text-align:right;">Rp <?php echo number_format($credit); ?></td>
       	 	</tr>
            <tr>
            	<td style="text-align:left;">QRIS</td>
            	<td style="text-align:right;">Rp <?php echo number_format($qris); ?></td>
       	 	</tr>
            <tr>
            	<td style="text-align:left;">DELIVERY</td>
            	<td style="text-align:right;">Rp <?php echo number_format($deliv); ?></td>
       	 	</tr>
    	</table>
</div>