set default margins to 5
[openemr.git] / interface / usergroup / facilities.php
blob2ce552932bfa7c3553f730ac8c2f76288657e67b
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 if (isset($_POST["mode"]) && $_POST["mode"] == "facility") {
10 sqlStatement("INSERT INTO facility SET " .
11 "name = '" . trim(formData('facility' )) . "', " .
12 "phone = '" . trim(formData('phone' )) . "', " .
13 "fax = '" . trim(formData('fax' )) . "', " .
14 "street = '" . trim(formData('street' )) . "', " .
15 "city = '" . trim(formData('city' )) . "', " .
16 "state = '" . trim(formData('state' )) . "', " .
17 "postal_code = '" . trim(formData('postal_code' )) . "', " .
18 "country_code = '" . trim(formData('country_code')) . "', " .
19 "federal_ein = '" . trim(formData('federal_ein' )) . "', " .
20 "facility_npi = '" . trim(formData('facility_npi')) . "'");
23 <html>
24 <head>
26 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
28 </head>
29 <body class="body_top">
31 <span class="title"><?php xl('Facility Administration','e'); ?></span>
33 <br><br>
35 <table width=100%>
36 <tr>
38 <td valign=top>
40 <form name='facility' method='post' action="facilities.php"
41 onsubmit='return top.restoreSession()'>
42 <input type=hidden name=mode value="facility">
43 <span class="bold"><?php xl('New Facility Information','e'); ?>: </span>
44 </td><td>
46 <table border=0 cellpadding=0 cellspacing=0>
47 <tr>
48 <td><span class="text"><?php xl('Name','e'); ?>: </span></td><td><input type=entry name=facility size=20 value=""></td>
49 <td><span class="text"><?php xl('Phone','e'); ?>: </span></td><td><input type=entry name=phone size=20 value=""></td>
50 </tr>
51 <tr>
52 <td>&nbsp;</td><td>&nbsp;</td>
53 <td><span class="text"><?php xl('Fax','e'); ?>: </span></td><td><input type=entry name=fax size=20 value=""></td>
54 </tr>
55 <tr>
56 <td><span class="text"><?php xl('Address','e'); ?>: </span></td><td><input type=entry size=20 name=street value=""></td>
57 <td><span class="text"><?php xl('City','e'); ?>: </span></td><td><input type=entry size=20 name=city value=""></td>
58 </tr>
59 <tr>
60 <td><span class="text"><?php xl('State','e'); ?>: </span></td><td><input type=entry size=20 name=state value=""></td>
61 <td><span class="text"><?php xl('Zip Code','e'); ?>: </span></td><td><input type=entry size=20 name=postal_code value=""></td>
62 </tr>
63 <tr>
64 <td height="22"><span class="text"><?php xl('Country','e'); ?>: </span></td>
65 <td><input type=entry size=20 name=country_code value=""></td>
66 <td><span class="text"><?php xl('Federal EIN','e'); ?>: </span></td><td><input type=entry size=20 name=federal_ein value=""></td>
67 </tr>
68 <tr>
69 <td>&nbsp;</td><td>&nbsp;</td>
71 <td><span class="text"><?php ($GLOBALS['simplified_demographics'] ? xl('Facility Code','e') : xl('Facility NPI','e')); ?>:
72 </span></td><td><input type=entry size=20 name=facility_npi value=""></td>
74 </tr>
75 <tr>
76 <td>&nbsp;</td><td>&nbsp;</td>
77 <td>&nbsp;</td><td><input type="submit" value=<?php xl('Add Facility','e'); ?>></td>
78 </tr>
79 </table>
80 </form>
81 <br>
82 </tr>
83 <tr>
84 <td valign=top>
86 <span class="bold"><?php xl('Edit Facilities','e'); ?>: </span>
87 </td><td valign=top>
88 <?php
89 $fres = 0;
90 $fres = sqlStatement("select * from facility order by name");
91 if ($fres) {
92 $result2 = array();
93 for ($iter3 = 0;$frow = sqlFetchArray($fres);$iter3++)
94 $result2[$iter3] = $frow;
95 foreach($result2 as $iter3) {
97 <span class="text"><?php echo $iter3{name};?></span>
98 <a href="facility_admin.php?fid=<?php echo $iter3{id};?>" class="link_submit"
99 onclick="top.restoreSession()">(<?php xl('Edit','e'); ?>)</a><br>
100 <?php
105 </td>
106 </tr>
107 </table>
109 <script language="JavaScript">
110 <?php
111 if ($alertmsg = trim($alertmsg)) {
112 echo "alert('$alertmsg');\n";
115 </script>
117 </body>
118 </html>