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

103 lines
3.1 KiB
PHP

<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<style>
#opd_form_div {
max-width: 7cm;
margin: 0 auto;
}
table {
width: 100%;
}
th {
font-size: 12px;
font-weight: bold;
vertical-align: top;
}
td,
span {
text-align: left;
font-size: 10px;
vertical-align: top;
}
</style>
</head>
<body>
<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');
$sql_employee_appointment = "select * from employee_appointment where appointment_id='" . $appoint_id . "'";
error_log("query to get data " . $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 = getFieldFromTable('patient_name', 'patient_master', 'id', $rows_emp_appoint['emp_id']);
$emp_code = getFieldFromTable('emp_code', 'patient_master', 'id', $rows_emp_appoint['emp_id']);
?>
<table>
<tr>
<td>Date: </td>
<td><?php echo date('d/m/Y', strtotime($rows_emp_appoint['appointment_date']))?></td>
</tr>
<tr>
<td>Employee No: </td>
<td><?= $emp_code ?></td>
</tr>
<tr>
<td>Employee Name: </td>
<td><?= $patient_name ?></td>
</tr>
<tr>
<td>Medications:</td>
</tr>
</table>
<?php $appointment_id = $appoint_id; ?>
<?php include('treatment_view_common_short.php'); ?>
</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>
</body>
</html>