<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_once ("includes/functions.php"); error_reporting(E_ERROR | E_PARSE); error_log("id:" . $_REQUEST['appointment_idpdf']); $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='" . $_REQUEST['appointment_idpdf'] . "'"; 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']; $sql_details = "select * from hospitalization_details where appointment_id = '" . $_REQUEST['appointment_idpdf'] . "'"; error_log("sql hospital pres " . $sql_details); $res_details = mysqli_query($conn, $sql_details); $employee_code = $rows_emp_appoint['emp_code']; $father_name = $rows_emp_appoint['father_name']; ?> <style> body { text-transform: capitalize; } .tbl1 { width: 100%; } th { background-color: #e1e1e1; font-size: 12px; font-style: bold; vertical-align: top; } td { text-align: left; font-size: 12px; vertical-align: top; } </style> </head> <body> <table border="1" cellspacing="0" width="100%"> <tr> <th colspan="2" align="center" style="font-size: 20px;background-color: #243557;color: white"> Hospitalization Details</th> </tr> <tr> <td width="100%" colspan="2"></td> </tr> <tr> <th colspan="2">Reporting Time in OHC: <?php echo date("G:i a", strtotime($rows_emp_appoint['appointment_date'])) ?> <span style="margin-left:250px">Date: <?php echo date("d/M/Y", strtotime($rows_emp_appoint['appointment_date'])) ?> </span> </th> </tr> <tr> <th>Name Of Patient:</th> <td> <?php echo $patient_name; ?> </td> </tr> <tr> <th>Employee ID:</th> <td> <?php echo $rows_emp_appoint['emp_code'] ?> </td> </tr> <tr> <th>Age of Patient: </th> <td> <?php $from = new DateTime($rows_emp_appoint['dob']); $to = new DateTime('today'); echo $from->diff($to)->y; ?> </td> </tr> <tr> <th>Sex: </th> <td> <?php if ($rows_emp_appoint['gender'] == 'M') { echo 'Male'; } else { echo 'Female'; } ?> </td> </tr> <tr> <th>Individual Contact No.</th> <td> <?php echo $rows_emp_appoint['primary_phone'] ?> </td> </tr> <tr> <th>Designation and employment status</th> <td> <?php echo getTableFieldValue('designation', 'designation_name', 'designation_id', $rows_emp_appoint['designation_id']) . " " ?> <?php echo $rows_emp_appoint['status'] ?> </td> </tr> <!-- <tr> <td colspan="1">Division/Department/Station</td> <td colspan="2"> <?php echo getTableFieldValue('bussiness_unit', 'bu_name', 'bu_id', $rows_emp_appoint['bu_id']) ?>/ <?php echo getTableFieldValue('department', 'dept_name', 'dept_id', $rows_emp_appoint['dept_id']) ?>/ <?php echo getTableFieldValue('section', 'section_name', 'section_id', $rows_emp_appoint['section_id']) ?> </td> </tr> --> <tr> <th>Name Of Supervisor and Contact no</th> <td> <?php echo getTableFieldValue('patient_master', 'patient_name', 'id', $rows_emp_appoint['emp_mgr_code']) . " " ?> <?php echo getTableFieldValue('patient_master', 'primary_phone', 'id', $rows_emp_appoint['emp_mgr_code']) ?> </td> </tr> <tr> <th>Reporting Time in OHC[24 Hrs format]</th> <td> <?php echo date("g:i a", strtotime($rows_emp_appoint['appointment_date'])) ?> </td> </tr> <tr> <th align="center" colspan="2">Details</th> </tr> <tr> <th>Referral:</td> <td> <?php echo nl2br(($rows_emp_appoint['referral'] != '') ? getCommaSeperatedValuesForInClause("select referral_point_name from referral_point ", "referral_point_id ", $rows_emp_appoint['referral']) : "N/A") ?> </td> </tr> <tr> <th>Referral Reason:</th> <td style="word-wrap: break-word; word-break: break-all;"> <?php echo $rows_emp_appoint['referral_doc'] ?> </td> </tr> <tr> <th>Ambulance Out Time:</th> <td> <?php echo $rows_emp_appoint['ambulance_out_time'] != null ? date_format(date_create($rows_emp_appoint['ambulance_out_time']), "d-M-Y h:i:sa ") : 'NA' ?> </td> </tr> <tr> <th>Ambulance In Time:</th> <td> <?php echo $rows_emp_appoint['ambulance_in_time'] != null ? date_format(date_create($rows_emp_appoint['ambulance_in_time']), "d-M-Y h:i:sa ") : 'NA' ?> </td> </tr> <?php while ($rows_details = mysqli_fetch_assoc($res_details)) { ?> <tr> <th>Entry Time:</th> <td> <?php echo $rows_details['entry_time'] != null ? date_format(date_create($rows_details['entry_time']), "d-M-Y h:i:sa ") : 'NA' ?> </td> </tr> <tr> <th>Additional Details :</th> <td style="word-wrap: break-word; word-break: break-all;"> <?php echo $rows_details['remark'] ?> </td> </tr> <?php } ?> </table> <table width="100%"> <tr> <td> <?php if ($rows_emp_appoint_doc_details['emp_sign'] != '' || $rows_emp_appoint_doc_details['emp_sign'] != null) { ?> <img src="data:<?php echo $rows_emp_appoint_doc_details['image_type'] ?>;base64,<?php echo base64_encode($rows_emp_appoint_doc_details['emp_sign']) ?>" style="width: 120px; height: 80px;float: right" /> </td> <?php } ?> </tr> </table> </form> <form id="employeeDetailsFormPdf" action="" method="POST"> <input type="hidden" name="htmlText" id="htmlText" /> </form> </div> </body> <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>