<?php
$ti=time();
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=temple_expenses_report".$ti.".xls");
header("Pragma: no-cache");
header("Expires: 0");
?>
<table class="table table-bordered table-striped filterTable" id="filterTable">
        <tr>
            <th width="5%" class="align-center">S.No</th>
            <th>Expenses Type</th>
            <th>Subject Name</th>
            <th>Name</th>
            <th>Date</th>
            <th>Amount</th>
            <th>Description</th>
            <th>Expenses For</th>
        </tr>

		  <?php 
                                
			$total_amt = 0;
			foreach($results as $k => $r ) :
					//$total_amt += $r['exp_amount'];
				?>
				<tr>
					<td class="align-center"><?php echo $k+1; ?></td>
                    <td><?php echo $r['exp_type_name']; ?></td>
                    <td><?php echo $r['exp_subject']; ?></td>
                    <td><?php echo $r['exp_name']; ?></td>
                    <td><?php echo date("d-m-Y", strtotime($r['exp_date'])); ?></td>
                    <td class="align-right"><?php echo number_format($r['exp_amount'], 2, '.', ''); ?></td>
                    <td><?php echo text($r['exp_desc']); ?></td>
                    <td><?php echo $r['expenses_for']; ?></td>
				</tr>
		<?php 
			endforeach; 
		?>
        <!-- <?php if( !empty( $total_amt ) ) : ?>
            <tr>
                <td colspan="9" align="right"><b>Total</b></td>
                <td align="right"><b><?php echo number_format($total_amt,2,'.','');?></b></td>
            </tr>
        <?php endif; ?>-->
</table>