fixes to prior statements improvements
[openemr.git] / interface / cmsportal / lbf_form.php
blob47103f72cbbd848722c865fe5e10f9292d578304
1 <?php
2 /**
3 * LBF form handling for the WordPress Patient Portal.
5 * LICENSE: This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
16 * @package OpenEMR
17 * @author Rod Roark <rod@sunsetsystems.com>
20 $sanitize_all_escapes = true;
21 $fake_register_globals = false;
23 require_once("../globals.php");
24 require_once("$srcdir/patient.inc");
25 require_once("$srcdir/formdata.inc.php");
26 require_once("$srcdir/options.inc.php");
27 require_once("portal.inc.php");
29 $postid = intval($_REQUEST['postid']);
31 // Get the portal request data.
32 if (!$postid) die(xlt('Request ID is missing!'));
33 $result = cms_portal_call(array('action' => 'getpost', 'postid' => $postid));
34 if ($result['errmsg']) {
35 die(text($result['errmsg']));
38 // Look up the patient in OpenEMR.
39 $ptid = lookup_openemr_patient($result['post']['user']);
41 <html>
42 <head>
43 <?php html_header_show(); ?>
44 <link rel=stylesheet href="<?php echo $css_header; ?>" type="text/css">
46 <style type="text/css">@import url(../../library/dynarch_calendar.css);</style>
47 <style>
49 tr.head { font-size:10pt; background-color:#cccccc; text-align:center; }
50 tr.detail { font-size:10pt; background-color:#ddddff; }
51 td input { background-color:transparent; }
53 </style>
55 <script type="text/javascript" src="../../library/textformat.js"></script>
56 <script type="text/javascript" src="../../library/dynarch_calendar.js"></script>
57 <?php include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?>
58 <script type="text/javascript" src="../../library/dynarch_calendar_setup.js"></script>
59 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-1-2-2/index.js"></script>
61 <script language="JavaScript">
63 var mypcc = '<?php echo $GLOBALS['phone_country_code'] ?>';
65 function myRestoreSession() {
66 if (top.restoreSession) top.restoreSession(); else opener.top.restoreSession();
67 return true;
70 function validate() {
71 var f = document.forms[0];
72 // TBD
73 return true;
76 function openPatient() {
77 myRestoreSession();
78 opener.top.RTop.document.location.href = '../patient_file/summary/demographics.php?set_pid=<?php echo attr($ptid); ?>';
81 </script>
82 </head>
84 <body class="body_top">
86 <?php echo "<!-- "; print_r($result); echo " -->\n"; // debugging ?>
88 <center>
90 <form method='post' action='lbf_form.php' onsubmit='return validate()'>
92 <table width='100%' cellpadding='1' cellspacing='2'>
93 <tr class='head'>
94 <th align='left'><?php echo xlt('Field'); ?></th>
95 <th align='left'><?php echo xlt('Value'); ?></th>
96 </tr>
98 <?php
99 foreach ($result['fields'] as $field_id => $newvalue) {
100 if (is_array($newvalue)) {
101 $tmp = '';
102 foreach ($newvalue as $value) {
103 if ($tmp !== '') $tmp .= ', ';
104 $tmp .= $value;
106 $newvalue = $tmp;
108 $newvalue = trim($newvalue);
109 $field_title = $result['labels'][$field_id];
110 echo " <tr class='detail'>\n";
111 echo " <td class='bold'>" . text($field_title) . "</td>\n";
112 echo " <td>";
113 echo text($newvalue);
114 echo "</td>\n";
115 echo " </tr>\n";
119 </table>
122 <input type='button' value='<?php echo xla('Open Patient'); ?>' onclick="openPatient()" />
123 &nbsp;
124 <input type='button' value='<?php echo xla('Back'); ?>' onclick="myRestoreSession();location='list_requests.php'" />
125 </p>
127 </form>
129 <script language="JavaScript">
130 </script>
132 </center>
133 </body>
134 </html>