ESH/staff_excel.php

49 lines
1.4 KiB
PHP
Raw Permalink Normal View History

2024-10-23 18:28:06 +05:30
<?php //include('pdf_header.php');
include('includes/config/config.php');
include('includes/functions.php');
header('Content-Type: application/force-download');
header('Content-disposition: attachment; filename=excel_staff_list.xls');
?>
<table border="1" style="text-align: center;">
<?php
$sql = "SELECT * from staff_master ORDER BY staff_id DESC";
$sql = base64_decode($filterkey);
$result = mysqli_query($conn, $sql);
//echo $result;
?>
<tr bgcolor='#eeeeee'>
<td align="center" width="2%">sr</td>
<td>EMPLOYEE NAME</td>
<td>EMPLOYEE Code</td>
<td>Gender</td>
<td>Category</td>
<td>Phone</td>
<td>Email ID</td>
<td>Address</td>
</tr>
<?php
$count = 1;
while ($row_staff = mysqli_fetch_assoc($result)) {
extract($row_staff);
?>
<tr>
<td><?php echo $count ?></td>
<td><?php echo $row_staff['staff_name'] ?></td>
<td><?php echo $row_staff['emp_code'] ?></td>
<td><?php echo $row_staff['gender'] ?></td>
<td><? echo getFieldFromTable('category_name','staff_category_master','id', $row_staff[
'staff_category']) ?></td>
<td><?php echo $row_staff['phone_number'] ?></td>
<td><? echo $row_staff['email_id'] ?></td>
<td><? echo $row_staff['address'] ?></td>
</tr>
<?php
$count++;
}
?>
</table>