ESH/dlme_exam_report_excel.php

170 lines
7.4 KiB
PHP
Raw Normal View History

2024-10-23 18:28:06 +05:30
<?php //include('pdf_header_reverse.php');
include('includes/config/config.php');
include('includes/functions.php');
header("Content-type:application/octet-stream");
header("Content-type: application/x-msdownload");
header("Content-Disposition: attachment; filename=opd_report_excel.xls");
header("Pragma: no-cache");
header("Expires: 0");
$start = $_POST['dlme_startDate'];
$end = $_POST['dlme_endDate'];
?>
<link href="includes/css-js/admin.css" rel="stylesheet" type="text/css" />
<style>
@page {
margin: 15px;
}
.btn {
background-color: #4CAF50;
border-radius: 5%;
/* Green */
border: none;
color: white;
padding: 5px 8px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 12px;
margin: 4px 2px;
cursor: pointer;
}
@media print {
#printPageButton {
display: none;
}
}
</style>
<body>
<?php include('excel_ohc_header.php'); ?>
<table width="100%">
< <tr>
<td align="center" style="font-size: 18px;color:red"><strong>DLME Examination Report</strong></td>
</tr>
<tr>
<td align="center" style="font-size: 12px"><strong>(For Interval:
<?php echo $start." To ".$end ; ?>)</strong></td>
<td align="right" style="font-size: 15px"><button align="center" id="printPageButton"
class="btn btn-success" onClick="window.print();">Print</button></td>
</tr>
</table>
<br>
<table border="1" width="100%" cellspacing="0">
<tr bgcolor="#eeeeee">
<td align="left" width="2%"><strong>Sr N.</td>
<td align="left" width="3%"><strong>Screening Date</td>
<td align="left" width="4%"><strong>Name</td>
<td align="left" width="4%"><strong>Employer</td>
<td align="left" width="3%"><strong>ECode/G.Pass</td>
<td align="left" width="3%"><strong>Gender</td>
<td align="left" width="3%"><strong>Age</td>
<td align="left" width="3%"><strong>Blood group</td>
<td valign="top" align="left" width="5%"><strong>Designation</td>
<td valign="top" align="left" width="4%"><strong>Devision</td>
<td valign="top" align="left" width="4%"><strong>Department</td>
<td valign="top" align="left" width="3%"><strong>Ute</td>
<td valign="top" align="left" width="5%"><strong>Section</td>
<td valign="top" align="left" width="4%"><strong>Mobile No.</td>
<td valign="top" align="left" width="5%"><strong>Identification Marks</td>
<td valign="top" align="left" width="3%"><strong>Height</td>
<td valign="top" align="left" width="3%"><strong>weight</td>
<td valign="top" align="left" width="3%"><strong>BMI</td>
<td valign="top" align="left" width="2%"><strong>Blood Pressure</td>
<td valign="top" align="left" width="3%"><strong>Pulse</td>
<td valign="top" align="left" width="5%"><strong>Dis.Vision Rt Eye</td>
<td valign="top" align="left" width="5%"><strong>Dis.Vision Lt Eye</td>
<td valign="top" align="left" width="5%"><strong>Near Vision Rt Eye</td>
<td valign="top" align="left" width="5%"><strong>Near Vision Lt Eye</td>
<td valign="top" align="left" width="5%"><strong>Color Vision</td>
<td valign="top" align="left" width="8%"><strong>Fitness Status<strong></td>
</tr>
<?php
$count=1;
$appints=array();
$emp_ids=array();
$examination_finded_arr= array();
$emp_ids=array();
$examination_finded_arr= array();
$sql = "select a.*,c.*,a.height,a.weight,a.bmi,a.bp,a.pulse from questionaire_master_response a left join patient_master c on a.patient_id = c.id where date_format(date(screen_date),'%Y-%m-%d') between STR_TO_DATE('".$start."','%d-%m-%Y') and STR_TO_DATE('".$end."','%d-%m-%Y') and form_type = 'dlf' and f_status='CLS' and approval_status='Y'; ";
error_log('dlme'.$sql);
$result_sql = mysqli_query($conn,$sql);
$num_rows = mysqli_num_rows($result_sql);
while( $row = mysqli_fetch_assoc($result_sql)){
?>
<strong>
<tr bgcolor="#eeeeee">
<td align="left" width="2%"><?=$count?></td>
<td align="left" width="3%"><?= $date=date_format(date_create($row["screen_date"]), "d-m-Y")?></td>
<td align="left" width="4%"><?= $row['patient_name']?></td>
<td align="left" width="4%">
<?= getTableFieldValue('employer_contractor', 'employer_contractor_name', 'id', $row['employer_contractor_id'])?>
</td>
<td align="left" width="3%"><?= $row['emp_code']?></td>
<td align="left" width="3%"><?= $row['gender']?></td>
<td align="left" width="3%"><?= datediff($row['dob'],"age")?></td>
<td align="left" width="3%"><?= $row['blood_group']?></td>
<td valign="top" align="left" width="5%">
<?= getTableFieldValue('designation','designation_name','designation_id',$row['designation_id'] )?>
</td>
<td valign="top" align="left" width="4%">
<?= getTableFieldValue('bussiness_unit','bu_name','bu_id',$row['bu_id'] )?></td>
<td valign="top" align="left" width="3%">
<?= getTableFieldValue('department','dept_name','dept_id',$row['dept_id'] )?></td>
<td valign="top" align="left" width="3%">
<?= getTableFieldValue('section','section_name','section_id',$row['section_id'] )?></td>
<td valign="top" align="left" width="5%">
<?= getTableFieldValue('sub_section','sub_section_name','sub_section_id',$row['sub_section_id'] )?>
</td>
<td valign="top" align="left" width="4%"><?=$row['primary_phone']?></td>
<td valign="top" align="left" width="4%">
<?php if($row['id_mark1']!=null ||$row['id_mark1']!='' ) echo "(i)".$row['id_mark1'];
if($row['id_mark2']!=null ||$row['id_mark2']!='' ) echo " ,(ii)".$row['id_mark2']?></td>
<td valign="top" align="left" width="3%">
<?=$row['height'] ?>
</td>
<td valign="top" align="left" width="3%">
<?= $row['weight'] ?>
</td>
<td valign="top" align="left" width="3%">
<?=$row['bmi'] ?>
</td>
<td valign="top" align="left" width="2%"><?= $row['bp']?></td>
<td valign="top" align="left" width="2%">
<?= $row['pulse']?></td>
<td valign="top" align="left" width="5%"><?=(int)$row['distance_vis_rt'].'./6'?></td>
<td valign="top" align="left" width="5%"><?=(int)$row['distance_vis_lt'].'./6'?></td>
<td valign="top" align="left" width="5%"><?=$row['near_vis_rt']?></td>
<td valign="top" align="left" width="5%"><?=$row['near_vis_lt']?></td>
<td valign="top" align="left" width="5%"><?=$row['color_vis']?></td>
<td valign="top" align="left" width="8%"><?=$row['remarks']?></td>
</tr>
<?php $count++;
}
?>
<tr Height="10px">
<td colspan="10"><b>TOTAL: &nbsp;<?php echo $count-1 ?></b></td>
</tr>
</table>
</body>