-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
authorizations_full.php
148 lines (117 loc) · 4.81 KB
/
authorizations_full.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php
//SANITIZE ALL ESCAPES
$sanitize_all_escapes=true;
//
//STOP FAKE REGISTER GLOBALS
$fake_register_globals=false;
//
include_once("../../globals.php");
include_once("$srcdir/patient.inc");
if (isset($_GET["mode"]) && $_GET["mode"] == "authorize") {
newEvent("authorize",$_SESSION["authUser"],$_SESSION["authProvider"],1,$_GET["pid"]);
sqlStatement("update billing set authorized=1 where pid=?", array($_GET["pid"]) );
sqlStatement("update forms set authorized=1 where pid=?", array($_GET["pid"]) );
sqlStatement("update pnotes set authorized=1 where pid=?", array($_GET["pid"]) );
sqlStatement("update transactions set authorized=1 where pid=?", array($_GET["pid"]) );
}
?>
<html>
<head>
<?php html_header_show();?>
<link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
</head>
<body class="body_top">
<?php if ($GLOBALS['concurrent_layout']) { ?>
<a href="authorizations.php">
<?php } else { ?>
<a href="../main.php" target=Main>
<?php } ?>
<font class=title><?php echo htmlspecialchars(xl('Authorizations'),ENT_NOQUOTES); ?></font>
<font class=more><?php echo htmlspecialchars($tback,ENT_NOQUOTES); ?></font></a>
<?php
// billing
// forms
// pnotes
// transactions
//fetch billing information:
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) )) {
for ($iter = 0;$row = sqlFetchArray($res);$iter++)
$result[$iter] = $row;
if ($result) {
foreach ($result as $iter) {
$authorize{$iter{"pid"}}{"billing"} .= "<span class=small>" .
htmlspecialchars($iter{"user"},ENT_NOQUOTES) . ": </span><span class=text>" .
htmlspecialchars($iter{"code_text"} . " " . date("n/j/Y",strtotime($iter{"date"})),ENT_NOQUOTES) .
"</span><br>\n";
}
}
}
//fetch transaction information:
if ($res = sqlStatement("select * from transactions where authorized=0 and groupname=?", array($groupname) )) {
for ($iter = 0;$row = sqlFetchArray($res);$iter++)
$result2[$iter] = $row;
if ($result2) {
foreach ($result2 as $iter) {
$authorize{$iter{"pid"}}{"transaction"} .= "<span class=small>" .
htmlspecialchars($iter{"user"},ENT_NOQUOTES) . ": </span><span class=text>" .
htmlspecialchars($iter{"title"} . ": " . strterm($iter{"body"},25) . " " . date("n/j/Y",strtotime($iter{"date"})),ENT_NOQUOTES) .
"</span><br>\n";
}
}
}
if (empty($GLOBALS['ignore_pnotes_authorization'])) {
//fetch pnotes information, exclude ALL deleted notes
if ($res = sqlStatement("select * from pnotes where authorized=0 and deleted!=1 and groupname=?", array($groupname) )) {
for ($iter = 0;$row = sqlFetchArray($res);$iter++) $result3[$iter] = $row;
if ($result3) {
foreach ($result3 as $iter) {
$authorize{$iter{"pid"}}{"pnotes"} .= "<span class=small>" .
htmlspecialchars($iter{"user"},ENT_NOQUOTES) . ": </span><span class=text>" .
htmlspecialchars(strterm($iter{"body"},25) . " " . date("n/j/Y",strtotime($iter{"date"})),ENT_NOQUOTES) .
"</span><br>\n";
}
}
}
}
//fetch forms information:
if ($res = sqlStatement("select * from forms where authorized=0 and groupname=?", array($groupname) )) {
for ($iter = 0;$row = sqlFetchArray($res);$iter++)
$result4[$iter] = $row;
if ($result4) {
foreach ($result4 as $iter) {
$authorize{$iter{"pid"}}{"forms"} .= "<span class=small>" .
htmlspecialchars($iter{"user"},ENT_NOQUOTES) . ": </span><span class=text>" .
htmlspecialchars($iter{"form_name"} . " " . date("n/j/Y",strtotime($iter{"date"})),ENT_NOQUOTES) .
"</span><br>\n";
}
}
}
?>
<table border=0 cellpadding=0 cellspacing=2 width=100%>
<tr>
<td valign=top>
<?php
if ($authorize) {
while(list($ppid,$patient) = each($authorize)){
$name = getPatientData($ppid);
echo "<tr><td valign=top><span class=bold>". htmlspecialchars($name{"fname"} . " " . $name{"lname"},ENT_NOQUOTES) .
"</span><br><a class=link_submit href='authorizations_full.php?mode=authorize&pid=" .
htmlspecialchars($ppid,ENT_QUOTES) . "'>" . htmlspecialchars(xl('Authorize'),ENT_NOQUOTES) . "</a></td>\n";
echo "<td valign=top><span class=bold>".htmlspecialchars(xl('Billing'),ENT_NOQUOTES).
":</span><span class=text><br>" . $patient{"billing"} . "</td>\n";
echo "<td valign=top><span class=bold>".htmlspecialchars(xl('Transactions'),ENT_NOQUOTES).
":</span><span class=text><br>" . $patient{"transaction"} . "</td>\n";
echo "<td valign=top><span class=bold>".htmlspecialchars(xl('Patient Notes'),ENT_NOQUOTES).
":</span><span class=text><br>" . $patient{"pnotes"} . "</td>\n";
echo "<td valign=top><span class=bold>".htmlspecialchars(xl('Encounter Forms'),ENT_NOQUOTES).
":</span><span class=text><br>" . $patient{"forms"} . "</td>\n";
echo "</tr>\n";
$count++;
}
}
?>
</td>
</tr>
</table>
</body>
</html>