more organization of autoloaded files (#424)
[openemr.git] / interface / patient_file / encounter / copay.php
blobfdb59308a2aa97f8a5667c7b113594b1d6fe2a9e
1 <?php
2 include_once("../../globals.php");
4 // This may be more appropriate to move to the library
5 // later
6 function getInsuranceCompanies($pid) {
7 $res = sqlStatement("SELECT * FROM insurance_data WHERE pid = '$pid' " .
8 "ORDER BY type ASC, date DESC");
9 $prevtype = '';
10 for($iter = 0; $row = sqlFetchArray($res); $iter++) {
11 if (strcmp($row['type'], $prevtype) == 0) continue;
12 $prevtype = $row['type'];
13 $all[$iter] = $row;
15 return $all;
18 //the number of rows to display before resetting and starting a new column:
19 $N=10
21 <html>
22 <head>
23 <script type="text/javascript">
24 function cleartext(atrib)
26 document.copay_form.code.value=document.copay_form.codeH.value;
27 document.copay_form.codeH.value="";
29 </script>
32 <?php html_header_show();?>
33 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
34 </head>
35 <body class="body_bottom">
37 <table border='0' cellspacing='0' cellpadding='0' height='100%'>
38 <tr>
40 <td valign=top>
42 <dl>
44 <form method='post' name='copay_form' action="diagnosis.php?mode=add&type=COPAY&text=copay"
45 target='Diagnosis' onsubmit='return top.restoreSession()'>
47 <dt><span class=title><?php xl('Copay','e'); ?></span></dt>
49 <br>
50 <input type=hidden name=code>
51 <span class='text'><?php xl('$','e'); ?> </span><input type='entry' name='codeH' value='' size='5' />
53 <input type="SUBMIT" value="<?php xl('Save','e');?>" onclick="cleartext('clear')"><br><br>
56 <div<?php if ($GLOBALS['simplified_copay']) echo " style='display:none;'"; ?>>
57 <input type="RADIO" name="payment_method" value="cash" checked><?php xl('cash','e'); ?>
58 <input type="RADIO" name="payment_method" value="credit card"><?php xl('credit','e'); ?>
59 <input type="RADIO" name="payment_method" value="check"><?php xl('check','e'); ?>
60 <input type="RADIO" name="payment_method" value="other"><?php xl('other','e'); ?><br><br>
61 <input type="RADIO" name="payment_method" value="insurance"><?php xl('insurance','e'); ?>
62 <?php
63 if ($ret=getInsuranceCompanies($pid)) {
64 if (sizeof($ret)>0) {
65 echo "<select name=insurance_company>\n";
66 foreach($ret as $iter) {
67 $plan_name = trim($iter['plan_name']);
68 if ($plan_name != '') {
69 echo "<option value='"
70 .$plan_name
71 ."'>".$plan_name ."\n";
74 echo "</select>\n";
78 <br><br>
79 <input type="RADIO" name="payment_method" value="write off"><?php xl('write off','e'); ?>
81 </div>
83 </form>
85 </dl>
87 </td>
88 </tr>
89 </table>
91 </body>
92 </html>