The Third Reminders email bug fix - contributed by arnabnaha
[openemr.git] / interface / patient_file / encounter / copay.php
blobebe9a51772d0ceee45b4fa93f8107033bae184f2
1 <?php
2 include_once("../../globals.php");
3 include_once("$srcdir/sql.inc");
5 // This may be more appropriate to move to the library
6 // later
7 require_once("{$GLOBALS['srcdir']}/sql.inc");
8 function getInsuranceCompanies($pid) {
9 $res = sqlStatement("SELECT * FROM insurance_data WHERE pid = '$pid' " .
10 "ORDER BY type ASC, date DESC");
11 $prevtype = '';
12 for($iter = 0; $row = sqlFetchArray($res); $iter++) {
13 if (strcmp($row['type'], $prevtype) == 0) continue;
14 $prevtype = $row['type'];
15 $all[$iter] = $row;
17 return $all;
20 //the number of rows to display before resetting and starting a new column:
21 $N=10
23 <html>
24 <head>
25 <script type="text/javascript">
26 function cleartext(atrib)
28 document.copay_form.code.value=document.copay_form.codeH.value;
29 document.copay_form.codeH.value="";
31 </script>
34 <?php html_header_show();?>
35 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
36 </head>
37 <body class="body_bottom">
39 <table border='0' cellspacing='0' cellpadding='0' height='100%'>
40 <tr>
42 <td valign=top>
44 <dl>
46 <form method='post' name='copay_form' action="diagnosis.php?mode=add&type=COPAY&text=copay"
47 target='Diagnosis' onsubmit='return top.restoreSession()'>
49 <dt><span class=title><?php xl('Copay','e'); ?></span></dt>
51 <br>
52 <input type=hidden name=code>
53 <span class='text'><?php xl('$','e'); ?> </span><input type='entry' name='codeH' value='' size='5' />
55 <input type="SUBMIT" value="<?php xl('Save','e');?>" onclick="cleartext('clear')"><br><br>
58 <div<?php if ($GLOBALS['simplified_copay']) echo " style='display:none;'"; ?>>
59 <input type="RADIO" name="payment_method" value="cash" checked><?php xl('cash','e'); ?>
60 <input type="RADIO" name="payment_method" value="credit card"><?php xl('credit','e'); ?>
61 <input type="RADIO" name="payment_method" value="check"><?php xl('check','e'); ?>
62 <input type="RADIO" name="payment_method" value="other"><?php xl('other','e'); ?><br><br>
63 <input type="RADIO" name="payment_method" value="insurance"><?php xl('insurance','e'); ?>
64 <?php
65 if ($ret=getInsuranceCompanies($pid)) {
66 if (sizeof($ret)>0) {
67 echo "<select name=insurance_company>\n";
68 foreach($ret as $iter) {
69 $plan_name = trim($iter['plan_name']);
70 if ($plan_name != '') {
71 echo "<option value='"
72 .$plan_name
73 ."'>".$plan_name ."\n";
76 echo "</select>\n";
80 <br><br>
81 <input type="RADIO" name="payment_method" value="write off"><?php xl('write off','e'); ?>
83 </div>
85 </form>
87 </dl>
89 </td>
90 </tr>
91 </table>
93 </body>
94 </html>