csrtechnew.ohctech.in/excel_govemnet_participation.php
2025-04-14 13:28:09 +05:30

49 lines
1.5 KiB
PHP

<?php
include('includes/config/config.php');
include('includes/functions.php');
// Set headers for the Excel file
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename="Govemnet Participation List.xls"');
header('Pragma: no-cache');
header('Expires: 0');
?>
<h2 style="text-align: center;">Govemnet Participation List</h2>
<table border="1" cellspacing="0" cellpadding="5">
<?php
$sql = "SELECT * FROM govemnet_participation";
$result = mysqli_query($conn, $sql);
?>
<tr bgcolor='#eeeeee'>
<th width="5%">Sr No</th>
<th width="10%">Date</th>
<th width="10%">Name</th>
<th width="10%">Designation</th>
<th width="10%">Number</th>
<th width="10%">Village</th>
</tr>
<?php
$i = 1;
while ($rowOfprograme = mysqli_fetch_array($result)) {
?>
<tr>
<td style="text-align: center;"><?php echo $i; ?></td>
<td style="text-align: center;"><?php echo $rowOfprograme['participation_date']; ?></td>
<td style="text-align: center;"><?php echo $rowOfprograme['name']; ?></td>
<td style="text-align: center;"><?php echo getFieldFromTable('designation_name', 'designation', 'designation_id', $rowOfprograme['designation']); ?></td>
<td style="text-align: center;"><?php echo $rowOfprograme['number']; ?></td>
<td style="text-align: center;"><?php echo getFieldFromTable('village', 'village', 'id', $rowOfprograme['village']); ?></td>
</tr>
<?php
$i++;
}
?>
</table>
<?php
include('pdf_footer.php');
?>