Fully responsive globals.php with vertical menu (#2460)
[openemr.git] / interface / cmsportal / lbf_form.php
bloba30e0f8343f7be73b7aeb06321780c26217fee70
1 <?php
2 /**
3 * LBF form handling for the WordPress Patient Portal.
5 * @package OpenEMR
6 * @link http://www.open-emr.org
7 * @author Rod Roark <rod@sunsetsystems.com>
8 * @author Brady Miller <brady.g.miller@gmail.com>
9 * @copyright Copyright (c) 2014 Rod Roark <rod@sunsetsystems.com>
10 * @copyright Copyright (c) 2017 Brady Miller <brady.g.miller@gmail.com>
11 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
15 require_once("../globals.php");
16 require_once("$srcdir/patient.inc");
17 require_once("$srcdir/options.inc.php");
18 require_once("portal.inc.php");
20 $postid = intval($_REQUEST['postid']);
22 // Get the portal request data.
23 if (!$postid) {
24 die(xlt('Request ID is missing!'));
27 $result = cms_portal_call(array('action' => 'getpost', 'postid' => $postid));
28 if ($result['errmsg']) {
29 die(text($result['errmsg']));
32 // Look up the patient in OpenEMR.
33 $ptid = lookup_openemr_patient($result['post']['user']);
35 <html>
36 <head>
37 <link rel=stylesheet href="<?php echo $css_header; ?>" type="text/css">
38 <link rel="stylesheet" href="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker/build/jquery.datetimepicker.min.css">
40 <style>
42 tr.head { font-size:10pt; background-color:#cccccc; text-align:center; }
43 tr.detail { font-size:10pt; background-color:#ddddff; }
44 td input { background-color:transparent; }
46 </style>
48 <script type="text/javascript" src="../../library/textformat.js?v=<?php echo $v_js_includes; ?>"></script>
49 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-1-7-2/jquery.min.js"></script>
50 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker/build/jquery.datetimepicker.full.min.js"></script>
52 <script language="JavaScript">
54 function myRestoreSession() {
55 if (top.restoreSession) top.restoreSession(); else opener.top.restoreSession();
56 return true;
59 function validate() {
60 var f = document.forms[0];
61 // TBD
62 return true;
65 function openPatient() {
66 myRestoreSession();
67 opener.top.RTop.document.location.href = '../patient_file/summary/demographics.php?set_pid=<?php echo attr($ptid); ?>';
70 $(function() {
71 $('.datepicker').datetimepicker({
72 <?php $datetimepicker_timepicker = false; ?>
73 <?php $datetimepicker_showseconds = false; ?>
74 <?php $datetimepicker_formatInput = true; ?>
75 <?php require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?>
76 <?php // can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
77 });
78 $('.datetimepicker').datetimepicker({
79 <?php $datetimepicker_timepicker = true; ?>
80 <?php $datetimepicker_showseconds = false; ?>
81 <?php $datetimepicker_formatInput = true; ?>
82 <?php require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?>
83 <?php // can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
84 });
85 });
87 </script>
88 </head>
90 <body class="body_top">
92 <?php echo "<!-- ";
93 print_r($result);
94 echo " -->\n"; // debugging ?>
96 <center>
98 <form method='post' action='lbf_form.php' onsubmit='return validate()'>
100 <table width='100%' cellpadding='1' cellspacing='2'>
101 <tr class='head'>
102 <th align='left'><?php echo xlt('Field'); ?></th>
103 <th align='left'><?php echo xlt('Value'); ?></th>
104 </tr>
106 <?php
107 foreach ($result['fields'] as $field_id => $newvalue) {
108 if (is_array($newvalue)) {
109 $tmp = '';
110 foreach ($newvalue as $value) {
111 if ($tmp !== '') {
112 $tmp .= ', ';
115 $tmp .= $value;
118 $newvalue = $tmp;
121 $newvalue = trim($newvalue);
122 $field_title = $result['labels'][$field_id];
123 echo " <tr class='detail'>\n";
124 echo " <td class='bold'>" . text($field_title) . "</td>\n";
125 echo " <td>";
126 echo text($newvalue);
127 echo "</td>\n";
128 echo " </tr>\n";
132 </table>
135 <input type='button' value='<?php echo xla('Open Patient'); ?>' onclick="openPatient()" />
136 &nbsp;
137 <input type='button' value='<?php echo xla('Back'); ?>' onclick="myRestoreSession();location='list_requests.php'" />
138 </p>
140 </form>
141 </center>
142 </body>
143 </html>