<?php
$ti=time();
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=archanai_namelist_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 class="align-center">Name</th>
            <th class="align-center">Star</th>
            <th class="align-center">Name1</th>
            <th class="align-center">Star1</th>
            <th class="align-center">Name2</th>
            <th class="align-center">Star2</th>
        </tr>

		<?php 
		$start_date = (!empty($start_date)) ? $start_date : date('d-m-Y');                                  
		$end_date 	= (!empty($end_date)) ? $end_date : date('d-m-Y');
		
		if(count($results) > 0) { 
			$i = 0;
			foreach( $results as $key => $row) :
		?>
				<tr>
					<td class="align-center"><?php echo ++$i;?></td>
					<td><?php echo (!empty($row['bar_name_1'])) ? '<span class="lang-tamil">' . $row['bar_name_1'] . '</span>' : 'N/A';?></td>
					<td><?php echo $row['star_name1']; ?></td>
					<td><?php echo (!empty($row['bar_name_2'])) ? '<span class="lang-tamil">' . $row['bar_name_2'] . '</span>' : 'N/A';?></td>
					<td><?php echo $row['star_name2']; ?></td>
					<td><?php echo (!empty($row['bar_name_3'])) ? '<span class="lang-tamil">' . $row['bar_name_3'] . '</span>' : 'N/A';?></td>
					<td><?php echo $row['star_name3']; ?></td>
					
				</tr>
		<?php endforeach; ?>                                       
		<?php } else {?>
			<tr>
				<td colspan="7" style="color: #0B6CCB;"><center>No Records Found!</center></td>
			</tr>
		<?php } ?>
</table>