4b9d5132776b9e585ece5d0d23bf1fc5631a76b7
3 * Maintenance for the list of procedure providers.
5 * Copyright (C) 2012 Rod Roark <rod@sunsetsystems.com>
7 * LICENSE: This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>.
19 * @author Rod Roark <rod@sunsetsystems.com>
22 $sanitize_all_escapes = true;
23 $fake_register_globals =false;
25 require_once("../globals.php");
26 require_once("$srcdir/acl.inc");
27 require_once("$srcdir/options.inc.php");
28 require_once("$srcdir/formdata.inc.php");
29 require_once("$srcdir/htmlspecialchars.inc.php");
31 // Collect user id if editing entry
32 $ppid = $_REQUEST['ppid'];
36 function invalue($name) {
37 $fld = add_escape_custom(trim($_POST[$name]));
44 <title
><?php
echo $ppid ?
xlt('Edit') : xlt('Add New') ?
> <?php
echo xlt('Procedure Provider'); ?
></title
>
45 <link rel
="stylesheet" href
='<?php echo $css_header ?>' type
='text/css'>
46 <script type
="text/javascript" src
="../../library/js/jquery.1.3.2.js"></script
>
49 td
{ font
-size
:10pt
; }
57 font
-family
:sans
-serif
;
63 <script language
="JavaScript">
68 <body
class="body_top">
70 // If we are saving, then save and close the window.
72 if ($_POST['form_save']) {
74 "name = " . invalue('form_name') . ", " .
75 "npi = " . invalue('form_npi') . ", " .
76 "send_app_id = " . invalue('form_send_app_id') . ", " .
77 "send_fac_id = " . invalue('form_send_fac_id') . ", " .
78 "recv_app_id = " . invalue('form_recv_app_id') . ", " .
79 "recv_fac_id = " . invalue('form_recv_fac_id') . ", " .
80 "DorP = " . invalue('form_DorP') . ", " .
81 "protocol = " . invalue('form_protocol') . ", " .
82 "remote_host = " . invalue('form_remote_host') . ", " .
83 "login = " . invalue('form_login') . ", " .
84 "password = " . invalue('form_password') . ", " .
85 "orders_path = " . invalue('form_orders_path') . ", " .
86 "results_path = " . invalue('form_results_path') . ", " .
87 "notes = " . invalue('form_notes');
89 $query = "UPDATE procedure_providers SET $sets " .
90 "WHERE ppid = '" . add_escape_custom($ppid) . "'";
94 $ppid = sqlInsert("INSERT INTO procedure_providers SET $sets");
97 else if ($_POST['form_delete']) {
99 sqlStatement("DELETE FROM procedure_providers WHERE ppid = ?", array($ppid));
103 if ($_POST['form_save'] ||
$_POST['form_delete']) {
104 // Close this window and redisplay the updated list.
105 echo "<script language='JavaScript'>\n";
106 if ($info_msg) echo " alert('" . addslashes($info_msg) . "');\n";
107 echo " window.close();\n";
108 echo " if (opener.refreshme) opener.refreshme();\n";
109 echo "</script></body></html>\n";
114 $row = sqlQuery("SELECT * FROM procedure_providers WHERE ppid = ?", array($ppid));
118 <form method
='post' name
='theform' action
='procedure_provider_edit.php?ppid=<?php echo attr($ppid) ?>'>
121 <table border
='0' width
='100%'>
124 <td nowrap
><b
><?php
echo xlt('Name'); ?
>:</b
></td
>
126 <input type
='text' size
='40' name
='form_name' maxlength
='255'
127 value
='<?php echo attr($row['name
']); ?>'
128 style
='width:100%' class='inputtext' />
133 <td nowrap
><b
><?php
echo xlt('NPI'); ?
>:</b
></td
>
135 <input type
='text' size
='10' name
='form_npi' maxlength
='10'
136 value
='<?php echo attr($row['npi
']); ?>' class='inputtext' />
141 <td nowrap
><b
><?php
echo xlt('Sender IDs'); ?
>:</b
></td
>
143 <?php
echo xlt('Application'); ?
>:
144 <input type
='text' size
='10' name
='form_send_app_id' maxlength
='100'
145 value
='<?php echo attr($row['send_app_id
']); ?>'
146 title
='<?php echo xla('MSH
-3.1'); ?>'
148  
;<?php
echo xlt('Facility'); ?
>:
149 <input type
='text' size
='10' name
='form_send_fac_id' maxlength
='100'
150 value
='<?php echo attr($row['send_fac_id
']); ?>'
151 title
='<?php echo xla('MSH
-4.1'); ?>'
157 <td nowrap
><b
><?php
echo xlt('Receiver IDs'); ?
>:</b
></td
>
159 <?php
echo xlt('Application'); ?
>:
160 <input type
='text' size
='10' name
='form_recv_app_id' maxlength
='100'
161 value
='<?php echo attr($row['recv_app_id
']); ?>'
162 title
='<?php echo xla('MSH
-5.1'); ?>'
164  
;<?php
echo xlt('Facility'); ?
>:
165 <input type
='text' size
='10' name
='form_recv_fac_id' maxlength
='100'
166 value
='<?php echo attr($row['recv_fac_id
']); ?>'
167 title
='<?php echo xla('MSH
-6.1'); ?>'
173 <td nowrap
><b
><?php
echo xlt('Usage'); ?
>:</b
></td
>
175 <select name
='form_DorP' title
='<?php echo xla('MSH
-11'); ?>'>
182 echo " <option value='" . attr($key) . "'";
183 if ($key == $row['DorP']) echo " selected";
184 echo ">" . xlt($value) . "</option>\n";
192 <td nowrap
><b
><?php
echo xlt('Protocol'); ?
>:</b
></td
>
194 <select name
='form_protocol'>
197 // Add to this list as more protocols are supported.
202 echo " <option value='" . attr($key) . "'";
203 if ($key == $row['protocol']) echo " selected";
204 echo ">" . xlt($value) . "</option>\n";
212 <td nowrap
><b
><?php
echo xlt('Remote Host'); ?
>:</b
></td
>
214 <input type
='text' size
='40' name
='form_remote_host' maxlength
='255'
215 value
='<?php echo attr($row['remote_host
']); ?>' class='inputtext' />
220 <td nowrap
><b
><?php
echo xlt('Login'); ?
>:</b
></td
>
222 <input type
='text' size
='20' name
='form_login' maxlength
='255'
223 value
='<?php echo attr($row['login
']); ?>' class='inputtext' />
228 <td nowrap
><b
><?php
echo xlt('Password'); ?
>:</b
></td
>
230 <input type
='text' size
='20' name
='form_password' maxlength
='255'
231 value
='<?php echo attr($row['password
']); ?>' class='inputtext' />
236 <td nowrap
><b
><?php
echo xlt('Orders Path'); ?
>:</b
></td
>
238 <input type
='text' size
='40' name
='form_orders_path' maxlength
='255'
239 value
='<?php echo attr($row['orders_path
']); ?>' class='inputtext' />
244 <td nowrap
><b
><?php
echo xlt('Results Path'); ?
>:</b
></td
>
246 <input type
='text' size
='40' name
='form_results_path' maxlength
='255'
247 value
='<?php echo attr($row['results_path
']); ?>' class='inputtext' />
252 <td nowrap
><b
><?php
echo xlt('Notes'); ?
>:</b
></td
>
254 <textarea rows
='3' cols
='40' name
='form_notes' style
='width:100%'
255 wrap
='virtual' class='inputtext' /><?php
echo text($row['notes']) ?
></textarea
>
263 <input type
='submit' name
='form_save' value
='<?php echo xla('Save
'); ?>' />
265 <?php
if ($ppid) { ?
>
267 <input type
='submit' name
='form_delete' value
='<?php echo xla('Delete
'); ?>' style
='color:red' />
271 <input type
='button' value
='<?php echo xla('Cancel
'); ?>' onclick
='window.close()' />