AMC changes for summary of care and CPOE, see note below:
[openemr.git] / interface / usergroup / facilities.php
blob865969759c1fcbf432a82d462e46026c64db6bb6
1 <?php
2 require_once("../globals.php");
3 require_once("../../library/acl.inc");
4 require_once("$srcdir/sql.inc");
5 require_once("$srcdir/formdata.inc.php");
7 $alertmsg = '';
9 /* Inserting New facility */
10 if (isset($_POST["mode"]) && $_POST["mode"] == "facility" && $_POST["newmode"] != "admin_facility") {
11 $insert_id=sqlInsert("INSERT INTO facility SET " .
12 "name = '" . trim(formData('facility' )) . "', " .
13 "phone = '" . trim(formData('phone' )) . "', " .
14 "fax = '" . trim(formData('fax' )) . "', " .
15 "street = '" . trim(formData('street' )) . "', " .
16 "city = '" . trim(formData('city' )) . "', " .
17 "state = '" . trim(formData('state' )) . "', " .
18 "postal_code = '" . trim(formData('postal_code' )) . "', " .
19 "country_code = '" . trim(formData('country_code')) . "', " .
20 "federal_ein = '" . trim(formData('federal_ein' )) . "', " .
21 "website = '" . trim(formData('website' )) . "', " .
22 "email = '" . trim(formData('email' )) . "', " .
23 "color = '" . trim(formData('ncolor' )) . "', " .
24 "service_location = '" . trim(formData('service_location' )) . "', " .
25 "billing_location = '" . trim(formData('billing_location' )) . "', " .
26 "accepts_assignment = '" . trim(formData('accepts_assignment' )) . "', " .
27 "pos_code = '" . trim(formData('pos_code' )) . "', " .
28 "domain_identifier = '" . trim(formData('domain_identifier' )) . "', " .
29 "attn = '" . trim(formData('attn' )) . "', " .
30 "tax_id_type = '" . trim(formData('tax_id_type' )) . "', " .
31 "primary_business_entity = '" . trim(formData('primary_business_entity' )) . "', ".
32 "facility_npi = '" . trim(formData('facility_npi')) . "',".
33 "facility_code = '" . trim(formData('facility_id')) . "'");
36 /* Editing existing facility */
37 if ($_POST["mode"] == "facility" && $_POST["newmode"] == "admin_facility")
39 sqlStatement("update facility set
40 name='" . trim(formData('facility')) . "',
41 phone='" . trim(formData('phone')) . "',
42 fax='" . trim(formData('fax')) . "',
43 street='" . trim(formData('street')) . "',
44 city='" . trim(formData('city')) . "',
45 state='" . trim(formData('state')) . "',
46 postal_code='" . trim(formData('postal_code')) . "',
47 country_code='" . trim(formData('country_code')) . "',
48 federal_ein='" . trim(formData('federal_ein')) . "',
49 website='" . trim(formData('website')) . "',
50 email='" . trim(formData('email')) . "',
51 color='" . trim(formData('ncolor')) . "',
52 service_location='" . trim(formData('service_location')) . "',
53 billing_location='" . trim(formData('billing_location')) . "',
54 accepts_assignment='" . trim(formData('accepts_assignment')) . "',
55 pos_code='" . trim(formData('pos_code')) . "',
56 domain_identifier='" . trim(formData('domain_identifier')) . "',
57 facility_npi='" . trim(formData('facility_npi')) . "',
58 attn='" . trim(formData('attn')) . "' ,
59 primary_business_entity='" . trim(formData('primary_business_entity')) . "' ,
60 tax_id_type='" . trim(formData('tax_id_type')) . "' ,
61 facility_code = '" . trim(formData('facility_id')) . "'
62 where id='" . trim(formData('fid')) . "'" );
66 <html>
67 <head>
68 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
69 <link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS['webroot'] ?>/library/js/fancybox/jquery.fancybox-1.2.6.css" media="screen" />
70 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js"></script>
71 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery.1.3.2.js"></script>
72 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/common.js"></script>
73 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/fancybox/jquery.fancybox-1.2.6.js"></script>
74 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery-ui.js"></script>
76 <script type="text/javascript">
79 $(document).ready(function(){
81 // fancy box
82 enable_modals();
84 // special size for
85 $(".addfac_modal").fancybox( {
86 'overlayOpacity' : 0.0,
87 'showCloseButton' : true,
88 'frameHeight' : 460,
89 'frameWidth' : 650
90 });
92 // special size for
93 $(".medium_modal").fancybox( {
94 'overlayOpacity' : 0.0,
95 'showCloseButton' : true,
96 'frameHeight' : 460,
97 'frameWidth' : 650
98 });
102 </script>
103 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
104 </head>
106 <body class="body_top">
108 <div>
109 <div>
110 <table><tr><td>
111 <b><?php xl('Facilities','e'); ?></b>&nbsp;</td><td>
112 <a href="facilities_add.php" class="iframe addfac_modal css_button"><span><?php xl('Add','e');?></span></a>
113 </td></tr>
114 </table>
115 </div>
116 <div class="tabContainer" style="width:550px;">
117 <div>
118 <table cellpadding="1" cellspacing="0" class="showborder">
119 <tr class="showborder_head" height="22">
120 <th style="border-style:1px solid #000" width="140px"><?php xl('Name','e'); ?></th>
121 <th style="border-style:1px solid #000" width="320px"><?php xl('Address','e'); ?></th>
122 <th style="border-style:1px solid #000"><?php xl('Phone','e'); ?></th>
123 </tr>
124 <?php
125 $fres = 0;
126 $fres = sqlStatement("select * from facility order by name");
127 if ($fres) {
128 $result2 = array();
129 for ($iter3 = 0;$frow = sqlFetchArray($fres);$iter3++)
130 $result2[$iter3] = $frow;
131 foreach($result2 as $iter3) {
132 $varstreet="";//these are assigned conditionally below,blank assignment is done so that old values doesn't get propagated to next level.
133 $varcity="";
134 $varstate="";
135 $varstreet=$iter3{street };
136 if ($iter3{street }!="")$varstreet=$iter3{street }.",";
137 if ($iter3{city}!="")$varcity=$iter3{city}.",";
138 if ($iter3{state}!="")$varstate=$iter3{state}.",";
140 <tr height="22">
141 <td valign="top" class="text"><b><a href="facility_admin.php?fid=<?php echo $iter3{id};?>" class="iframe medium_modal"><span><?php echo htmlspecialchars($iter3{name});?></span></a></b>&nbsp;</td>
142 <td valign="top" class="text"><?php echo htmlspecialchars($varstreet.$varcity.$varstate.$iter3{country_code}." ".$iter3{postal_code}); ?>&nbsp;</td>
143 <td><?php echo htmlspecialchars($iter3{phone});?>&nbsp;</td>
144 </tr>
145 <?php
148 if (count($result2)<=0)
150 <tr height="25">
151 <td colspan="3" style="text-align:center;font-weight:bold;"> <?php echo xl( "Currently there are no facilities." ); ?></td>
152 </tr>
153 <?php }
155 </table>
156 </div>
157 </div>
158 </div>
159 <script language="JavaScript">
160 <?php
161 if ($alertmsg = trim($alertmsg)) {
162 echo "alert('$alertmsg');\n";
165 </script>
167 </body>
168 </html>