ESH/free_from_infection_pdf.php

727 lines
24 KiB
PHP
Raw Normal View History

2024-10-23 18:28:06 +05:30
<?php session_start();
include('includes/config/config.php');
include_once("includes/functions.php");
include_once("log_entry.php");
mysqli_query($conn, 'SET character_set_results=utf8');
error_reporting(0);
$query = "select * from company_profile where company_id =5 ";
//echo $query;
$result = mysqli_query($conn, $query);
$row_for_company = mysqli_fetch_array($result);
@extract($row_for_company);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Lora&display=swap" rel="stylesheet">
<title>Free Form Infection</title>
<style>
/* .sign{
position: relative;
padding: 0 , 50px , 0 , 20px;
} */
.single_line {
padding: 10px;
}
.logo_td {
position: relative;
top: -20%;
padding-top: -20%;
}
.space {
padding-bottom: 10px;
}
.plant {
left: 37%;
}
.free {
/* top: 25px; */
left: 10%;
margin-top: -30px;
/* background-color: black; */
font-size: 19px;
color: black;
/* padding-left: 10%;
padding-right: 10%; */
}
.table_free {
position: relative;
/* left: 10%; */
/* margin-top: -50px; */
width: 100%;
}
.table_2 {
left: 10%;
width: 100%;
}
td {
height: 20px;
}
.div {
padding-left: 10px;
}
th,
td {
border: 1px solid black;
}
table {
border-collapse: collapse;
}
.table_2_th {
background-color: powderblue;
}
.table_3 {
left: 10%;
width: 100%;
}
.table_sign {
left: 10%;
width: 100%;
}
.tt {
height: 50px;
text-align: left;
}
.table_sign_2 {
left: 10%;
width: 100%;
}
body {
font-family: Arial, Helvetica, sans-serif
}
.table_header {
border: 1px solid green;
}
.logo {
position: relative;
/* padding-right: 50%; */
/* margin-left: 50%; */
left: 15%;
top: 20%;
border-radius: 100px;
}
.comname {
position: relative;
left: -10%;
}
.comadd {
position: relative;
}
.btn {
position: relative;
background-color: #4CAF50;
top: -40px;
border-radius: 5%;
/* Green */
border: none;
color: white;
padding: 5px 8px;
text-align: right;
text-decoration: none;
left: 87%;
font-size: 12px;
margin: 4px 2px;
cursor: pointer;
}
@media print {
#printPageButton {
display: none;
/* page-break-before: avoid; */
}
}
</style>
</head>
<body>
<div class="container">
<center>
<?php
include("pdf_ohc_header.php");
?>
<br><br>
<h3 class="plant">
Plant Services Occupational Health Centre
</h3>
<br><br>
</center>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<button id="printPageButton" class="btn btn-success" onClick="window.print();">Print</button>
<center>
<h2 class="free">
FREE FROM INFECTION FORM
</h2>
</center>
</div>
<?php
$patient_id = $_POST['patient_id'];
$response_id = $_POST['response_id'];
$ffi_no = $_POST['ffi_no'];
error_log("patient_id" . $patient_id . " response_id " . $response_id . " ffi_no " . $ffi_no);
$sql_patient = "select a.*,b.question_id,b.question_remarks,b.question_answer,c.patient_name, c.dob , c.gender, c.doj from questionaire_master_response a left join questionaire_master_response_details b on a.response_id = b.response_id left join patient_master c on a.patient_id = c.id where a.patient_id='" . $_REQUEST['patient_id'] . "' and a.response_id='" . $response_id . "' and a.medical_examination_no='" . $ffi_no . "' ";
error_log("query " . $sql_patient);
$result_patient = mysqli_query($conn, $sql_patient);
$row_patient = mysqli_fetch_assoc($result_patient);
@extract($row_patient);
if ($row_patient['gender'] == 'M' || $row_patient['gender'] == 'm') {
$gender = "MALE";
} else if ($row_patient['gender'] == 'F' || $row_patient['gender'] == 'f') {
$gender = "FEMALE";
}
?>
<table class="table_free" style="text-aling:left;">
<tr>
<td width="5%">
Canteen
</td>
<td width="10%" class="canteen">
<?= $row_patient['canteen_location'] ?>
</td>
<td class="" width="5%">
Location :
</td>
<td colspan="3" class="div" width="20%">
<?= $row_patient['canteen_location'] ?>
</td>
</tr>
<tr>
<td width="5%">
Name:
</td>
<td width="15%">
<?= $row_patient['patient_name'] ?>
</td>
<td width="2%">
Temperature
</td>
<td width="3%">
<?= $row_patient['temp'] ?>
</td>
<td>
SpO2
</td>
<td width="3%">
<?= $row_patient['spo2'] ?>
</td>
</tr>
<tr>
<td>Date</td>
<td width="10%"><?= $row_patient['screen_date'] ?></td>
<td>Age.</td>
<td width="5%"><?php echo datediff($row_patient['dob'],"age") ?></td>
<td width="7%">Duration of employment</td>
<td width="5%">
<?php echo datediff($row_patient['doj']) ?>
</td>
</tr>
<tr>
<td>Ref. no.</td>
<td width="10%"><?= $row_patient['ref_no'] ?> </td>
<td> Sex</td>
<td width="3%">
<?= $gender ?>
</td>
<td>Job Profile</td>
<td width="3%"><?= $row_patient['job_profile'] ?></td>
</tr>
</table>
<br>
<table class="table_2">
<?php
$sql_sub_section = "select sub_section_order,section_name from questionaire_master where
question_type='ffi' and sub_section_available='Y' group by sub_section_order";
$result_sub_section = mysqli_query($conn, $sql_sub_section);
$i = 0;
if (mysqli_num_rows($result_sub_section) > 0) {
while ($row_sub_section = mysqli_fetch_assoc($result_sub_section)) {
$section_name = $row_sub_section['section_name'];?>
<thead>
<tr class="table_2_th" style="text-aling:center;" >
<?php
$sql_config = "select value from config where key_name = 'QUESTIONNAIRE_LANGUAGE'";
$result_config = @mysqli_query($conn, $sql_config);
$row_config = @mysqli_fetch_array($result_config);
if ($row_config['value'] == 'LOCAL_LANGUAGE') { ?>
<th>क्रमांक</th>
<th><?= $section_name ?></th>
<th>हां/नहीं</th>
<?php } elseif ($row_config['value'] == 'ENGLISH') { ?>
<th>Sr.No</th>
<th><?= $section_name ?></th>
<th>Yes/No</th>
<th>Observation and remark</th>
<?php } else { ?>
<th>क्रमांक / Sr.No</th>
<th><?= $section_name ?></th>
<th>हां/नहीं / Yes/No</th>
<th>Observation and remark</th>
<?php }?>
</tr>
</thead>
<tbody>
<?php
$sql = "select patient_name from patient_master WHERE id ='" . $_REQUEST['patient_id'] . "' ";
// echo $_REQUEST ['flex_patient_id'] ;
if (!$result = @mysqli_query($conn, $sql)) {
exit(mysqli_error($conn));
}
if (mysqli_num_rows($result) > 0) {
while ($row = @mysqli_fetch_array($result)) {
//echo $row ['patient_name'];
}
}
error_log($sql);
?>
<?php
$row = null;
$sql = "select * from questionaire_master where question_type='ffi' and sub_section_order='" . $row_sub_section['sub_section_order'] . "' ";
$result = @mysqli_query($conn, $sql);
$num_rows = @mysqli_num_rows($result);
$row = @mysqli_fetch_array($result);
do {
?>
<tr style="text-aling: left" >
<td style="width:5%; text-align:center;"><?php echo $i + 1; ?></td>
<td style="width: 60%" >
<?php
if ($row_config['value'] == 'LOCAL_LANGUAGE') { ?>
<?php echo $row['question_hindi'] ?>
<?php } elseif ($row_config['value'] == 'ENGLISH') { ?>
<?php echo $row['question'] ?>
<?php } else { ?>
<?php echo $row['question'] ?> / <?php echo $row['question_local_lang'] ?>
<?php } ?>
</td>
<?php
$sql_r = "select question_remarks,question_answer from questionaire_master_response_details a left join questionaire_master_response b on a.response_id = b.response_id where b.patient_id='" . $_REQUEST['patient_id'] . "' and a.question_id='" . $row['question_id'] . "' and b.medical_examination_no='" . $ffi_no . "'";
error_log("remarks sql " . $sql_r);
$result_r = mysqli_query($conn, $sql_r);
$row_r = mysqli_fetch_assoc($result_r);
?>
<td style="width: 20%; text-align: center;" >
<?php
if ($row_r['question_answer'] == 'Y') {
?>
Yes
<?php
} else {
?>
No
<?php
}
?>
</td>
<td style="width: 30%; text-align: center;" >
<?php echo $row_r['question_remarks'] ?>
</td>
</tr>
<?php
$i++;
} while ($row = @mysqli_fetch_array($result));
}
?>
<table class="table_sign">
<tr>
<td class="tt" colspan="3">
I declare that all the above statements are true and complete to the best of my knowledge.
</td>
</tr>
<tr>
<td style="height: 100px; text-align: center;">
<span
style="position: relative; text-align: center; top: 30%; width: fit-content;">Signature
of Food Handler:</span>
</td>
<td style="height: 100px; text-align: center;">
<span
style="position: relative; text-align: center; top: 30%; width: fit-content;">Signature
of Supervisor :</span>
</td>
<?php if ($row_patient['approval_user'] == null || $row_patient['approval_user'] == '' ) {?>
<td style="height: 100px; text-align: center;">
<span
style="position: relative; text-align: center; top: 30%; width: fit-content;">Survellance
By :</span>
</td>
<?php }else{
$medical_officer = "select b.*,c.patient_name from tbl_users a left join employee_signature b on a.emp_id = b.emp_id left join patient_master c on a.emp_id = c.id where a.user_id='" . $row_patient['medical_attend'] . "'";
error_log("PDF EMPI ". $row_patient['approval_user']."--". $medical_officer);
$sign_medical = @mysqli_query($conn, $medical_officer);
$sign_medical_officer = @mysqli_fetch_assoc($sign_medical);
@extract($sign_medical_officer);
?>
<td style="text-align: center;">
<center><img style=" width:150px; height:80px;" class="card-img-bottm"
src="data:<?= $sign_medical_officer['image_type']; ?>;base64,<?= base64_encode($sign_medical_officer['emp_sign']) ?>">
</center>
<br>
<span><?= $sign_medical_officer['patient_name'];?></span>
<br>
<span class="" style="position: relative;">Survellance
By :
:</span>
<?php
} ?>
</td>
</tr>
</table>
<table class="table_sign_2">
<tr>
<td class="tt" width="70%">
Note: <?= $row_patient['notes'] ?>
</td>
<br>
</tr>
<tr>
<td class="tt" width="20%">Remarks &nbsp;
<?php if ($row_patient['remarks'] == 'fit') {
?>
[] Healthy and fit to work as food handlers
<?php
} else if ($row_patient['remarks'] == 'unfit') {
?>
[] Unhealthy and not fit to work as food handler
<?php
} else {
?>
[] Unhealthy but can return to work after
<?php
}
?></td>
</tr>
</table>
<br>
<table class="table_sign_2" style="text-align: center;">
<tr>
<td style="height: 100px;">
<span style="position: relative; top: 30%; text-align: center;">Sign of Canteen
Supervisor/Admin Head :</span>
</td>
<?php
if ($row_patient['approval_user'] == null || $row_patient['approval_user'] == '' ) {?>
<td style="height: 100px;">
<span class="" style="position: relative; top: 30%;">Signature of Medical Officer :</span>
</td>
<?php }else{
$medical_officer = "select b.*,c.patient_name from tbl_users a left join employee_signature b on a.emp_id = b.emp_id left join patient_master c on a.emp_id = c.id where a.user_id='" . $row_patient['approval_user'] . "'";
error_log("PDF EMPI ". $row_patient['approval_user']."--". $medical_officer);
$sign_medical = @mysqli_query($conn, $medical_officer);
$sign_medical_officer = @mysqli_fetch_assoc($sign_medical);
@extract($sign_medical_officer);
?>
<td>
<center><img style=" width:150px; height:80px;" class="card-img-bottm"
src="data:<?= $sign_medical_officer['image_type']; ?>;base64,<?= base64_encode($sign_medical_officer['emp_sign']) ?>">
</center>
<br>
<span><?= $sign_medical_officer['patient_name'];?></span>
<br>
<span class="" style="position: relative; text-align: left;">Signature of Medical Officer
:</span>
<?php
} ?>
</td>
</tr>
</table>
<?php
} else {
?>
<thead>
<tr >
<?php
$sql_config = "select value from config where key_name = 'QUESTIONNAIRE_LANGUAGE'";
$result_config = @mysqli_query($conn, $sql_config);
$row_config = @mysqli_fetch_array($result_config);
if ($row_config['value'] == 'LOCAL_LANGUAGE') { ?>
<th>क्रमांक</th>
<th>कृपया नीचे दिये गए प्रश्न के उत्तर हाँ या ना मे दीजिये </th>
<th>हां/नहीं</th>
<?php } elseif ($row_config['value'] == 'ENGLISH') { ?>
<th>Sr.No</th>
<th>Please answer the questions in Yes or No</th>
<th>Yes/No</th>
<th>Observation and remark</th>
<?php } else { ?>
<th>क्रमांक / Sr.No</th>
<th>कृपया नीचे दिये गए प्रश्न के उत्तर हाँ या ना मे दीजिये / Please answer the questions in Yes
or No</th>
<th>हां/नहीं / Yes/No</th>
<th>Observation and remark</th>
<?php } ?>
</tr>
</thead>
<tbody>
<?php
$sql = "select patient_name from patient_master WHERE id ='" . $_REQUEST['flex_patient_id'] . "' ";
// echo $_REQUEST ['flex_patient_id'] ;
if (!$result = @mysqli_query($conn, $sql)) {
exit(mysqli_error($conn));
}
if (mysqli_num_rows($result) > 0) {
while ($row = @mysqli_fetch_array($result)) {
//echo $row ['patient_name'];
}
}
error_log($sql);
?>
<?php $i = 0;
$row = null;
$sql = "select * from questionaire_master where question_type='ffi'";
$result = @mysqli_query($conn, $sql);
$num_rows = @mysqli_num_rows($result);
$row = @mysqli_fetch_array($result);
do {
$count = 0;
?>
<tr>
<td style="width:5%; text-aling: center;"><b> <?php echo $i + 1; ?><b></td>
<td style="width: 60%">
<?php
if ($row_config['value'] == 'LOCAL_LANGUAGE') { ?>
<b><?php echo $row['question_hindi'] ?><b>
<?php } elseif ($row_config['value'] == 'ENGLISH') { ?>
<b><?php echo $row['question'] ?><b>
<?php } else { ?>
<b><?php echo $row['question'] ?> / <?php echo $row['question_hindi'] ?></b>
<?php } ?>
</td>
<?php
$sql_r = "select question_remarks,question_answer from questionaire_master_response_details a left join questionaire_master_response b on a.response_id = b.response_id where b.patient_id='" . $_REQUEST['patient_id'] . "' and a.question_id='" . ($i + 1) . "' and b.medical_examination_no='" . $ffi_no . "'";
error_log("remarks sql " . $sql_r);
$result_r = mysqli_query($conn, $sql_r);
$row_r = mysqli_fetch_assoc($result_r);
?>
<td style="width: 20%; text-align: center;">
<?php
if ($row_r['question_answer'] == 'Y') {
?>
Yes
<?php
} else {
?>
No
<?php
}
?>
</td>
<td style="width: 30%; text-align: center;">
<?php echo $row_r['question_remarks'] ?>
</td>
</tr>
<?php
$i++;
} while ($row = @mysqli_fetch_array($result));
//end of while
}
?>
</tbody>
</table>
</center>
<br>
<table class="form-control" style="text-align: center;">
<tr>
<th>
OBSERVATION OF CONSERN
</th>
<th>
CAPA
</th>
<th>
COMMUNICATION NOTES
</th>
</tr>
<tr>
<td width="10%"><?php echo $row_patient['observation_of_consern'] ?></td>
<td width="10%"><?php echo $row_patient['capa'] ?></td>
<td width="10%"><?php echo $row_patient['communication_notes'] ?></td>
</tr>
</table>
<br>
<table class="form-control" style="text-align: center;">
<tr>
<th>
RESPONSIBILITY
</th>
<th>
COMPLETION DATE
</th>
<th>
STATUS AND CLOSING REMARKS
</th>
</tr>
<tr>
<td width="10%"><?php echo $row_patient['responsibility'] ?></td>
<td width="10%"><?php echo $row_patient['completion'] ?></td>
<td class="tt" width="20%">
<center>
<?php if ($row_patient['remarks'] == 'fit') {
?>
[] Healthy and fit to work as food handlers
<?php
} else if ($row_patient['remarks'] == 'unfit') {
?>
[] Unhealthy and not fit to work as food handler
<?php
} else {
?>
[] Unhealthy but can return to work after
<?php
}
?>
</td>
</tr>
</table>
<div class="space"></div>
</body>
</html>
</div>