Reminder Module features added:
[openemr.git] / interface / usergroup / facilities.php
blob540bd40706443fa60ad0b6ef5211b8f81dbab5cb
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 "color = '" . trim(formData('ncolor' )) . "', " .
22 "service_location = '" . trim(formData('service_location' )) . "', " .
23 "billing_location = '" . trim(formData('billing_location' )) . "', " .
24 "accepts_assignment = '" . trim(formData('accepts_assignment' )) . "', " .
25 "pos_code = '" . trim(formData('pos_code' )) . "', " .
26 "domain_identifier = '" . trim(formData('domain_identifier' )) . "', " .
27 "attn = '" . trim(formData('attn' )) . "', " .
28 "tax_id_type = '" . trim(formData('tax_id_type' )) . "', " .
29 "primary_business_entity = '" . trim(formData('primary_business_entity' )) . "', ".
30 "facility_npi = '" . trim(formData('facility_npi')) . "'");
33 /* Editing existing facility */
34 if ($_POST["mode"] == "facility" && $_POST["newmode"] == "admin_facility")
36 sqlStatement("update facility set
37 name='" . trim(formData('facility')) . "',
38 phone='" . trim(formData('phone')) . "',
39 fax='" . trim(formData('fax')) . "',
40 street='" . trim(formData('street')) . "',
41 city='" . trim(formData('city')) . "',
42 state='" . trim(formData('state')) . "',
43 postal_code='" . trim(formData('postal_code')) . "',
44 country_code='" . trim(formData('country_code')) . "',
45 federal_ein='" . trim(formData('federal_ein')) . "',
46 color='" . trim(formData('ncolor')) . "',
47 service_location='" . trim(formData('service_location')) . "',
48 billing_location='" . trim(formData('billing_location')) . "',
49 accepts_assignment='" . trim(formData('accepts_assignment')) . "',
50 pos_code='" . trim(formData('pos_code')) . "',
51 domain_identifier='" . trim(formData('domain_identifier')) . "',
52 facility_npi='" . trim(formData('facility_npi')) . "',
53 attn='" . trim(formData('attn')) . "' ,
54 primary_business_entity='" . trim(formData('primary_business_entity')) . "' ,
55 tax_id_type='" . trim(formData('tax_id_type')) . "'
56 where id='" . trim(formData('fid')) . "'" );
60 <html>
61 <head>
62 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
63 <link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS['webroot'] ?>/library/js/fancybox/jquery.fancybox-1.2.6.css" media="screen" />
64 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js"></script>
65 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery.1.3.2.js"></script>
66 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/common.js"></script>
67 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/fancybox/jquery.fancybox-1.2.6.js"></script>
68 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery-ui.js"></script>
70 <script type="text/javascript">
73 $(document).ready(function(){
75 // fancy box
76 enable_modals();
78 // special size for
79 $(".addfac_modal").fancybox( {
80 'overlayOpacity' : 0.0,
81 'showCloseButton' : true,
82 'frameHeight' : 460,
83 'frameWidth' : 650
84 });
86 // special size for
87 $(".medium_modal").fancybox( {
88 'overlayOpacity' : 0.0,
89 'showCloseButton' : true,
90 'frameHeight' : 460,
91 'frameWidth' : 650
92 });
94 });
96 </script>
97 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
98 </head>
100 <body class="body_top">
102 <div>
103 <div>
104 <table><tr><td>
105 <b><?php xl('Facilities','e'); ?></b>&nbsp;</td><td>
106 <a href="facilities_add.php" class="iframe addfac_modal css_button"><span><?php xl('Add','e');?></span></a>
107 </td></tr>
108 </table>
109 </div>
110 <div class="tabContainer" style="width:550px;">
111 <div>
112 <table cellpadding="1" cellspacing="0" class="showborder">
113 <tr class="showborder_head" height="22">
114 <th style="border-style:1px solid #000" width="140px"><?php xl('Name','e'); ?></th>
115 <th style="border-style:1px solid #000" width="320px"><?php xl('Address','e'); ?></th>
116 <th style="border-style:1px solid #000"><?php xl('Phone','e'); ?></th>
117 </tr>
118 <?php
119 $fres = 0;
120 $fres = sqlStatement("select * from facility order by name");
121 if ($fres) {
122 $result2 = array();
123 for ($iter3 = 0;$frow = sqlFetchArray($fres);$iter3++)
124 $result2[$iter3] = $frow;
125 foreach($result2 as $iter3) {
126 $varstreet="";//these are assigned conditionally below,blank assignment is done so that old values doesn't get propagated to next level.
127 $varcity="";
128 $varstate="";
129 $varstreet=$iter3{street };
130 if ($iter3{street }!="")$varstreet=$iter3{street }.",";
131 if ($iter3{city}!="")$varcity=$iter3{city}.",";
132 if ($iter3{state}!="")$varstate=$iter3{state}.",";
134 <tr height="22">
135 <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>
136 <td valign="top" class="text"><?php echo htmlspecialchars($varstreet.$varcity.$varstate.$iter3{country_code}." ".$iter3{postal_code}); ?>&nbsp;</td>
137 <td><?php echo htmlspecialchars($iter3{phone});?>&nbsp;</td>
138 </tr>
139 <?php
142 if (count($result2)<=0)
144 <tr height="25">
145 <td colspan="3" style="text-align:center;font-weight:bold;"> <?php echo xl( "Currently there are no facilities." ); ?></td>
146 </tr>
147 <?php }
149 </table>
150 </div>
151 </div>
152 </div>
153 <script language="JavaScript">
154 <?php
155 if ($alertmsg = trim($alertmsg)) {
156 echo "alert('$alertmsg');\n";
159 </script>
161 </body>
162 </html>