81 lines
3.0 KiB
PHP
81 lines
3.0 KiB
PHP
|
<?php
|
||
|
|
||
|
include ('includes/config/config.php');
|
||
|
include ('includes/functions.php');
|
||
|
error_reporting(E_ERROR | E_PARSE);
|
||
|
header('Content-Type: application/force-download');
|
||
|
header('Content-disposition: attachment; filename=excel_emp_hygiene_work_report.xls');
|
||
|
// include('pop_up_top.php');
|
||
|
?>
|
||
|
<html>
|
||
|
|
||
|
<body>
|
||
|
<table width="100%">
|
||
|
<tr>
|
||
|
|
||
|
<td width="25%" align="left"> Run Date : <?php echo date("d-M-Y"); ?></td>
|
||
|
<td width="50%" align="center" >Hygiene Report</td>
|
||
|
<td width="25%" align="left"> User : <?php echo $username ?></td>
|
||
|
<?php if(isset($from_date) && isset($to_date)){?>
|
||
|
<td width="25%" align="right"> Range : <?php echo $from_date; ?> to <?php echo $to_date ;?></td>
|
||
|
|
||
|
<?php }?>
|
||
|
</tr>
|
||
|
</table>
|
||
|
<table border="1" width="100%">
|
||
|
<?php
|
||
|
$sql="select * from emp_hyg_check_master ";
|
||
|
//echo $sql;
|
||
|
$result = mysqli_query($conn,$sql);
|
||
|
// echo $result;
|
||
|
$count = 1;
|
||
|
?><tr bgcolor="#eeeeee">
|
||
|
<th width="5%" align="center">Sr. No</th>
|
||
|
<th width="15%" align="center">Employee Name</th>
|
||
|
<th width="15%" align="center">Checkup Date</th>
|
||
|
<th width="15%" align="center">Hygiene Parameter</th>
|
||
|
<th width="15%" align="center">Refrence Range</th>
|
||
|
<th width="15%" align="center">current Value</th>
|
||
|
|
||
|
</tr><?php
|
||
|
$count = 0;
|
||
|
while ($rowOfEmpHygiene = mysqli_fetch_array($result)) {
|
||
|
$empId = $rowOfEmpHygiene['emp_id'];
|
||
|
$sqlEmp = "select fname,lname from employee where id = '$empId'";
|
||
|
//echo $sqlEmp;
|
||
|
|
||
|
|
||
|
$hyg_check_id = $rowOfEmpHygiene['hyg_check_id'];
|
||
|
$hygieneParameter = "select * from emp_hyg_check_items where hyg_check_id = '$hyg_check_id'";
|
||
|
$resultHygieneParameter = mysqli_query($conn,$hygieneParameter);
|
||
|
$hygieneParameters = null;
|
||
|
$hygiene_currentValue=null;
|
||
|
$range=null;
|
||
|
while($rowOfhygieneParameter = mysqli_fetch_array($resultHygieneParameter)){
|
||
|
$hygiene_id = $rowOfhygieneParameter['hyg_para_id'];
|
||
|
$sqlParameterName = "select * from hygiene where hygiene_id ='$hygiene_id' ";
|
||
|
|
||
|
$resultParameterName = mysqli_query($conn,$sqlParameterName);
|
||
|
$rowParameterName = mysqli_fetch_array($resultParameterName);
|
||
|
$hygieneParameters = $hygieneParameters.$rowParameterName['hygiene_parameter'].'<br>';
|
||
|
$hygiene_currentValue = $hygiene_currentValue.$rowOfhygieneParameter['hyg_param_val'].'<br>';
|
||
|
$human_min_range=$rowParameterName['human_min_range'];
|
||
|
$human_max_range=$rowParameterName['human_max_range'];
|
||
|
$range=$range.$human_min_range."-".$human_max_range.'<br>';
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
$resultEmp = mysqli_query($conn,$sqlEmp);
|
||
|
$rowemp = mysqli_fetch_array($resultEmp);
|
||
|
// echo $rowemp['fname'];
|
||
|
|
||
|
?><tr><td align="center"><?php echo ++$count ?></td><td align="center"><?php echo $rowemp['fname'].' '.$rowemp['lname']?></td><td align="center"><?php echo date_format(date_create($row['checkup_date']),"d-M-Y h:i:sa ")?></td>
|
||
|
<td align="center"><?php echo $hygieneParameters?></td><td align="center"><?php echo $range?></td><td align="center"> <?php echo $hygiene_currentValue?></td>
|
||
|
|
||
|
</tr><?php
|
||
|
|
||
|
}
|
||
|
?>
|
||
|
</table>
|