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