Remove concurrent_layout and clarify layout and themes selections (#272)
[openemr.git] / interface / main / authorizations / authorizations_full.php
blobb9e5eb5edfae373ed6f90827450012034508eeb8
1 <?php
2 /**
3 * Authorizations full script.
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 Brady Miller <brady@sparmy.com>
18 * @link http://www.open-emr.org
21 //SANITIZE ALL ESCAPES
22 $sanitize_all_escapes=true;
25 //STOP FAKE REGISTER GLOBALS
26 $fake_register_globals=false;
29 include_once("../../globals.php");
30 include_once("$srcdir/patient.inc");
32 if (isset($_GET["mode"]) && $_GET["mode"] == "authorize") {
33 newEvent("authorize",$_SESSION["authUser"],$_SESSION["authProvider"],1,$_GET["pid"]);
34 sqlStatement("update billing set authorized=1 where pid=?", array($_GET["pid"]) );
35 sqlStatement("update forms set authorized=1 where pid=?", array($_GET["pid"]) );
36 sqlStatement("update pnotes set authorized=1 where pid=?", array($_GET["pid"]) );
37 sqlStatement("update transactions set authorized=1 where pid=?", array($_GET["pid"]) );
41 <html>
42 <head>
43 <?php html_header_show();?>
44 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
45 </head>
46 <body class="body_top">
48 <a href="authorizations.php" onclick='top.restoreSession()'>
49 <font class=title><?php echo htmlspecialchars(xl('Authorizations'),ENT_NOQUOTES); ?></font>
50 <font class=more><?php echo htmlspecialchars($tback,ENT_NOQUOTES); ?></font></a>
52 <?php
53 // billing
54 // forms
55 // pnotes
56 // transactions
58 //fetch billing information:
59 if ($res = sqlStatement("select *, concat(u.fname,' ', u.lname) as user from billing LEFT JOIN users as u on billing.user = u.id where billing.authorized=0 and groupname=?", array ($groupname) )) {
60 for ($iter = 0;$row = sqlFetchArray($res);$iter++)
61 $result[$iter] = $row;
63 if ($result) {
64 foreach ($result as $iter) {
66 $authorize{$iter{"pid"}}{"billing"} .= "<span class=small>" .
67 htmlspecialchars($iter{"user"},ENT_NOQUOTES) . ": </span><span class=text>" .
68 htmlspecialchars($iter{"code_text"} . " " . date("n/j/Y",strtotime($iter{"date"})),ENT_NOQUOTES) .
69 "</span><br>\n";
76 //fetch transaction information:
77 if ($res = sqlStatement("select * from transactions where authorized=0 and groupname=?", array($groupname) )) {
78 for ($iter = 0;$row = sqlFetchArray($res);$iter++)
79 $result2[$iter] = $row;
81 if ($result2) {
82 foreach ($result2 as $iter) {
84 $authorize{$iter{"pid"}}{"transaction"} .= "<span class=small>" .
85 htmlspecialchars($iter{"user"},ENT_NOQUOTES) . ": </span><span class=text>" .
86 htmlspecialchars($iter{"title"} . ": " . strterm($iter{"body"},25) . " " . date("n/j/Y",strtotime($iter{"date"})),ENT_NOQUOTES) .
87 "</span><br>\n";
94 if (empty($GLOBALS['ignore_pnotes_authorization'])) {
95 //fetch pnotes information, exclude ALL deleted notes
96 if ($res = sqlStatement("select * from pnotes where authorized=0 and deleted!=1 and groupname=?", array($groupname) )) {
97 for ($iter = 0;$row = sqlFetchArray($res);$iter++) $result3[$iter] = $row;
98 if ($result3) {
99 foreach ($result3 as $iter) {
100 $authorize{$iter{"pid"}}{"pnotes"} .= "<span class=small>" .
101 htmlspecialchars($iter{"user"},ENT_NOQUOTES) . ": </span><span class=text>" .
102 htmlspecialchars(strterm($iter{"body"},25) . " " . date("n/j/Y",strtotime($iter{"date"})),ENT_NOQUOTES) .
103 "</span><br>\n";
109 //fetch forms information:
110 if ($res = sqlStatement("select * from forms where authorized=0 and groupname=?", array($groupname) )) {
111 for ($iter = 0;$row = sqlFetchArray($res);$iter++)
112 $result4[$iter] = $row;
114 if ($result4) {
115 foreach ($result4 as $iter) {
117 $authorize{$iter{"pid"}}{"forms"} .= "<span class=small>" .
118 htmlspecialchars($iter{"user"},ENT_NOQUOTES) . ": </span><span class=text>" .
119 htmlspecialchars($iter{"form_name"} . " " . date("n/j/Y",strtotime($iter{"date"})),ENT_NOQUOTES) .
120 "</span><br>\n";
128 <table border=0 cellpadding=0 cellspacing=2 width=100%>
129 <tr>
130 <td valign=top>
132 <?php
133 if ($authorize) {
135 while(list($ppid,$patient) = each($authorize)){
137 $name = getPatientData($ppid);
139 echo "<tr><td valign=top><span class=bold>". htmlspecialchars($name{"fname"} . " " . $name{"lname"},ENT_NOQUOTES) .
140 "</span><br><a class=link_submit href='authorizations_full.php?mode=authorize&pid=" .
141 htmlspecialchars($ppid,ENT_QUOTES) . "' onclick='top.restoreSession()'>" . htmlspecialchars(xl('Authorize'),ENT_NOQUOTES) . "</a></td>\n";
142 echo "<td valign=top><span class=bold>".htmlspecialchars(xl('Billing'),ENT_NOQUOTES).
143 ":</span><span class=text><br>" . $patient{"billing"} . "</td>\n";
144 echo "<td valign=top><span class=bold>".htmlspecialchars(xl('Transactions'),ENT_NOQUOTES).
145 ":</span><span class=text><br>" . $patient{"transaction"} . "</td>\n";
146 echo "<td valign=top><span class=bold>".htmlspecialchars(xl('Patient Notes'),ENT_NOQUOTES).
147 ":</span><span class=text><br>" . $patient{"pnotes"} . "</td>\n";
148 echo "<td valign=top><span class=bold>".htmlspecialchars(xl('Encounter Forms'),ENT_NOQUOTES).
149 ":</span><span class=text><br>" . $patient{"forms"} . "</td>\n";
150 echo "</tr>\n";
151 $count++;
156 </td>
158 </tr>
159 </table>
161 </body>
162 </html>