ohctech_p8/fitness_certificate_old.php
2024-10-16 19:18:52 +05:30

333 lines
11 KiB
PHP

<?php session_start();
// error_log($_REQUEST['patient_id']);
// error_log('Abcde');
include('log_entry.php');
include_once("includes/functions.php");
?>
<?php $sql_for_fitness = "select g.*, e.file_name,f.state, e.emp_sign as sign, e.qualification,e.registration_no,e.emp_id as sign_id, f.ohc_type_name, f.ohc_logo, f.icon_text, f.image_type from ohc_type f, sickness g left join employee_signature e on g.doctor_last_attended=e.emp_id where g.sickness_id = '" . $_REQUEST['flex_sickness_id'] . "' ";
//echo $sql_for_fitness;
//print_r($_POST);
$result_for_fitness = mysqli_query($conn, $sql_for_fitness);
$row_for_fitness = mysqli_fetch_assoc($result_for_fitness);
@extract($row_for_fitness);
$attended_doc = $row_for_fitness['doctor_last_attended'];
$doc_user_id = ($attended_doc != null && $attended_doc != 0 && $attended_doc != "") ? $attended_doc : $row_for_fitness['modified_by'];
$doc_emp_id = getTableFieldValue('tbl_users', 'emp_id', 'user_id', $doc_user_id, '');
error_log($doc_emp_id);
$doc_name = getTableFieldValue('patient_master', 'patient_name', 'id', $doc_emp_id, '');
$sickness = getTableFieldValue('ailment_system', 'ailment_sys_name', 'ailment_sys_id', $row_for_fitness['sickness_name']);
$from_date = strtoupper(date_format(date_create($row_for_fitness['from_date']), "d-M-Y "));
$to_date = strtoupper(date_format(date_create($row_for_fitness['to_date']), "d-M-Y "));
$date_return = strtoupper(date_format(date_create($row_for_fitness['date_return']), "d-M-Y "));
$justifiable_from = strtoupper(date_format(date_create($row_for_fitness['justifiable_from']), "d-M-Y "));
$justifiable_to = strtoupper(date_format(date_create($row_for_fitness['justifiable_to']), "d-M-Y "));
$not_justifiable_from = strtoupper(date_format(date_create($row_for_fitness['not_justifiable_from']), "d-M-Y "));
$not_justifiable_to = strtoupper(date_format(date_create($row_for_fitness['not_justifiable_to']), "d-M-Y "));
$appointment_date = strtoupper(date_format(date_create($row_for_fitness['sickness_date']), "d-M-Y "));
$doc_id = $row_for_fitness['doctor_last_attended'];
$mod_id = $row_for_fitness['modified_by'];
if ($doc_id != 0) {
$doc_name = getFieldFromTable('patient_name', 'patient_master', 'id', $doc_id);
} else {
$doc_name = getFieldFromTable('patient_name', 'patient_master', 'id', $doc_id);
}
error_log("doc:" . $doc_name);
$query_for_patient = "SELECT a.* , s.* from patient_master a INNER JOIN sickness s ON a.id = s.emp_id where id='" . $row_for_fitness['emp_id'] . "' ";
error_log('$query_for_patient'.$query_for_patient) ;
$result_for_patient = @mysqli_query($conn, $query_for_patient);
$row_for_patient = @mysqli_fetch_array($result_for_patient);
// echo $row_emp_sign['modified_by'];
$query_for_company = "select * from company_profile ";
//echo $query_for_company;
$result_for_company = @mysqli_query($conn, $query_for_company);
if ($row_for_company = @mysqli_fetch_array($result_for_company)) {
@extract($row_for_company);
}
error_log("asasasasasasas" . $row_for_patient['patient_name']);
$query_sign_master = "select * from employee_signature where emp_id='" . $row_for_fitness['doctor_last_attended'] . "' ";
error_log("sssssssssssssssssss" . $query_sign_master);
$result_sign_master = @mysqli_query($conn, $query_sign_master);
$row_sign_master = @mysqli_fetch_array($result_sign_master);
$appr_doc_sign_img = $row_sign_master['emp_sign'];
error_log("aaaaaaaaaaaaaavvvvvvvvvvvvvvvv" . $appr_doc_sign_img);
$appr_doc_image_type = $row_sign_master['image_type'];
?>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<style type="text/css">
@page {
margin: 20px;
}
.btn {
background-color: #4CAF50;
border-radius: 5%;
/* Green */
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
@media print {
#printPageButton {
display: none;
}
}
</style>
<?php
include "pdf_ohc_header.php";
?>
<!-- <button id="printPageButton" class="btn btn-success print" onClick="window.print();">Print</button> -->
<br>
<br>
<table cellspacing="0" align="center" width="90%">
<tr>
<td align="center"><b style="font-size: 20px;font-weight: 800;text-decoration: underline;"><?php
$status="";
if ($row_for_patient['fitness_status'] == "APPROVED") {
echo "FITNESS CERTIFICATE";
$status = "FIT";
}else if ($row_for_patient['fitness_status'] == "REVIEW") {
echo "TEMPORARY UNFIT CERTIFICATE";
$status = "TEMPORARY UNFIT";
}else if($row_for_patient['fitness_status'] == "REJECTED"){
echo "UNFIT CERTIFICATE";
$status = "UNFIT";
}
?>
</b></td>
</tr>
<tr>
<td align="center"><b style="font-size: 18px;font-weight: 800;">TO WHOM SOEVER IT
MAY CONCERN</b></td>
</tr>
</table>
<br>
<table align="center" width="90%">
<tr>
<td align="none" style="border: none !important;">
<b> </b><?php echo $row_for_fitness['ticket_no'] ?></b>
</td>
<td align="right">
<?php if($row_for_fitness['approval_date']!='' && $row_for_fitness['approval_date']!=null){ echo '<b>Date:</b>'.date("d-M-Y", strtotime($row_for_fitness['approval_date']));} ?>
</td>
</tr>
<br>
</table>
<br>
<br>
<table align="center" width="90%">
<tr>
<td style="font-weight: 1200;border: none !important; display: flex; justify-content: center; ">
<spam style="font-size: 18px;">This is to certify that Mr./Mrs./Shri/Miss
<b> <?php echo $row_for_patient['patient_name'].' '; ?> </b>s/o /spouse
<b><?php echo $row_for_patient['father_name'] ?> </b> Aged
<?php echo isset($row_for_patient['dob']) ? '<b>'.date_diff(date_create($row_for_patient['dob']), date_create('today'))->y.' Years </b>' : "Not Available"; ?>of
<?php $emp=$row_for_patient['emp_code']; if($emp!='' && $emp!=null){ echo ' Emp code <b>'.$emp,'</b>';} ?>
<?php $dept=getTableFieldValue('department', 'dept_name', 'dept_id', $row_for_patient['dept_id']); if($dept!='' && $dept!=null){ echo ' Department <b>'.$dept.'</b>';} ?>
has been examined by me thoroughly and he/she is
found to be free from deafness
defective vision or other infirmity physical or mental likely to not interfere with the efficiency of
his/her work.
</spam>
</td>
</tr>
<tr>
<td style="border: none !important;">
<spam style="font-size: 18px;">He/she is not suffering from any contagious disease and I have found
him/her to be <b><?php echo $status ?></b> in all respect.</spam>
</td>
</tr>
</table>
<br>
<!-- <br>
<table align="center" width="90%">
<tr>
<td style="font-weight: 1200;border: none !important;">
<spam style="font-size: 18px;">(1) Height : <u> <?php echo $row_for_patient['height'] ?> </u> cm.</spam>
</td>
</tr>
<tr>
<td style="font-weight: 1200;border: none !important;">
<spam style="font-size: 18px;">(2) Weight :<u> <?php echo $row_for_patient['weight'] ?> </u> kg.</spam>
</td>
</tr>
<tr>
<td style="font-weight: 1200;border: none !important;">
<spam style="font-size: 18px;">(3) Chest : Un-Expanded<u> <?php echo $row_for_patient['chest_uex'] ?> </u>
cm.</spam>
</td>
</tr>
<tr>
<td style="font-weight: 1200;border: none !important;">
<spam style="font-size: 18px;margin-left:80px"> Expanded<u> <?php echo $row_for_patient['chest_ex'] ?> </u>
cm.</spam>
</td>
</tr>
<tr>
<td style="font-weight: 1200;border: none !important;">
<spam style="font-size: 18px;">(4) Pulse :<u> <?php echo $row_for_patient['pulse'] ?> </u> / min.</spam>
</td>
</tr>
<tr>
<td style="font-weight: 1200;border: none !important;">
<spam style="font-size: 18px;">(5) B.P. : <u><?php echo $row_for_patient['bp'] ?></u> mm/Hg.</spam>
</td>
</tr>
<tr>
<td style="font-weight: 1200;border: none !important;">
<spam style="font-size: 18px;">(6) Blood Group :<u> <?php echo $row_for_patient['blood'] ?> </u> </spam>
</td>
</tr>
<tr>
<td style="font-weight: 1200;border: none !important;">
<spam style="font-size: 18px;">(7) Nose :<u> <?php echo $row_for_patient['nose'] ?> </u></spam>
</td>
</tr>
<tr>
<td style="font-weight: 1200;border: none !important;">
<spam style="font-size: 18px;">(8) Throat :<u> <?php echo $row_for_patient['throat'] ?> </u>.</spam>
</td>
</tr>
<tr>
<td style="font-weight: 1200;border: none !important;">
<spam style="font-size: 18px;">(9) R.S. :<u> <?php echo $row_for_patient['rs'] ?> </u></spam>
</td>
</tr>
<tr>
<td style="font-weight: 1200;border: none !important;">
<spam style="font-size: 18px;">(10) C.V.S. :<u> <?php echo $row_for_patient['cvs'] ?> </u>.</spam>
</td>
</tr>
<tr>
<td style="font-weight: 1200;border: none !important;">
<spam style="font-size: 18px;">(11) C.N.S. :<u> <?php echo $row_for_patient['cns'] ?> </u></spam>
</td>
</tr>
</table> -->
<table align="center" width="90%">
<tr style="height: 100px;">
<td align="left" style="font-size: 18px;">* This certificate is being issued to him for
<b><?php echo $row_for_patient['purpose'] ?></b> Purpose
</td>
</tr>
<tr>
<td align="right">
<?php if(!empty($row_sign_master['emp_sign'])) {?>
<img src="data:<?php echo $row_sign_master['doc_sign_image_type'] ?>;base64,<?php echo base64_encode($row_sign_master['emp_sign']) ?>"
style="width: 160px; height: 60px;" />
</td><?php }?>
</tr>
<!--
<tr>
<td align="right" style="font-weight: 1200;border: none !important;"><?php echo $doc_name ?></td>
</tr> -->
<tr>
<!-- <td align="right" style="font-weight: 1200;border: none !important;">Date: <?php echo date("d-M-Y", strtotime($row_for_fitness['approval_date'])) ?></td> -->
<td align="right" style="font-weight: 1200;border: none !important;">(Medical Officer)</td>
</tr>
</table>
<div align="center">
<button align="center" id="printPageButton" class="btn btn-success" onClick="window.print();">Print</button>
</div>
<!--
<script>
$(document).ready(function() {
window.print();
});
</script> -->