This is an API for storing the documents in Apache CouchDB instead of in the disk.
[openemr.git] / interface / main / authorizations / authorizations_full.php
blobb61c5c09778a26dca3b17777c44caa219281193b
1 <?php
3 //SANITIZE ALL ESCAPES
4 $sanitize_all_escapes=true;
5 //
7 //STOP FAKE REGISTER GLOBALS
8 $fake_register_globals=false;
9 //
11 include_once("../../globals.php");
12 include_once("$srcdir/patient.inc");
14 if (isset($_GET["mode"]) && $_GET["mode"] == "authorize") {
15 newEvent("authorize",$_SESSION["authUser"],$_SESSION["authProvider"],1,$_GET["pid"]);
16 sqlStatement("update billing set authorized=1 where pid=?", array($_GET["pid"]) );
17 sqlStatement("update forms set authorized=1 where pid=?", array($_GET["pid"]) );
18 sqlStatement("update pnotes set authorized=1 where pid=?", array($_GET["pid"]) );
19 sqlStatement("update transactions set authorized=1 where pid=?", array($_GET["pid"]) );
23 <html>
24 <head>
25 <?php html_header_show();?>
26 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
27 </head>
28 <body class="body_top">
30 <?php if ($GLOBALS['concurrent_layout']) { ?>
31 <a href="authorizations.php">
32 <?php } else { ?>
33 <a href="../main.php" target=Main>
34 <?php } ?>
35 <font class=title><?php echo htmlspecialchars(xl('Authorizations'),ENT_NOQUOTES); ?></font>
36 <font class=more><?php echo htmlspecialchars($tback,ENT_NOQUOTES); ?></font></a>
38 <?php
39 // billing
40 // forms
41 // pnotes
42 // transactions
44 //fetch billing information:
45 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) )) {
46 for ($iter = 0;$row = sqlFetchArray($res);$iter++)
47 $result[$iter] = $row;
49 if ($result) {
50 foreach ($result as $iter) {
52 $authorize{$iter{"pid"}}{"billing"} .= "<span class=small>" .
53 htmlspecialchars($iter{"user"},ENT_NOQUOTES) . ": </span><span class=text>" .
54 htmlspecialchars($iter{"code_text"} . " " . date("n/j/Y",strtotime($iter{"date"})),ENT_NOQUOTES) .
55 "</span><br>\n";
62 //fetch transaction information:
63 if ($res = sqlStatement("select * from transactions where authorized=0 and groupname=?", array($groupname) )) {
64 for ($iter = 0;$row = sqlFetchArray($res);$iter++)
65 $result2[$iter] = $row;
67 if ($result2) {
68 foreach ($result2 as $iter) {
70 $authorize{$iter{"pid"}}{"transaction"} .= "<span class=small>" .
71 htmlspecialchars($iter{"user"},ENT_NOQUOTES) . ": </span><span class=text>" .
72 htmlspecialchars($iter{"title"} . ": " . strterm($iter{"body"},25) . " " . date("n/j/Y",strtotime($iter{"date"})),ENT_NOQUOTES) .
73 "</span><br>\n";
80 if (empty($GLOBALS['ignore_pnotes_authorization'])) {
81 //fetch pnotes information, exclude ALL deleted notes
82 if ($res = sqlStatement("select * from pnotes where authorized=0 and deleted!=1 and groupname=?", array($groupname) )) {
83 for ($iter = 0;$row = sqlFetchArray($res);$iter++) $result3[$iter] = $row;
84 if ($result3) {
85 foreach ($result3 as $iter) {
86 $authorize{$iter{"pid"}}{"pnotes"} .= "<span class=small>" .
87 htmlspecialchars($iter{"user"},ENT_NOQUOTES) . ": </span><span class=text>" .
88 htmlspecialchars(strterm($iter{"body"},25) . " " . date("n/j/Y",strtotime($iter{"date"})),ENT_NOQUOTES) .
89 "</span><br>\n";
95 //fetch forms information:
96 if ($res = sqlStatement("select * from forms where authorized=0 and groupname=?", array($groupname) )) {
97 for ($iter = 0;$row = sqlFetchArray($res);$iter++)
98 $result4[$iter] = $row;
100 if ($result4) {
101 foreach ($result4 as $iter) {
103 $authorize{$iter{"pid"}}{"forms"} .= "<span class=small>" .
104 htmlspecialchars($iter{"user"},ENT_NOQUOTES) . ": </span><span class=text>" .
105 htmlspecialchars($iter{"form_name"} . " " . date("n/j/Y",strtotime($iter{"date"})),ENT_NOQUOTES) .
106 "</span><br>\n";
114 <table border=0 cellpadding=0 cellspacing=2 width=100%>
115 <tr>
116 <td valign=top>
118 <?php
119 if ($authorize) {
121 while(list($ppid,$patient) = each($authorize)){
123 $name = getPatientData($ppid);
125 echo "<tr><td valign=top><span class=bold>". htmlspecialchars($name{"fname"} . " " . $name{"lname"},ENT_NOQUOTES) .
126 "</span><br><a class=link_submit href='authorizations_full.php?mode=authorize&pid=" .
127 htmlspecialchars($ppid,ENT_QUOTES) . "'>" . htmlspecialchars(xl('Authorize'),ENT_NOQUOTES) . "</a></td>\n";
128 echo "<td valign=top><span class=bold>".htmlspecialchars(xl('Billing'),ENT_NOQUOTES).
129 ":</span><span class=text><br>" . $patient{"billing"} . "</td>\n";
130 echo "<td valign=top><span class=bold>".htmlspecialchars(xl('Transactions'),ENT_NOQUOTES).
131 ":</span><span class=text><br>" . $patient{"transaction"} . "</td>\n";
132 echo "<td valign=top><span class=bold>".htmlspecialchars(xl('Patient Notes'),ENT_NOQUOTES).
133 ":</span><span class=text><br>" . $patient{"pnotes"} . "</td>\n";
134 echo "<td valign=top><span class=bold>".htmlspecialchars(xl('Encounter Forms'),ENT_NOQUOTES).
135 ":</span><span class=text><br>" . $patient{"forms"} . "</td>\n";
136 echo "</tr>\n";
137 $count++;
142 </td>
144 </tr>
145 </table>
147 </body>
148 </html>