supporting data peculiar to ippf issue types
[openemr.git] / interface / patient_file / encounter / copay.php
blob2e137d181e6cad3436ebf16da9a860539e1fd06a
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 <?php html_header_show();?>
26 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
27 </head>
28 <body class="body_bottom">
30 <table border='0' cellspacing='0' cellpadding='0' height='100%'>
31 <tr>
33 <td valign=top>
35 <dl>
37 <form method='post' name='copay_form' action="diagnosis.php?mode=add&type=COPAY&text=copay"
38 target='Diagnosis' onsubmit='return top.restoreSession()'>
40 <dt><span class=title><?php xl('Copay','e'); ?></span></dt>
42 <br>
43 <span class='text'>$ </span><input type='entry' name='code' value='' size='5' />
45 <input type="SUBMIT" value="<?php xl('Save','e'); ?>"><br><br>
47 <div<?php if ($GLOBALS['simplified_copay']) echo " style='display:none;'"; ?>>
48 <input type="RADIO" name="payment_method" value="cash" checked><?php xl('cash','e'); ?>
49 <input type="RADIO" name="payment_method" value="credit card"><?php xl('credit','e'); ?>
50 <input type="RADIO" name="payment_method" value="check"><?php xl('check','e'); ?>
51 <input type="RADIO" name="payment_method" value="other"><?php xl('other','e'); ?><br><br>
52 <input type="RADIO" name="payment_method" value="insurance"><?php xl('insurance','e'); ?>
53 <?php
54 if ($ret=getInsuranceCompanies($pid)) {
55 if (sizeof($ret)>0) {
56 echo "<select name=insurance_company>\n";
57 foreach($ret as $iter) {
58 $plan_name = trim($iter['plan_name']);
59 if ($plan_name != '') {
60 echo "<option value='"
61 .$plan_name
62 ."'>".$plan_name ."\n";
65 echo "</select>\n";
69 <br><br>
70 <input type="RADIO" name="payment_method" value="write off"><?php xl('write off','e'); ?>
72 </div>
74 </form>
76 </dl>
78 </td>
79 </tr>
80 </table>
82 </body>
83 </html>