Multiple improvements from IPPF related to layouts. (#1081)
[openemr.git] / interface / patient_file / encounter / copay.php
bloba91e041cefae3cf95f17532ad6da920335ba28cd
1 <?php
2 include_once("../../globals.php");
4 // This may be more appropriate to move to the library
5 // later
6 function getInsuranceCompanies($pid)
8 $res = sqlStatement("SELECT * FROM insurance_data WHERE pid = '$pid' " .
9 "ORDER BY type ASC, date DESC");
10 $prevtype = '';
11 for ($iter = 0; $row = sqlFetchArray($res); $iter++) {
12 if (strcmp($row['type'], $prevtype) == 0) {
13 continue;
16 $prevtype = $row['type'];
17 $all[$iter] = $row;
20 return $all;
23 //the number of rows to display before resetting and starting a new column:
24 $N=10
26 <html>
27 <head>
28 <script type="text/javascript">
29 function cleartext(atrib)
31 document.copay_form.code.value=document.copay_form.codeH.value;
32 document.copay_form.codeH.value="";
34 </script>
37 <?php html_header_show();?>
38 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
39 </head>
40 <body class="body_bottom">
42 <table border='0' cellspacing='0' cellpadding='0' height='100%'>
43 <tr>
45 <td valign=top>
47 <dl>
49 <form method='post' name='copay_form' action="diagnosis.php?mode=add&type=COPAY&text=copay"
50 target='Diagnosis' onsubmit='return top.restoreSession()'>
52 <dt><span class=title><?php xl('Copay', 'e'); ?></span></dt>
54 <br>
55 <input type=hidden name=code>
56 <span class='text'><?php xl('$', 'e'); ?> </span><input type='entry' name='codeH' value='' size='5' />
58 <input type="SUBMIT" value="<?php xl('Save', 'e');?>" onclick="cleartext('clear')"><br><br>
61 <div<?php if ($GLOBALS['simplified_copay']) {
62 echo " style='display:none;'";
63 } ?>>
64 <input type="RADIO" name="payment_method" value="cash" checked><?php xl('cash', 'e'); ?>
65 <input type="RADIO" name="payment_method" value="credit card"><?php xl('credit', 'e'); ?>
66 <input type="RADIO" name="payment_method" value="check"><?php xl('check', 'e'); ?>
67 <input type="RADIO" name="payment_method" value="other"><?php xl('other', 'e'); ?><br><br>
68 <input type="RADIO" name="payment_method" value="insurance"><?php xl('insurance', 'e'); ?>
69 <?php
70 if ($ret=getInsuranceCompanies($pid)) {
71 if (sizeof($ret)>0) {
72 echo "<select name=insurance_company>\n";
73 foreach ($ret as $iter) {
74 $plan_name = trim($iter['plan_name']);
75 if ($plan_name != '') {
76 echo "<option value='"
77 .$plan_name
78 ."'>".$plan_name ."\n";
82 echo "</select>\n";
86 <br><br>
87 <input type="RADIO" name="payment_method" value="write off"><?php xl('write off', 'e'); ?>
89 </div>
91 </form>
93 </dl>
95 </td>
96 </tr>
97 </table>
99 </body>
100 </html>