} echo "</tr>\n"; $cell_count = 0; } } function end_group() { global $last_group; if (strlen($last_group) > 0) { end_row(); echo " </table>\n"; echo "</div>\n"; } } // If we are editing a transaction, get its ID and data. $trow = $transid ? getTransById($transid) : array(); ?> <html> <head> <?php html_header_show(); ?> <link rel='stylesheet' href="<?php echo $css_header; ?> " type="text/css"> <link rel="stylesheet" type="text/css" href="../../../library/js/fancybox/jquery.fancybox-1.2.6.css" media="screen" /> <style type="text/css">@import url(../../../library/dynarch_calendar.css);</style> <script type="text/javascript" src="../../../library/dynarch_calendar.js"></script>
//STOP FAKE REGISTER GLOBALS $fake_register_globals = false; // include_once "../../globals.php"; require_once "{$srcdir}/transactions.inc"; require_once "{$srcdir}/options.inc.php"; include_once "{$srcdir}/patient.inc"; $template_file = "{$webserver_root}/custom/referral_template.html"; $TEMPLATE_LABELS = array('label_clinic_id' => htmlspecialchars(xl('Clinic ID')), 'label_control_no' => htmlspecialchars(xl('Control No.')), 'label_date' => htmlspecialchars(xl('Date')), 'label_webpage_title' => htmlspecialchars(xl('Referral Form')), 'label_form1_title' => htmlspecialchars(xl('REFERRAL FORM')), 'label_name' => htmlspecialchars(xl('Name')), 'label_age' => htmlspecialchars(xl('Age')), 'label_gender' => htmlspecialchars(xl('Gender')), 'label_address' => htmlspecialchars(xl('Address')), 'label_postal' => htmlspecialchars(xl('Postal')), 'label_phone' => htmlspecialchars(xl('Phone')), 'label_ref_reason' => htmlspecialchars(xl('Reference Reason')), 'label_diagnosis' => htmlspecialchars(xl('Diagnosis')), 'label_ref_class' => htmlspecialchars(xl('Reference classification (risk level)')), 'label_dr_name_sig' => htmlspecialchars(xl('Doctor\'s name and signature')), 'label_refer_to' => htmlspecialchars(xl('Referred to')), 'label_clinic' => htmlspecialchars(xl('Health centre/clinic')), 'label_history_summary' => htmlspecialchars(xl('Client medical history summary')), 'label_bp' => htmlspecialchars(xl('Blood pressure')), 'label_ht' => htmlspecialchars(xl('Height')), 'label_wt' => htmlspecialchars(xl('Weight')), 'label_ref_name_sig' => htmlspecialchars(xl('Referer name and signature')), 'label_special_name_sig' => htmlspecialchars(xl('Specialist name and signature')), 'label_form2_title' => htmlspecialchars(xl('COUNTER REFERRAL FORM')), 'label_findings' => htmlspecialchars(xl('Findings')), 'label_final_diagnosis' => htmlspecialchars(xl('Final Diagnosis')), 'label_services_provided' => htmlspecialchars(xl('Services provided')), 'label_recommendations' => htmlspecialchars(xl('Recommendations and treatment')), 'label_scripts_and_referrals' => htmlspecialchars(xl('Prescriptions and other referrals')), 'label_subhead_clinic' => htmlspecialchars(xl('Clinic Copy')), 'label_subhead_patient' => htmlspecialchars(xl('Client Copy')), 'label_subhead_referred' => htmlspecialchars(xl('For Referred Organization/Practitioner'))); if (!is_file($template_file)) { die("{$template_file} does not exist!"); } $transid = empty($_REQUEST['transid']) ? 0 : $_REQUEST['transid'] + 0; // if (!$transid) die("Transaction ID is missing!"); if ($transid) { $trow = getTransById($transid); $patient_id = $trow['pid']; $refer_date = empty($trow['refer_date']) ? date('Y-m-d') : $trow['refer_date']; } else { if (empty($_REQUEST['patient_id'])) { // If no transaction ID or patient ID, this will be a totally blank form. $patient_id = 0; $refer_date = ''; } else { $patient_id = $_REQUEST['patient_id'] + 0; $refer_date = date('Y-m-d'); } $trow = array('id' => '', 'pid' => $patient_id, 'refer_date' => $refer_date); } if ($patient_id) { $patdata = getPatientData($patient_id);