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

28 lines
1.0 KiB
PHP

<?php //include('pdf_header.php');
include('includes/config/config.php');
include('includes/functions.php');
//include('pop_up_top.php');
header('Content-Type: application/force-download');
header('Content-disposition: attachment; filename=excel_department.xls');
?>
<table border="1">
<?php
$sql="select sbu_id,firm_id,sbu_name,head_emp_id from sub_business_unit";
// $result1 = mysqli_query($conn,$sql1);
// $rw=mysqli_fetch_array($result1);
//echo $sql;
$result = mysqli_query($conn,$sql);
//echo $result;
?><tr><th>Department Name</th><th>Bussiness Unit</th><th>Bussiness Unit Head</th></tr><?php
while($rowOfEmployee=mysqli_fetch_array($result)){
$department_name=getTableFieldValue('tbl_firms','firm_name','firm_id',"'". $rowOfEmployee['firm_id']."'");
$emp_id=getTableFieldValue('employee','fname','id',"'". $rowOfEmployee['head_emp_id']."'");
?><tr><td><?php echo $rowOfEmployee['sbu_name']?></td><td><?php echo $department_name?></td><td><?php echo $emp_id?></td></tr><?php
}
?>
</table>
<?php
//include('pdf_footer.php');
?>