422 lines
11 KiB
PHP
422 lines
11 KiB
PHP
|
|
|
|
<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'];
|
|
|
|
// echo $query;
|
|
$attended_doc = $rows_emp_appoint['doctor_last_attended'];
|
|
$doc_user_id = ($attended_doc != null && $attended_doc != 0 && $attended_doc != "") ? $attended_doc : $rows_emp_appoint['modified_by'];
|
|
|
|
$doc_emp_id = getTableFieldValue('tbl_users', 'emp_id', 'user_id', $doc_user_id, '');
|
|
|
|
$doc_name = getTableFieldValue('patient_master', 'patient_name', 'id', $doc_emp_id, '');
|
|
|
|
error_log("query: 59: ".$query);
|
|
$result = mysqli_query($conn,$query);
|
|
|
|
$row = mysqli_fetch_array($result);
|
|
|
|
@extract($row);
|
|
|
|
|
|
$father_name = $rows_emp_appoint['father_name'];
|
|
|
|
|
|
date_default_timezone_set('Asia/Kolkata');
|
|
|
|
?>
|
|
|
|
|
|
|
|
<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">Visitor Medical Examination</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>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
<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 $rows_emp_appoint['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 $rows_emp_appoint['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>
|
|
<?php if($rows_emp_appoint['patient_cat_id']=='1'){?>
|
|
|
|
<tr>
|
|
|
|
<td width="50%"><div style="width: 50%; display: inline-block;">
|
|
<b>Department: </b>
|
|
</div>
|
|
<div style="width: 50%; display: inline-block;"><?php echo getTableFieldValue('department','dept_name','dept_id',$rows_emp_appoint['dept_id'],'');?></div></td>
|
|
|
|
<td width="50%"><div style="width: 50%; display: inline-block;">
|
|
<b>Designation: </b>
|
|
</div>
|
|
<div style="width: 50%; display: inline-block;"><?php echo getTableFieldValue('designation','designation_name','designation_id',$rows_emp_appoint['designation_id'],'');?></div></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td width="50%"><div style="width: 50%; display: inline-block;">
|
|
<b>Cadre: </b>
|
|
</div>
|
|
<div style="width: 50%; display: inline-block;"><?php echo getTableFieldValue('emp_cadre','emp_cadre','emp_cadre_id',$rows_emp_appoint['emp_cadre'],'');?></div></td>
|
|
|
|
<td width="50%"><div style="width: 50%; display: inline-block;">
|
|
<b>Employer/Contractor: </b>
|
|
</div>
|
|
<div style="width: 50%; display: inline-block;"><?php echo getTableFieldValue('employer_contractor','employer_contractor_name','id',$rows_emp_appoint['employer_contractor_id'],'');?></div></td>
|
|
|
|
</tr>
|
|
<?php }?>
|
|
|
|
|
|
|
|
</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>
|
|
|
|
|
|
<table border="1" class="tbl1" width="100%">
|
|
|
|
|
|
<?php if(isset($rows_emp_appoint['followup_to_opd']) && $rows_emp_appoint['followup_to_opd']!='0'){?>
|
|
|
|
<tr>
|
|
|
|
<th width="12%" valign="top">Follow-up to OPD</th>
|
|
<td valign="top" align="left" width="38%">
|
|
<?php echo getFieldFromTable("CONCAT(ticket_no,' ',DATE_FORMAT(appointment_date,'%d-%b-%Y %l:%i %p '))",'employee_appointment','appointment_id',$rows_emp_appoint['followup_to_opd'])?>
|
|
</td>
|
|
|
|
<th width="12%" valign="top" align="left">Remarks/Follow-up
|
|
Invetigation Details</th>
|
|
<td width="38%" valign="top" align="left"><?php echo nl2br($rows_emp_appoint['remarks_rece'])?></td>
|
|
|
|
</tr>
|
|
|
|
<?php }?>
|
|
<tr>
|
|
|
|
<th width="12%" valign="top">Complaints :</th>
|
|
<td valign="top" align="left" width="38%"><?php echo nl2br($rows_emp_appoint['complaints'])?></td>
|
|
|
|
|
|
|
|
<th width="12%" valign="top" align="left">Examination :</th>
|
|
<td width="38%" valign="top" align="left"><?php echo nl2br($rows_emp_appoint['examination_remarks'])?></td>
|
|
|
|
</tr>
|
|
<?php
|
|
$ailment_names_ids = $rows_emp_appoint['ailments_new'];
|
|
$ailment_names_ids_array = array();
|
|
$ailment_names_ids_array = explode(",", $ailment_names_ids);
|
|
$ailment_names = "";
|
|
for ($i = 0; $i < count($ailment_names_ids_array); $i ++) {
|
|
if ($i == 0) {
|
|
$ailment_names = getTableFieldValue('ailment', 'ailment_name', 'ailment_id', $ailment_names_ids_array[$i]);
|
|
} else {
|
|
$ailment_names = $ailment_names . "," . getTableFieldValue('ailment', 'ailment_name', 'ailment_id', $ailment_names_ids_array[$i]);
|
|
}
|
|
}
|
|
$ailment_system_ids = $rows_emp_appoint['ailment_systems_new'];
|
|
$ailment_system_ids_array = array();
|
|
$ailment_system_ids_array = explode(",", $ailment_system_ids);
|
|
$ailment_systems = "";
|
|
for ($i = 0; $i < count($ailment_system_ids_array); $i ++) {
|
|
if ($i == 0) {
|
|
$ailment_systems = getTableFieldValue('ailment_system', 'ailment_sys_name', 'ailment_sys_id', $ailment_system_ids_array[$i]);
|
|
} else {
|
|
$ailment_systems = $ailment_systems . "," . getTableFieldValue('ailment_system', 'ailment_sys_name', 'ailment_sys_id', $ailment_system_ids_array[$i]);
|
|
}
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</table>
|
|
<br>
|
|
|
|
<table border="1" class="tbl1" width="100%">
|
|
|
|
<tr>
|
|
|
|
<th width="12%" valign="top">Diagnosis :</th>
|
|
<td valign="top" align="left" width="38%"><?php echo $ailment_names?></td>
|
|
|
|
|
|
|
|
<th width="15%" valign="top" align="left">Ailment System :</th>
|
|
<td width="35%" valign="top" align="left"><?php echo $ailment_systems;?></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
</table>
|
|
<br>
|
|
<br>
|
|
<?php $appointment_id=$_REQUEST['appointment_id_pdf'] ; ?>
|
|
|
|
<?php include('treatment_view_common.php'); ?>
|
|
|
|
<br>
|
|
<br>
|
|
<table border="1" width="100%" cellspacing="0">
|
|
<tr>
|
|
<th width="20%" valign="top">Additional Treatment Recommendations(if
|
|
Any):</th>
|
|
<td valign="top" align="left" colspan="3"><?php echo nl2br($rows_emp_appoint['external_treatments'])?></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
<br>
|
|
<table border="1" width="100%" cellspacing="0">
|
|
<tr>
|
|
|
|
<th width="15%">Referral:</th>
|
|
|
|
<td width="35%"><?php echo nl2br($rows_emp_appoint['referral'])?></td>
|
|
|
|
<th width="15%">Follow-up:</th>
|
|
|
|
<td width="35%"><?php echo nl2br($rows_emp_appoint['followup'])?></td>
|
|
</tr>
|
|
<tr>
|
|
<th>Advices:</th>
|
|
<td><?php echo nl2br($health_advices)?></td>
|
|
<th>Precautions:</th>
|
|
<td><?php echo nl2br($rows_emp_appoint['remarks'])?></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>Medical Tests Recommended:</th>
|
|
|
|
<td colspan="3"><?php echo nl2br($tests)?></td>
|
|
</tr>
|
|
<tr>
|
|
<th>Followup-Remarks:</th>
|
|
|
|
<td colspan="3"><?php echo nl2br($rows_emp_appoint['followup_remarks'])?></td>
|
|
</tr>
|
|
</table>
|
|
<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>
|