ESH/client_list_excel.php
2024-10-23 18:28:06 +05:30

67 lines
1.8 KiB
PHP

<?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_client_list.xls');
error_reporting(E_ERROR | E_PARSE);
?>
<!-- <table width="100%">
<tr>
<td colspan="9" align="left"> Run Date : <?php echo date("d-M-Y"); ?></td>
<td width="25%" align="left"> User : <?php echo $username ?></td>
</tr>
</table> -->
<center>
<table border="1" style="text-align: center;" width="100%">
<?php
$sql = "SELECT * from client_master ORDER BY id DESC";
error_log($sql);
$result = mysqli_query($conn, $sql);
//echo $result;
?>
<tr bgcolor='#eeeeee'>
<td width="10%">Sr</td>
<td>Client Name</td>
<td>Client Location</td>
<td>Contact</td>
<td>Email</td>
<td>Remarks</td>
</tr>
<?php
$count = 1;
while ($row = mysqli_fetch_assoc($result)) {
extract($row_staff);
?>
<tr>
<td><?php echo $count ?></td>
<td><?php echo $row['client_name'] ?></td>
<td><?php
$id = $row['id'];
$get_location = "SELECT group_concat(client_location) as location from client_location where client_id = '" . $id . "'";
error_log("client location " . $get_location);
$result_get = mysqli_query($conn, $get_location);
$row_get = mysqli_fetch_assoc($result_get);
echo $locations = $row_get['location']; ?>
</td>
<td>
<?php echo $row['client_contact'] ?>
</td>
<td>
<?php echo $row['client_email'] ?>
</td>
<td>
<?php echo $row['remarks']?>
</td>
</tr>
<?php
$count++;
}
?>
</table>
</center>