translation patches from Dr. Bosman and his crew
[openemr.git] / interface / main / calendar / find_patient_popup.php
blob9222141a843d0a02bed461ff770f50fe47f97ce4
1 <?
2 // Copyright (C) 2005 Rod Roark <rod@sunsetsystems.com>
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 include_once("../../globals.php");
10 include_once("$srcdir/patient.inc");
12 $info_msg = "";
14 // If we are searching, search.
16 if ($_REQUEST['searchby'] && $_REQUEST['searchparm']) {
17 $searchby = $_REQUEST['searchby'];
18 $searchparm = $_REQUEST['searchparm'];
20 if ($searchby == "Last") {
21 $result = getPatientLnames("$searchparm","*");
22 } elseif ($searchby == "ID") {
23 $result = getPatientId("$searchparm","*");
24 } elseif ($searchby == "DOB") {
25 $result = getPatientDOB("$searchparm","*");
26 } elseif ($searchby == "SSN") {
27 $result = getPatientSSN("$searchparm","*");
31 <html>
32 <head>
33 <title><?php xl('Patient Finder','e'); ?></title>
34 <link rel=stylesheet href='<? echo $css_header ?>' type='text/css'>
36 <style>
37 td { font-size:10pt; }
38 </style>
40 <script language="JavaScript">
42 function selpid(pid, lname, fname, dob) {
43 if (opener.closed || ! opener.setpatient)
44 alert('The destination form was closed; I cannot act on your selection.');
45 else
46 opener.setpatient(pid, lname, fname, dob);
47 window.close();
48 return false;
51 </script>
53 </head>
55 <body <?echo $top_bg_line;?>>
58 <form method='post' name='theform' action='find_patient_popup.php?'>
59 <center>
61 <table border='0' cellpadding='5' cellspacing='0'>
63 <tr>
64 <td height="1">
65 </td>
66 </tr>
68 <tr bgcolor='#ddddff'>
69 <td>
70 <b>
71 <?php xl('Search by:','e'); ?>
72 <select name='searchby'>
73 <option value="Last"><? xl ('Name','e'); ?></option>
74 <option value="ID"<? if ($searchby == 'ID') echo ' selected' ?>><? xl ('ID','e'); ?></option>
75 <option value="SSN"<? if ($searchby == 'SSN') echo ' selected' ?>><? xl ('SSN','e'); ?></option>
76 <option value="DOB"<? if ($searchby == 'DOB') echo ' selected' ?>><? xl ('DOB','e'); ?></option>
77 </select>
78 <?php xl('for:','e'); ?>
79 <input type='text' name='searchparm' size='12' value='<? echo $_REQUEST['searchparm']; ?>'
80 title='<?php xl('If name, any part of lastname or lastname,firstname','e'); ?>'>
81 &nbsp;
82 <input type='submit' value='<?php xl('Search','e'); ?>'>
83 <!-- &nbsp; <input type='button' value='<?php xl('Close','e'); ?>' onclick='window.close()' /> -->
84 </b>
85 </td>
86 </tr>
88 <tr>
89 <td height="1">
90 </td>
91 </tr>
93 </table>
95 <? if (isset($result)) { ?>
97 <table border='0'>
98 <tr>
99 <td><b><? xl ('Name','e'); ?></b></td>
100 <td><b><? xl ('SS','e'); ?></b></td>
101 <td><b><? xl ('DOB','e'); ?></b></td>
102 <td><b><? xl ('ID','e'); ?></b></td>
103 </tr>
105 foreach ($result as $iter) {
106 $iterpid = $iter['pid'];
107 $iterlname = addslashes($iter['lname']);
108 $iterfname = addslashes($iter['fname']);
109 $iterdob = $iter['DOB'];
110 $anchor = "<a href='' " .
111 "onclick='return selpid($iterpid, \"$iterlname\", \"$iterfname\", \"$iterdob\")'>";
112 echo " <tr>";
113 echo " <td>$anchor$iterlname, $iterfname</a></td>\n";
114 echo " <td>$anchor" . $iter['ss'] . "</a></td>\n";
115 echo " <td>$anchor" . $iter['DOB'] . "</a></td>\n";
116 echo " <td>$anchor" . $iter['pubpid'] . "</a></td>\n";
117 if ($iter['genericname2'] == 'Billing') {
118 echo " <td><b><font color='red'>" . $iter['genericval2'] . "</font></b></td>\n";
119 } else {
120 echo "<td>&nbsp;</td>\n";
122 echo " </tr>";
125 </table>
127 <? } ?>
129 </center>
130 </form>
131 </body>
132 </html>