<?php
$ti=time();
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=salary_report".$ti.".xls");
header("Pragma: no-cache");
header("Expires: 0");
#echo "<pre>";print_r($item);echo "</pre>";
#echo "</br> : ".count($item);
?>
<table class="table table-bordered table-striped filterTable" id="filterTable">
    <thead>
        <tr>
            <th width="10%"  class="align-center" style="font-size:15px">S.No</th>
            <th width="35%" class="align-center" style="width:200px;font-size:15px">Description</th>
            <th width="15%" class="align-center" style="width:250px;font-size:15px">Amount</th>
        </tr>
    </thead>
    <tbody>
        <?php
		$total_amt 		= 0;
        if (count($results) > 0) {
            $i = 0;
            foreach ($results as $key => $row) :
            	$total_amt += $row['amount'];   
        ?>
                <tr>
                    <td class="align-center"><?php echo ++$i; ?></td>
                    <td><?php echo $row['service_name']; ?></td>
                    <td class="align-center"><?php echo number_format($row['amount'], 2); ?></td>
                </tr>
            <?php endforeach; ?>
            	<tr>
                    <td colspan="2" align="right">Total</td>
                    <td align="right"><?php echo number_format($total_amt,2,'.','');?></td>
                </tr>
        <?php } else { ?>
            <tr>
                <td colspan="3" style="color: #0B6CCB;"><center>No Records Found!</center></td>
        	</tr>
    <?php } ?>
    </tbody>
</table>