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

467 lines
17 KiB
PHP

<!DOCTYPE html>
<html>
<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">
<title>EYE CHECK-UP CARD</title>
</head>
<style>
.table1,
.table2,
.table4 th,
td {
/*border: none;*/
border-collapse: collapse;
}
td,
p {
padding: 4px;
font-size: small;
}
.table3 {
border: 1px solid;
border-collapse: collapse
}
.table3 td,.eye_sight td {
border: 1px solid;
border-collapse: collapse
}
.photo {
border: 1px black solid;
width: 80px;
height: 100px;
}
u {
text-underline-offset: 1px;
}
.eye_sight {
border: 1px solid black;
padding: 0;
border-collapse: collapse;
width: 100%;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
}
/* tr , td {
border: 1px solid black;
padding: 0;
border-collapse: collapse;
} */
div {
width: 80%;
height: 80%;
border: solid 0px;
/* position: left; */
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
}
.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('includes/config/config.php');
include_once("includes/functions.php");
$queryc = "select * from company_profile ";
// echo $query;
$resultc = mysqli_query($conn,$queryc);
$row_company = mysqli_fetch_array($resultc);
@extract($row_company);
$sql_patient_physical_parameters="select a.*,b.*,c.*,a.height,a.weight,a.waist,a.bp,e.file_name, e.emp_sign as sign, e.qualification,e.registration_no,e.emp_id as sign_id, f.company_name, f.company_logo, f.image_type,address from company_profile f, medical_examination a inner join patient_master b on b.id=a.patient_id left join designation c on b.designation_id=c.designation_id left join tbl_users d on d.user_id=a.approved_by left join employee_signature e on d.emp_id=e.emp_id where a.medical_exam_id='".$_REQUEST['medical_exam_id']."' ";
//echo $sql_patient_physical_parameters;
$result_patient_physical_parameters= mysqli_query($conn,$sql_patient_physical_parameters);
$row_patient_physical_parameters= mysqli_fetch_assoc($result_patient_physical_parameters);
@extract($row_patient_physical_parameters);
error_log($row_patient_physical_parameters['patient_name']);
error_log($row_patient_physical_parameters['address']);
error_log($row_patient_physical_parameters['ime_no']);
// error_log($row_patient_physical_parameters['approving_doc_sign_img']);
// error_log($row_patient_physical_parameters['doc_sign_image_type']);
$doc_emp_id = getFieldfromTable ( 'emp_id', 'tbl_users', 'user_id', $sign_medical_officer );
//error_log($doc_emp_id);
$doctor_name = getFieldfromTable ( 'patient_name', 'patient_master', 'id', $doc_emp_id );
$contractor = getFieldfromTable('employer_contractor_name','employer_contractor','id',$row_patient_physical_parameters['employer_contractor_id']);
$design = getFieldfromTable('designation_name','designation','designation_id',$row_patient_physical_parameters['designation_id']);
$dept = getFieldfromTable('dept_name','department','dept_id',$row_patient_physical_parameters['dept_id']);
$sql_patient_personal_info=" select * from patient_personal_information where medical_exam_id='".$_REQUEST['medical_exam_id']."' ";
$result_patient_personal_info = mysqli_query($conn,$sql_patient_personal_info);
$row_patient_personal_info= mysqli_fetch_assoc($result_patient_personal_info);
@extract($row_patient_personal_info);
$date_of_exam=strtoupper(date_format(date_create($row_patient_personal_info['date_of_exam']),"d-M-Y "));
?>
<body>
<div align="right" >
<button align ="center" id="printPageButton" class="btn btn-success" onClick="window.print();">Print</button>
</div>
<table cellspacing="0" width="100%">
<tr>
<td width="10%"><img
src="data:<?php echo $row_company['image_type']?>;base64,<?php echo base64_encode( $row_company['company_logo'] )?>"
style="width: 150px; height: 60px; margin: 0px; padding: 0px;">
</td>
<td width="70%">
<div>
<strong style="margin-left: 30px;font-size: 18px"><?php echo $row_company['company_name']?></strong>
<!-- <strong style="margin-left: 100px">MEDICAL DEPARTMENT</strong>
<b style="margin-left: 60px"><?php echo $row_company['address']?></b>
<strong style="margin-left: 60px;">PREVENTION IS BETTER THAN CURE</strong> -->
</div>
</td>
<td width="20%" align="right">
<strong>OHC Mob.</strong><?php echo $row_company['primary_phone']?><br>
<strong>MO Mob:</strong><?php echo $row_company['fax']?><br>
<b style="font-size: 14px">Email:</b><span style="font-size: 14px"><?php echo strtolower($row_company['primary_email'])?></span>
</td>
</tr>
<tr>
<td colspan="1"></td>
<td colspan="2"><strong style="margin-left: 100px">MEDICAL DEPARTMENT</strong></td>
</tr>
<tr>
<td colspan="1"></td>
<td colspan="2"><b style="margin-left:70px"><?php echo $row_company['address']?></b></td>
</tr>
<tr>
<td colspan="1"></td>
<td colspan="2"><strong style="margin-left: 140px;text-decoration: underline;">EYE CHECK-UP REPORT</strong></td>
</tr>
</table>
<br>
<table style="width:100%">
<tr >
<td colspan="10" align="right"><strong>Date:<?php echo date("d-M-Y",strtotime($row_patient_physical_parameters['medical_entry_date']))?></td>
</tr>
<tr>
<td colspan="6"><strong>Name:</strong>...........<?php echo $row_patient_physical_parameters['patient_name']?>..............</td>
<td colspan="3"><strong>Age:</strong>&nbsp; &nbsp; <?php
$from = new DateTime($dob);
$to = new DateTime('today');
echo $from->diff($to)->y;?></td>
<td colspan="2"><strong>Sex:</strong> <?php if($gender=='M')
echo " Male";
elseif ($gender=='F')
echo " Female";?></td>
</div>
</tr>
<tr>
<td colspan="6"><strong>Father's Name:</strong>......<?php echo $row_patient_physical_parameters['father_name']?>............</td>
<td colspan="6"><strong>Blood Group</strong>.....<?php echo $row_patient_physical_parameters['blood_group']?>.......</td>
</tr>
<tr>
<td colspan="6"><strong>EmpID:</strong>......<?php echo $row_patient_physical_parameters['emp_code']?>............</td>
<td colspan="6"><strong>Designation:</strong>........<?php echo $design?>............</td>
</tr>
<tr>
<td colspan="6"><strong>Deptartment</strong>...<?php echo $dept?>....</td>
<td colspan="6"><strong>Division</strong>...<?php echo $dept?>....</td>
</tr>
<tr>
<td colspan="6"><strong>Company/ Contractor Name:</strong>......<?php echo $contractor?>............</td>
</tr>
<tr>
<td colspan="6"><strong>Emai ID:</strong>&nbsp; &nbsp; <?php echo $row_patient_physical_parameters['email_id']?></td>
<td colspan="6"><strong>MOBILE NO:</strong>&nbsp; &nbsp; <?php echo $row_patient_physical_parameters['primary_phone']?></td>
</tr>
<tr>
<td colspan="6"><strong>PERMANENT ADDRESS:</strong>&nbsp; &nbsp; <?php echo $row_patient_physical_parameters['village']?>,<?php echo $row_patient_physical_parameters['post']?>,<?php echo $row_patient_physical_parameters['ps']?>,<?php echo $row_patient_physical_parameters['tehsil']?>,<?php echo $row_patient_physical_parameters['district']?>,<?php echo $row_patient_physical_parameters['state']?>,<?php echo $row_patient_physical_parameters['pincode']?> </td>
</tr>
</table>
<br>
<hr>
<table class="table2" style="width:100%">
<tr>
<td >
<h4>Visual Activity:</h4>
</td>
<td>
<b style="font-weight: 600">Without Glass </b>
</td>
<td>
<span><b style="font-weight: 600">R.E.-</b>&nbsp;&nbsp;<?php echo $row_patient_physical_parameters['dis_without_right_eye']?>/6 &nbsp;&nbsp;&nbsp;&nbsp; & &nbsp;&nbsp;<?php echo $row_patient_physical_parameters['near_without_right_eye']?>/6</span>
</td>
<td>
<span><b style="font-weight: 600">L.E.-</b>&nbsp;&nbsp;<?php echo $row_patient_physical_parameters['dis_without_left_eye']?>/6 &nbsp;&nbsp;&nbsp;&nbsp; & &nbsp;&nbsp;<?php echo $row_patient_physical_parameters['near_without_left_eye']?>/6</span>
</td>
</tr>
<tr>
<td colspan="1">
</td>
<td>
<b style="font-weight: 600">With Glass </b>
</td>
<td>
<span><b style="font-weight: 600">R.E.-</b>&nbsp;&nbsp;<?php echo $row_patient_physical_parameters['dis_with_right_eye']?>/6 &nbsp;&nbsp;&nbsp;&nbsp; & &nbsp;&nbsp;<?php echo $row_patient_physical_parameters['near_with_right_eye']?>/6</span>
</td>
<td>
<span><b style="font-weight: 600">L.E.-</b>&nbsp;&nbsp;<?php echo $row_patient_physical_parameters['dis_with_left_eye']?>/6 &nbsp;&nbsp;&nbsp;&nbsp; & &nbsp;&nbsp;<?php echo $row_patient_physical_parameters['near_with_left_eye']?>/6</span>
</td>
</tr>
<tr>
<td colspan="8"><b style="font-weight: 600">Color Vision:.....<?php echo $row_patient_physical_parameters['color_vision']?>........</b></td>
</tr>
</table>
<br>
<table border="1" cellspacing="0" style="width: 100%" class="table-bordered">
<tr>
<th rowspan="2"><b style="font-weight: 800"><center>Refractive Power</center></b></th>
<th colspan="4"><b style="font-weight: 800"><center>Left eye</center></b></th>
<th colspan="4"><b style="font-weight: 800"><center>Right eye</center></b></th>
</tr>
<tr>
<th><b style="font-weight: 800"><center>DSPH</center></b></th>
<th><b style="font-weight: 800"><center>DCYL</center></b></th>
<th><b style="font-weight: 800"><center>AXIS</center></b></th>
<th><b style="font-weight: 800"><center>V</center></b></th>
<th><b style="font-weight: 800"><center>DSPH</center></b></th>
<th><b style="font-weight: 800"><center>DCYL</center></b></th>
<th><b style="font-weight: 800"><center>AXIS</center></b></th>
<th><b style="font-weight: 800"><center>V</center></b></th>
</tr>
<tr>
<td ><b style="font-weight: 800"><center>Distance</center></b></td>
<td>
<?php echo $row_patient_physical_parameters['ld_dsph']?>
</td>
<td>
<?php echo $row_patient_physical_parameters['ld_dcyl']?>
</td>
<td>
<?php echo $row_patient_physical_parameters['ld_axis']?>
</td>
<td>
<?php echo $row_patient_physical_parameters['ld_v']?>
</td>
<td>
<?php echo $row_patient_physical_parameters['rd_dsph']?>
</td>
<td>
<?php echo $row_patient_physical_parameters['rd_dcyl']?>
</td>
<td>
<?php echo $row_patient_physical_parameters['rd_axis']?>
</td>
<td>
<?php echo $row_patient_physical_parameters['rd_v']?>
</td>
</tr>
<tr>
<td ><b style="font-weight: 800"><center>Near(reading)</center></b></td>
<td>
<?php echo $row_patient_physical_parameters['ln_dsph']?>
</td>
<td>
<?php echo $row_patient_physical_parameters['ln_dcyl']?>
</td>
<td>
<?php echo $row_patient_physical_parameters['ln_axis']?>
</td>
<td>
<?php echo $row_patient_physical_parameters['ln_v']?>
</td>
<td>
<?php echo $row_patient_physical_parameters['rn_dsph']?>
</td>
<td>
<?php echo $row_patient_physical_parameters['rn_dcyl']?>
</td>
<td>
<?php echo $row_patient_physical_parameters['rn_axis']?>
</td>
<td>
<?php echo $row_patient_physical_parameters['rn_v']?>
</td>
</tr>
</table>
<br>
<table width="100%">
<tr>
<td><u><b style="font-weight: 800">C/o: <?php echo $row_patient_physical_parameters['co']?></b></u></td>
</tr>
<tr>
<td><u><b style="font-weight: 800">OE: <?php echo $row_patient_physical_parameters['o_exam']?></b></u></td>
</tr>
</table>
<br>
<table width="100%">
<tr>
<td><u><b style="font-weight: 800">Prev.Diagnosis: <?php echo $row_patient_physical_parameters['prev_diagnosis']?></b></u></td>
</tr>
<tr>
<td><u><b style="font-weight: 800">Treatment and Advice: <?php echo $row_patient_physical_parameters['t_n_a']?></b></u></td>
</tr>
</table>
<table width="100%">
<tr>
<td><u><b style="font-weight: 800">Next Check-up Date:<?php echo $row_patient_physical_parameters['next_due_date']?></b></u></td>
</tr>
<tr>
<td style="border: none !important;"><b style="font-weight: 1200;">Remarks </b><?php echo $row_for_fitness['comments']?></td>
</tr>
</tr><td>
This is to certify that Mr/ Ms _________<?php echo $row_patient_physical_parameters['patient_name']?>___________________ has been examined and he / she is found to be medically <?php echo $row_patient_physical_parameters['physical_status']?> for duty.</tr>
</table>
<table width="100%">
<tr>
<td colspan="4">Signature:<img
src="data:<?php echo $row_patient_physical_parameters['doc_sign_image_type']?>;base64,<?php echo base64_encode( $row_patient_physical_parameters['approving_doc_sign_img'])?>"
style="width: 200px; height: 61px;" /></td>
<?php if($row_patient_physical_parameters['approved_by'] == "" || $row_patient_physical_parameters['approved_by'] == null){?>
<td>Date:<?php echo date("d-M-Y",strtotime($row_patient_physical_parameters['medical_entry_date']))?></td>
<?php } else {?>
<td>Date:<?php echo date("d-M-Y",strtotime($row_patient_physical_parameters['approval_date']))?></td>
<?php }?>
</tr>
<tr>
<td>Factory Medical Officer</td>
</tr>
<tr>
<td>Form No:TML/F/MED/01</td> </tr>
<tr> <td>Rev: 03</td>
</tr>
</table>
</body>
</html>
<script>
$(document).ready(function(){
window.print();
});
</script>