ESH/opd_form_short_pdf.php

395 lines
9.9 KiB
PHP
Raw Permalink 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");
$appoint_id = $_REQUEST['appointment_id_pdf'];
if ($appoint_id == '' || $appoint_id == null) {
$appoint_id = $_REQUEST['appointment_idpdf'];
}
error_reporting(E_ERROR | E_PARSE);
error_log("error" . $appoint_id);
$unitMap = getKeyValueMap('unit_master', 'unit_id', 'unit_name');
$queryc = "select * from company_profile ";
// echo $query;
error_log("APPOINTMENT ID PDF::" . $$appoint_id);
$resultc = mysqli_query($conn, $queryc);
$row_company = mysqli_fetch_array($resultc);
@extract($row_company);
$sql_employee_appointment = "select a.*, p.patient_name, p.dept_id, p.emp_code, p.father_name, p.designation_id,employer_contractor_id,
patient_cat_id, gender,blood_group,emp_cadre,dob,p.dept_id,p.bu_id,p.section_id,p.bu_id,p.sub_section_id from employee_appointment a, patient_master p where a.emp_id=p.id
and appointment_id='" . $appoint_id . "'";
error_log("error" . $sql_employee_appointment);
// echo $sql_employee_appointment;
error_log("OPD PDF QUERY:" . $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, '');
error_log($doc_emp_id);
$doc_name = getTableFieldValue('patient_master', 'patient_name', 'id', $doc_emp_id, '');
$result = mysqli_query($conn, $query);
$row = mysqli_fetch_array($result);
@extract($row);
$sql_doc_details = "select * from employee_signature where emp_id='$doc_emp_id'";
$result_doc_details = mysqli_query($conn, $sql_doc_details);
$row_doc_details = mysqli_fetch_array($result_doc_details);
$employee_code = $rows_emp_appoint['emp_code'];
$father_name = $rows_emp_appoint['father_name'];
if ($rows_emp_appoint['IsEmergency'] == 1) {
$ans = "Yes";
} else {
$ans = "No";
}
date_default_timezone_set('Asia/Kolkata');
$date = date('Y-m-d H:i:s');
$currentDate = date_format(date_create($date), "d-M-Y h:i:sa ");
$ailment_names = $rows_emp_appoint['ailments_new'];
$health_advices = $rows_emp_appoint['health_advices_new']; // getCommaSeperatedValuesForInClause("select health_advice_name from health_advice ","health_advice_id",$rows_emp_appoint['health_advices']);
$tests = $rows_emp_appoint['recommended_tests_new']; // getCommaSeperatedValuesForInClause("select section_name from checkup_form_section ","section_id",$rows_emp_appoint['tests']);
?>
<style>
th {
font-size: 12px;
font-style: bold;
vertical-align: top;
}
td {
text-align: left;
font-size: 11px;
vertical-align: top;
}
</style>
</head>
<!-- <div
style="font-size: 12px; float: right;border: 1px solid black;padding: 5px">
<b>F-MED-01</b>
</div> -->
<table width="100%">
<tr>
<td width="40%">
<?php if (isset($row_company['company_logo']) && $row_company['company_logo'] != null) { ?>
<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;">
<?php } ?>
</td>
<td width="60%" align="center">
<div style="margin-left: 20px;">
<center style="font-size: 15px ;"><b>
<?php echo $row_company['company_name'] ?>
<br> <span style="font-size: 12px; ;">MEDICAL DEPARTMENT</span>
<pre style="margin-top: 0px; font-size:10px;"><?php echo $row_company['address'] ?></pre>
</b>
</center>
</div>
</td>
<td width="40%" align="right">
<?php if (isset($row_company['right_com_logo']) && $row_company['right_com_logo'] != null) { ?>
<img src="data:<?php echo $row_company['right_image_type'] ?>;base64,<?php echo base64_encode($row_company['right_com_logo']) ?>"
style="width: 150px; height: 60px; margin: 0px; padding: 0px;">
<?php } ?>
</td>
</tr>
<tr rowspan="2">
<td colspan="1"></td>
<td colspan="2"></td>
</tr>
<tr>
<td colspan="1"></td>
<td colspan="2"></td>
</tr>
<tr>
<td colspan="1"></td>
<td colspan="2"></td>
</tr>
<tr>
<td colspan="1"></td>
<td colspan="2"><strong style="margin-left: 110px;text-decoration: underline;">PRESCRIPTION</strong></td>
</tr>
</table>
<!-- <div style="display: inline-block;">
<h3><?php echo $row_company['company_name'] ?></h3>
<strong style="float: right;">Mob.<?php echo $row_company['primary_phone'] ?></strong>
</div>
<div style="margin-top: -50px;">
<h5 style="text-align: center"><?php echo $row_company['address'] ?></h5>
</div>
<div>
<h5 style="text-align: center;text-decoration: underline;">OPD TICKET</h5>
</div> -->
<!-- -->
<br>
<table style="border: 1px solid black;font-size: 11px" width="100%">
<tr>
<td><strong>MRN:</strong><?php echo $rows_emp_appoint['ticket_no'] ?></td>
<td width="50%"><b>EMPLOYEE ID:</b> <?php echo $employee_code ?></td>
</tr>
<tr>
<td width="50%"><b>PATIENT NAME:</b> <?php echo $patient_name ?> </td>
<td width="50%"><b>FATHER'S NAME:</b> <?php echo $father_name ?></td>
</tr>
<tr>
<td width="50%"><b>AGE:</b>
<?php echo isset($rows_emp_appoint['dob']) ? date_diff(date_create($rows_emp_appoint['dob']), date_create('today'))->y : "Not Available"; ?>
</td>
<td width="50%"><b>GENDER:</b> <?php echo $rows_emp_appoint['gender'] == 'M' ? "Male" : "Female" ?></td>
</tr>
<tr>
<td width="50%"><b>DIVISION:</b>
<?php echo getTableFieldValue('bussiness_unit', 'bu_name', 'bu_id', $rows_emp_appoint['bu_id'], ''); ?></td>
<td width="50%"><b>DEPARTMENT:</b>
<?php echo getTableFieldValue('department', 'dept_name', 'dept_id', $rows_emp_appoint['dept_id'], ''); ?>
</td>
</tr>
<tr>
<!-- <td width="50%">
<b>UTE: </b>
<?php echo getTableFieldValue('section', 'section_name', 'section_id', $rows_emp_appoint['section_id'], ''); ?>
</td> -->
<td width="50%">
<b>AREA/SECTION:</b>
<?php echo getTableFieldValue('sub_section', 'sub_section_name', 'sub_section_id', $rows_emp_appoint['sub_section_id'], ''); ?>
</td>
</tr>
<tr>
<td width="50%"><b>IN TIME:</b>
<?php echo date_format(date_create($rows_emp_appoint['appointment_date']), "d-M-Y h:i:sa ") ?></td>
<td width="50%"><b>CLEARANCE TIME:</b>
<?php echo date_format(date_create($rows_emp_appoint['clearance_time']), "d-M-Y h:i:sa ") ?></td>
</tr>
</table>
<br>
<table border="0" width="100%">
</table>
<?php $appointment_id = $appoint_id; ?>
<?php include('treatment_view_common.php'); ?>
<br>
<table width="100%">
<tr>
<td><img src="data:<?php echo $row_doc_details['image_type'] ?>;base64,<?php echo base64_encode($row_doc_details['emp_sign']) ?>"
style="width: 120px; height: 80px;float: right" /></td>
</tr>
</table>
<br>
<br>
<br>
<br>
<table width="100%">
<tr>
<td><strong style="float: right;">Signature & Stamp</strong></td>
</tr>
</table>
<br>
<!-- <table width="100%">
<tr>
<td><strong style="float: right;">
<?php if ($_SESSION['RoleCode' == 'DOC']) {
echo "Dr.$doc_name";
} else {
echo $doc_name;
}
?>
</strong></td>
</tr>
</table>
<br> -->
<!-- <table width="100%">
<tr>
<td><strong style="float: right;">Regd. No.:
<?php echo $row_doc_details['registration_no'] ?>
</strong></td>
</tr>
</table> -->
<br>
<hr>
<table cellspacing="0" width="100%">
<tr>
<td style="text-align:center">
<strong>PREVENTION IS BETTER THAN CURE</strong>
</td>
</tr>
<tr>
<td style="text-align: center">
<strong>NOTE: NOT FOR USE MEDICO LEGAL PURPOSES</strong>
</td>
</tr>
</table>
</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>