Fix of a php short tag in Facility module
[openemr.git] / interface / usergroup / facilities.php
blobc42a61e26b4b531a276616c9bb6b0e8387d1bdf6
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 sqlStatement("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 "service_location = '" . trim(formData('service_location' )) . "', " .
22 "billing_location = '" . trim(formData('billing_location' )) . "', " .
23 "accepts_assignment = '" . trim(formData('accepts_assignment' )) . "', " .
24 "pos_code = '" . trim(formData('pos_code' )) . "', " .
25 "domain_identifier = '" . trim(formData('domain_identifier' )) . "', " .
26 "attn = '" . trim(formData('attn' )) . "', " .
27 "tax_id_type = '" . trim(formData('tax_id_type' )) . "', " .
28 "facility_npi = '" . trim(formData('facility_npi')) . "'");
31 /* Editing existing facility */
32 if ($_POST["mode"] == "facility" && $_POST["newmode"] == "admin_facility")
34 sqlStatement("update facility set
35 name='" . trim(formData('facility')) . "',
36 phone='" . trim(formData('phone')) . "',
37 fax='" . trim(formData('fax')) . "',
38 street='" . trim(formData('street')) . "',
39 city='" . trim(formData('city')) . "',
40 state='" . trim(formData('state')) . "',
41 postal_code='" . trim(formData('postal_code')) . "',
42 country_code='" . trim(formData('country_code')) . "',
43 federal_ein='" . trim(formData('federal_ein')) . "',
44 service_location='" . trim(formData('service_location')) . "',
45 billing_location='" . trim(formData('billing_location')) . "',
46 accepts_assignment='" . trim(formData('accepts_assignment')) . "',
47 pos_code='" . trim(formData('pos_code')) . "',
48 domain_identifier='" . trim(formData('domain_identifier')) . "',
49 facility_npi='" . trim(formData('facility_npi')) . "',
50 attn='" . trim(formData('attn')) . "' ,
51 tax_id_type='" . trim(formData('tax_id_type')) . "'
52 where id='" . trim(formData('fid')) . "'" );
56 <html>
57 <head>
58 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
59 <link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS['webroot'] ?>/library/js/fancybox/jquery.fancybox-1.2.6.css" media="screen" />
60 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js"></script>
61 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery.1.3.2.js"></script>
62 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/common.js"></script>
63 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/fancybox/jquery.fancybox-1.2.6.js"></script>
64 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery-ui.js"></script>
66 <script type="text/javascript">
69 $(document).ready(function(){
71 // fancy box
72 enable_modals();
74 // special size for
75 $(".addfac_modal").fancybox( {
76 'overlayOpacity' : 0.0,
77 'showCloseButton' : true,
78 'frameHeight' : 460,
79 'frameWidth' : 650
80 });
82 // special size for
83 $(".medium_modal").fancybox( {
84 'overlayOpacity' : 0.0,
85 'showCloseButton' : true,
86 'frameHeight' : 460,
87 'frameWidth' : 650
88 });
90 });
92 </script>
93 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
94 </head>
96 <body class="body_top">
98 <div>
99 <div>
100 <table><tr><td>
101 <b><?php xl('Facilities','e'); ?></b>&nbsp;</td><td>
102 <a href="facilities_add.php" class="iframe addfac_modal css_button"><span><?php xl('Add','e');?></span></a>
103 </td></tr>
104 </table>
105 </div>
106 <div class="tabContainer" style="width:550px;">
107 <div>
108 <table cellpadding="1" cellspacing="0" class="showborder">
109 <tr class="showborder_head" height="22">
110 <th style="border-style:1px solid #000" width="140px"><?php xl('Name','e'); ?></th>
111 <th style="border-style:1px solid #000" width="320px"><?php xl('Address','e'); ?></th>
112 <th style="border-style:1px solid #000"><?php xl('Phone','e'); ?></th>
113 </tr>
114 <?php
115 $fres = 0;
116 $fres = sqlStatement("select * from facility order by name");
117 if ($fres) {
118 $result2 = array();
119 for ($iter3 = 0;$frow = sqlFetchArray($fres);$iter3++)
120 $result2[$iter3] = $frow;
121 foreach($result2 as $iter3) {
122 $varstreet=$iter3{street };
123 if ($iter3{street }!="")$varstreet=$iter3{street }.",";
124 if ($iter3{city}!="")$varcity=$iter3{city}.",";
125 if ($iter3{state}!="")$varstate=$iter3{state}.",";
127 <tr height="22">
128 <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>
129 <td valign="top" class="text"><?php echo htmlspecialchars($varstreet.$varcity.$varstate.$iter3{country_code}." ".$iter3{postal_code}); ?>&nbsp;</td>
130 <td><?php echo htmlspecialchars($iter3{phone});?>&nbsp;</td>
131 </tr>
132 <?php
135 if (count($result2)<=0)
137 <tr height="25">
138 <td colspan="3" style="text-align:center;font-weight:bold;"> <?php echo xl( "Currently there are no facilities." ); ?></td>
139 </tr>
140 <?php }
142 </table>
143 </div>
144 </div>
145 </div>
146 <script language="JavaScript">
147 <?php
148 if ($alertmsg = trim($alertmsg)) {
149 echo "alert('$alertmsg');\n";
152 </script>
154 </body>
155 </html>