Remove concurrent_layout and clarify layout and themes selections (#272)
[openemr.git] / interface / patient_file / encounter / superbill_codes.php
blobe9bd8f1d5aef5e7ac79019bd960ce890b83b0777
1 <?php
2 include_once("../../globals.php");
3 include_once("../../../custom/code_types.inc.php");
4 include_once("$srcdir/billing.inc");
5 include_once("$srcdir/sql.inc");
6 require_once("$srcdir/formdata.inc.php");
8 //the number of rows to display before resetting and starting a new column:
9 $N=10;
11 $mode = $_GET['mode'];
12 $type = $_GET['type'];
13 $modifier = $_GET['modifier'];
14 $units = $_GET['units'];
15 $fee = $_GET['fee'];
16 $code = $_GET['code'];
17 $text = $_GET['text'];
19 if (isset($mode)) {
20 if ($mode == "add") {
21 if (strtolower($type) == "copay") {
22 addBilling($encounter, $type, sprintf("%01.2f", $code), strip_escape_custom($text), $pid, $userauthorized,$_SESSION['authUserID'],$modifier,$units,sprintf("%01.2f", 0 - $code));
24 elseif (strtolower($type) == "other") {
25 addBilling($encounter, $type, $code, strip_escape_custom($text), $pid, $userauthorized,$_SESSION['authUserID'],$modifier,$units,sprintf("%01.2f", $fee));
27 else {
28 addBilling($encounter, $type, $code, strip_escape_custom($text), $pid, $userauthorized,$_SESSION['authUserID'],$modifier,$units,$fee);
33 <html>
34 <head>
35 <?php html_header_show();?>
36 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
37 </head>
38 <body class="body_bottom">
40 <table border=0 cellspacing=0 cellpadding=0 >
41 <tr>
42 <td valign=top>
44 <dl>
46 <dt>
48 <a href="superbill_custom_full.php" onclick="top.restoreSession()">
49 <span class=title><?php xl('Superbill','e'); ?></span>
50 <font class=more><?php echo $tmore;?></font></a>
52 <a href="encounter_bottom.php" onclick="top.restoreSession()">
54 <font class=more><?php echo $tback;?></font></a>
56 </dt>
57 </td></tr>
58 </table>
60 <table border=0 width=100% cellpadding=0 cellspacing=1>
61 <?php
62 $res = sqlStatement("select * from codes where superbill = 1 order by code_type, code, code_text");
64 $codes = array();
65 echo " <tr>\n";
66 foreach ($code_types as $key => $value) {
67 $codes[$key] = array();
68 echo " <th align='left'>$key Codes</th>\n";
70 echo " </tr>\n";
72 for ($iter = 0; $row = sqlFetchArray($res); $iter++){
73 foreach ($code_types as $key => $value) {
74 if ($value['id'] == $row['code_type']) {
75 $codes[$key][] = $row;
76 break;
81 $index=0;
83 $numlines = 0;
84 foreach ($codes as $value)
85 $numlines = max($numlines, count($value));
87 while ($index < $numlines) {
88 echo " <tr>\n";
89 foreach ($codes as $key => $value) {
90 echo " <td valign='top'>\n";
91 if(!empty($value[$index])) {
92 $code = $value[$index];
93 echo " <dd><a class='text' ";
94 echo "href='superbill_codes.php?back=1&mode=add" .
95 "&type=" . urlencode($key) .
96 "&modifier=" . urlencode($code{"modifier"}) .
97 "&units=" . urlencode($code{"units"}) .
98 "&fee=" . urlencode($code{"fee"}) .
99 "&code=" . urlencode($code{"code"}) .
100 "&text=" . urlencode($code{"code_text"}) .
101 "' onclick='top.restoreSession()'>";
102 echo "<b>" . $code['code'] . "</b>" . "&nbsp;" . $code['modifier'] . "&nbsp;" . $code['code_text'] ;
103 echo "</a></dd>\n";
105 echo " </td>\n";
107 echo " </tr>\n";
108 ++$index;
113 </table>
115 </dl>
117 </body>
118 </html>