Proposed fix for the facility data entry bug
[openemr.git] / interface / usergroup / facility_admin.php
blobb15b78f99ecb0353004255b0acd0bb95792b2bda
1 <?php
2 include_once("../globals.php");
3 include_once("$srcdir/md5.js");
4 include_once("$srcdir/sql.inc");
5 require_once("$srcdir/classes/POSRef.class.php");
7 if (isset($_GET["fid"])) {
8 $my_fid = $_GET["fid"];
11 if (isset($_POST["fid"])) {
12 $my_fid = $_POST["fid"];
14 if ($_POST["mode"] == "facility")
17 echo '
18 <script type="text/javascript">
19 <!--
20 parent.$.fn.fancybox.close();
21 //-->
22 </script>
27 <html>
28 <head>
30 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
31 <link rel="stylesheet" type="text/css" href="../../library/js/fancybox/jquery.fancybox-1.2.6.css" media="screen" />
32 <script type="text/javascript" src="../../library/dialog.js"></script>
33 <script type="text/javascript" src="../../library/js/jquery.1.3.2.js"></script>
34 <script type="text/javascript" src="../../library/js/common.js"></script>
35 <script type="text/javascript" src="../../library/js/fancybox/jquery.fancybox-1.2.6.js"></script>
36 <script type="text/javascript">
37 function submitform() {
38 if (document.forms[0].facility.value.length>0) {
39 top.restoreSession();
40 document.forms[0].submit();
41 } else {
42 document.forms[0].facility.style.backgroundColor="red";
43 document.forms[0].facility.focus();
47 $(document).ready(function(){
48 $("#cancel").click(function() {
49 parent.$.fn.fancybox.close();
50 });
51 });
53 </script>
55 </head>
56 <body class="body_top" style="width:600px;height:330px !important;">
58 <table>
59 <tr>
60 <td>
61 <span class="title"><?php xl('Edit Facility','e'); ?></span>&nbsp;&nbsp;&nbsp;</td><td>
62 <a class="css_button large_button" name='form_save' id='form_save' onclick='submitform()' href='#' >
63 <span class='css_button_span large_button_span'><?php xl('Save','e');?></span>
64 </a>
65 <a class="css_button large_button" id='cancel' href='#'>
66 <span class='css_button_span large_button_span'><?php xl('Cancel','e');?></span>
67 </a>
68 </td>
69 </tr>
70 </table>
72 <form name='facility' method='post' action="facilities.php" target="_parent">
73 <input type=hidden name=mode value="facility">
74 <input type=hidden name=newmode value="admin_facility"> <!-- Diffrentiate Admin and add post backs -->
75 <input type=hidden name=fid value="<?php echo $my_fid;?>">
76 <?php $facility = sqlQuery("select * from facility where id='$my_fid'"); ?>
78 <table border=0 cellpadding=0 cellspacing=1 style="width:630px;">
79 <tr>
80 <td width='150px'><span class='text'><?php xl('Name','e'); ?>: </span></td>
81 <td width='220px'><input type='entry' name='facility' size='20' value='<?php echo htmlspecialchars($facility['name'], ENT_QUOTES) ?>'><font class="mandatory">&nbsp;*</font></td>
82 <td width='200px'><span class='text'><?php xl('Phone','e'); ?> <?php xl('as','e'); ?> (000) 000-0000:</span></td>
83 <td width='220px'><input type='entry' name='phone' size='20' value='<?php echo htmlspecialchars($facility['phone'], ENT_QUOTES) ?>'></td>
84 </tr>
85 <tr>
86 <td><span class=text><?php xl('Address','e'); ?>: </span></td><td><input type=entry size=20 name=street value="<?php echo htmlspecialchars($facility["street"], ENT_QUOTES) ?>"></td>
87 <td><span class='text'><?php xl('Fax','e'); ?> <?php xl('as','e'); ?> (000) 000-0000:</span></td>
88 <td><input type='entry' name='fax' size='20' value='<?php echo htmlspecialchars($facility['fax'], ENT_QUOTES) ?>'></td>
89 </tr>
90 <tr>
92 <td><span class=text><?php xl('City','e'); ?>: </span></td>
93 <td><input type=entry size=20 name=city value="<?php echo htmlspecialchars($facility{"city"}, ENT_QUOTES) ?>"></td>
94 <td><span class=text><?php xl('Zip Code','e'); ?>: </span></td><td><input type=entry size=20 name=postal_code value="<?php echo htmlspecialchars($facility{"postal_code"}, ENT_QUOTES) ?>"></td>
95 </tr>
96 <?php
97 $ssn='';
98 $ein='';
99 if($facility['tax_id_type']=='SY'){
100 $ssn='selected';
102 else{
103 $ein='selected';
106 <tr>
107 <td><span class=text><?php xl('State','e'); ?>: </span></td><td><input type=entry size=20 name=state value="<?php echo htmlspecialchars($facility{"state"}, ENT_QUOTES) ?>"></td>
108 <td><span class=text><?php xl('Tax ID','e'); ?>: </span></td><td><select name=tax_id_type><option value="EI" <?php echo $ein;?>><?php xl('EIN','e'); ?></option><option value="SY" <?php echo $ssn;?>><?php xl('SSN','e'); ?></option></select><input type=entry size=11 name=federal_ein value="<?php echo htmlspecialchars($facility{"federal_ein"}, ENT_QUOTES) ?>"></td>
109 </tr>
110 <tr>
111 <td><span class=text><?php xl('Country','e'); ?>: </span></td><td><input type=entry size=20 name=country_code value="<?php echo htmlspecialchars($facility{"country_code"}, ENT_QUOTES) ?>"></td>
112 <td width="21"><span class=text><?php ($GLOBALS['simplified_demographics'] ? xl('Facility Code','e') : xl('Facility NPI','e')); ?>:
113 </span></td><td><input type=entry size=20 name=facility_npi value="<?php echo htmlspecialchars($facility{"facility_npi"}, ENT_QUOTES) ?>"></td>
114 </tr>
115 <tr>
116 <td><span class='text'><?php xl('Billing Location','e'); ?>: </span></td>
117 <td><input type='checkbox' name='billing_location' value='1' <?php if ($facility['billing_location'] == 1) echo 'checked'; ?>></td>
118 <td rowspan='2'><span class='text'><?php xl('Accepts Assignment','e'); ?><br>(<?php xl('only if billing location','e'); ?>): </span></td>
119 <td><input type='checkbox' name='accepts_assignment' value='1' <?php if ($facility['accepts_assignment'] == 1) echo 'checked'; ?>></td>
120 </tr>
121 <tr>
122 <td><span class='text'><?php xl('Service Location','e'); ?>: </span></td>
123 <td><input type='checkbox' name='service_location' value='1' <?php if ($facility['service_location'] == 1) echo 'checked'; ?>></td>
124 <td>&nbsp;</td>
125 </tr>
127 <tr>
128 <td><span class=text><?php xl('POS Code','e'); ?>: </span></td>
129 <td colspan="6">
130 <select name="pos_code">
131 <?php
132 $pc = new POSRef();
134 foreach ($pc->get_pos_ref() as $pos) {
135 echo "<option value=\"" . $pos["code"] . "\" ";
136 if ($facility['pos_code'] == $pos['code']) {
137 echo "selected";
139 echo ">" . $pos['code'] . ": ". $pos['title'];
140 echo "</option>\n";
144 </select>
145 </td>
146 </tr>
147 <tr>
148 <td><span class="text"><?php xl('Billing Attn','e'); ?>:</span></td>
149 <td colspan="4"><input type="text" name="attn" size="45" value="<?php echo htmlspecialchars($facility['attn'], ENT_QUOTES) ?>"></td>
150 </tr>
151 <tr>
152 <td><span class="text"><?php xl('CLIA Number','e'); ?>:</span></td>
153 <td colspan="4"><input type="text" name="domain_identifier" size="45" value="<?php echo htmlspecialchars($facility['domain_identifier'], ENT_QUOTES) ?>"></td>
154 </tr>
155 <tr height="20" valign="bottom">
156 <td colspan=2><span class="text"><font class="mandatory">*</font> <?php echo xl('Required','e');?></span></td>
157 </tr>
159 </table>
160 </form>
162 </body>
163 </html>