ESH/visitors_opd_form_pdf.php

258 lines
5.8 KiB
PHP
Raw Normal View History

2024-10-23 18:28:06 +05:30
<html>
<head>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<div id="opd_form_div" style="display: none">
<form id="opd_form" name="opd_form">
<?php
// include autoloader;
include ('includes/config/config.php');
include('log_entry.php');
include_once ("includes/functions.php");
$unitMap = getKeyValueMap('unit_master', 'unit_id', 'unit_name');
$query = "select * from company_profile ";
error_log("query: 27: ".$query);
// echo $query;
$result = mysqli_query($conn,$query);
$row_company = mysqli_fetch_array($result);
@extract($row_company);
$sql_employee_appointment = "select a.*, p.patient_name, p.father_name, gender,blood_group, dob from visitors_employee_appointment a, visitor_patient_master p where a.emp_id=p.id
and appointment_id='" . $_REQUEST['appointment_id_pdf'] . "'";
// echo $sql_employee_appointment;
error_log("sql_employee_appointment: 40: ".$sql_employee_appointment);
$res_emp_appoint = mysqli_query($conn,$sql_employee_appointment);
$rows_emp_appoint = mysqli_fetch_array($res_emp_appoint);
@extract($rows_emp_appoint);
$patient_name = $rows_emp_appoint['patient_name'];
error_log("query: 59: ".$query);
$result = mysqli_query($conn,$query);
$row = mysqli_fetch_array($result);
@extract($row);
$father_name = $rows_emp_appoint['father_name'];
?>
<style>
.tbl1 {
border-collapse: collapse;
width: 100%;
}
th {
background-color: #e1e1e1;
font-size: 12px;
font-style: bold;
vertical-align: top;
}
td {
text-align: left;
font-size: 11px;
vertical-align: top;
}
</style>
</head>
<div style="display: inline-block; margin-right: 17%">
<table>
<tr>
<td><img
src="data:<?php echo $row_company['image_type']?>;base64,<?php echo base64_encode( $row_company['company_logo'] )?>"
style="width: 90px; height: 46px; margin: 0px; padding: 0px;"></td>
</tr>
</table>
</div>
<div style="display: inline-block;">
<h4>OCCUPATIONAL HEALTH CENTRE</h4>
</div>
<div style="margin-top: -50px;">
<h5 style="text-align: center">(<?php echo $row_company['company_name']?>)</h5>
</div>
<div>
<h5 style="text-align: center">Patient OPD Visit</h5>
</div>
<div
style="font-size: 12px; float: right; display: inline-block; margin-top: -50px; margin-left: 9%;">
<b>Run Time :</b><?php echo $currentDate?></div>
<br>
<br>
<table border="0" width="100%">
<tr>
<td><div style="width: 50%; display: inline-block;">
<b>Ticket No.:</b>
</div>
<div style="width: 50%; display: inline-block;"><?php echo $rows_emp_appoint['ticket_no']?></div></td>
<td align ="right"><div style =" width:50%; display: inline-block;"><b>Is Emergency?:</b></div><div style =" width:50%; display: inline-block;"><?php echo $ans?></div></td>
</tr>
<tr>
<td width="50%"><div style="width: 50%; display: inline-block;">
<b>ECode/GPass No:</b>
</div>
<div style="width: 50%; display: inline-block;"><?php echo $employee_code?></div></td>
<td width="50%"><div style="width: 50%; display: inline-block;">
<b>OHC Reporting Time :</b>
</div>
<div style="width: 50%; display: inline-block;"><?php echo date_format(date_create($rows_emp_appoint['appointment_date']),"d-M-Y h:i:sa ")?></div></td>
</tr>
<tr>
<td width="50%"><div style="width: 50%; display: inline-block;">
<b>Patient Name: </b>
</div>
<div style="width: 50%; display: inline-block;"><?php echo $patient_name?> </div></td>
<td width="50%"><div style="width: 50%; display: inline-block;">
<b>Father Name: </b>
</div>
<div style="width: 50%; display: inline-block;"><?php echo $father_name?></div></td>
</tr>
<tr>
<td width="50%"><div style="width: 50%; display: inline-block;">
<b>Age: </b>
</div>
<div style="width: 50%; display: inline-block;"><?php echo isset($rows_emp_appoint['dob'])? date_diff(date_create($rows_emp_appoint['dob']), date_create('today'))->y:"Not Available";?>
</div></td>
<td width="50%"><div style="width: 50%; display: inline-block;">
<b>Gender: </b>
</div>
<div style="width: 50%; display: inline-block;"><?php echo $rows_emp_appoint['gender']=='M'?"Male":"Female"?></div></td>
</tr>
</table>
<br>
<div style="width: 10%; display: inline-block; font-size: 9px;">
<b>SBP:</b><?php echo $rows_emp_appoint['bp_sbp']?> </div>
<div style="width: 10%; display: inline-block; font-size: 9px;">
<b>DBP: </b><?php echo $rows_emp_appoint['bp_dbp']?> </div>
<div style="width: 12%; display: inline-block; font-size: 9px;">
<b>Heart Rate:</b> <?php echo $rows_emp_appoint['heart_rate']?></div>
<div
style="width: 10%; margin-left: 5%; display: inline-block; font-size: 9px;">
<b>FBS:</b><?php echo $rows_emp_appoint['blood_sugar_rbs']?></div>
<div style="width: 10%; display: inline-block; font-size: 9px;">
<b>RBS: </b><?php echo $rows_emp_appoint['blood_sugar_rbs']?> </div>
<div style="width: 10%; display: inline-block; font-size: 9px;">
<b>PPBS:</b> <?php echo $rows_emp_appoint['blood_sugar_ppbs']?> </div>
<div style="width: 14%; display: inline-block; font-size: 9px;">
<b>Temp:</b> <?php echo $rows_emp_appoint['temperature']?> </div>
<div style="width: 14%; display: inline-block; font-size: 9px;">
<b>SPOC2%:</b> <?php echo $rows_emp_appoint['spo2_percent']?> </div>
<br>
<?php $appointment_id=$_REQUEST['appointment_id_pdf'] ; ?>
<br>
<div
style="font-size: 12px; float: right; display: inline-block; margin-top: 50px; margin-right: 25%;">
<b>Reviewed By: </b><?php echo $doc_name?></div>
</form>
<form id="employeeDetailsFormPdf" action="" method="POST">
<input type="hidden" name="htmlText" id="htmlText" />
</form>
</div>
<script>
formSubmit();
function formSubmit(){
$("#htmlText").val($("#opd_form").html());
document.forms['employeeDetailsFormPdf'].action="pdf_dynamic.php";
document.forms['employeeDetailsFormPdf'].method="post";
document.forms['employeeDetailsFormPdf'].submit();
}
</script>