feat: Fixes #6772 adds twig email templates to emails (#6773)
[openemr.git] / interface / usergroup / addrbook_edit.php
blobe35f07c95ea72b7a88cb147248f2c48f8a5af8b2
1 <?php
3 /**
4 * addrbook_edit.php
6 * @package OpenEMR
7 * @link http://www.open-emr.org
8 * @author Rod Roark <rod@sunsetsystems.com>
9 * @author Brady Miller <brady.g.miller@gmail.com>
10 * @copyright Copyright (c) 2006-2010 Rod Roark <rod@sunsetsystems.com>
11 * @copyright Copyright (c) 2018-2019 Brady Miller <brady.g.miller@gmail.com>
12 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
15 require_once("../globals.php");
16 require_once("$srcdir/options.inc.php");
18 use OpenEMR\Common\Acl\AclMain;
19 use OpenEMR\Common\Csrf\CsrfUtils;
20 use OpenEMR\Common\Twig\TwigContainer;
21 use OpenEMR\Core\Header;
23 if (!AclMain::aclCheckCore('admin', 'practice')) {
24 echo (new TwigContainer(null, $GLOBALS['kernel']))->getTwig()->render('core/unauthorized.html.twig', ['pageTitle' => xl("Address Book")]);
25 exit;
28 if (!empty($_POST)) {
29 if (!CsrfUtils::verifyCsrfToken($_POST["csrf_token_form"])) {
30 CsrfUtils::csrfNotVerified();
34 // Collect user id if editing entry
35 $userid = $_REQUEST['userid'] ?? '';
37 // Collect type if creating a new entry
38 $type = $_REQUEST['type'] ?? '';
40 $info_msg = "";
42 function invalue($name)
44 if (empty($_POST[$name])) {
45 return "''";
48 $fld = add_escape_custom(trim($_POST[$name]));
49 return "'$fld'";
53 <html>
54 <head>
55 <title><?php echo $userid ? xlt('Edit Entry') : xlt('Add New Entry') ?></title>
57 <?php Header::setupHeader('opener'); ?>
59 <style>
60 .inputtext {
61 padding-left: 2px;
62 padding-right: 2px;
64 </style>
66 <script>
68 var type_options_js = Array();
69 <?php
70 // Collect the type options. Possible values are:
71 // 1 = Unassigned (default to person centric)
72 // 2 = Person Centric
73 // 3 = Company Centric
74 $sql = sqlStatement("SELECT option_id, option_value FROM list_options WHERE " .
75 "list_id = 'abook_type' AND activity = 1");
76 while ($row_query = sqlFetchArray($sql)) {
77 echo "type_options_js[" . js_escape($row_query['option_id']) . "]=" . js_escape($row_query['option_value']) . ";\n";
81 // Process to customize the form by type
82 function typeSelect(a) {
83 if(a=='ord_lab'){
84 $('#cpoe_span').css('display','inline');
85 } else {
86 $('#cpoe_span').css('display','none');
87 $('#form_cpoe').prop('checked', false);
89 if (type_options_js[a] == 3) {
90 // Company centric:
91 // 1) Hide the person Name entries
92 // 2) Hide the Specialty entry
93 // 3) Show the director Name entries
94 $(".nameRow").hide();
95 $(".specialtyRow").hide();
96 $(".nameDirectorRow").show();
98 else {
99 // Person centric:
100 // 1) Hide the director Name entries
101 // 2) Show the person Name entries
102 // 3) Show the Specialty entry
103 $(".nameDirectorRow").hide();
104 $(".nameRow").show();
105 $(".specialtyRow").show();
108 </script>
110 </head>
112 <body class="body_top">
113 <?php
114 // If we are saving, then save and close the window.
116 if (!empty($_POST['form_save'])) {
117 // Collect the form_abook_type option value
118 // (ie. patient vs company centric)
119 $type_sql_row = sqlQuery("SELECT `option_value` FROM `list_options` WHERE `list_id` = 'abook_type' AND `option_id` = ? AND activity = 1", array(trim($_POST['form_abook_type'])));
120 $option_abook_type = $type_sql_row['option_value'] ?? '';
121 // Set up any abook_type specific settings
122 if ($option_abook_type == 3) {
123 // Company centric
124 $form_title = invalue('form_director_title');
125 $form_fname = invalue('form_director_fname');
126 $form_lname = invalue('form_director_lname');
127 $form_mname = invalue('form_director_mname');
128 $form_suffix = invalue('form_director_suffix');
129 } else {
130 // Person centric
131 $form_title = invalue('form_title');
132 $form_fname = invalue('form_fname');
133 $form_lname = invalue('form_lname');
134 $form_mname = invalue('form_mname');
135 $form_suffix = invalue('form_suffix');
138 if ($userid) {
139 $query = "UPDATE users SET " .
140 "abook_type = " . invalue('form_abook_type') . ", " .
141 "title = " . $form_title . ", " .
142 "fname = " . $form_fname . ", " .
143 "lname = " . $form_lname . ", " .
144 "mname = " . $form_mname . ", " .
145 "suffix = " . $form_suffix . ", " .
146 "specialty = " . invalue('form_specialty') . ", " .
147 "organization = " . invalue('form_organization') . ", " .
148 "valedictory = " . invalue('form_valedictory') . ", " .
149 "assistant = " . invalue('form_assistant') . ", " .
150 "federaltaxid = " . invalue('form_federaltaxid') . ", " .
151 "upin = " . invalue('form_upin') . ", " .
152 "npi = " . invalue('form_npi') . ", " .
153 "taxonomy = " . invalue('form_taxonomy') . ", " .
154 "cpoe = " . invalue('form_cpoe') . ", " .
155 "email = " . invalue('form_email') . ", " .
156 "email_direct = " . invalue('form_email_direct') . ", " .
157 "url = " . invalue('form_url') . ", " .
158 "street = " . invalue('form_street') . ", " .
159 "streetb = " . invalue('form_streetb') . ", " .
160 "city = " . invalue('form_city') . ", " .
161 "state = " . invalue('form_state') . ", " .
162 "zip = " . invalue('form_zip') . ", " .
163 "street2 = " . invalue('form_street2') . ", " .
164 "streetb2 = " . invalue('form_streetb2') . ", " .
165 "city2 = " . invalue('form_city2') . ", " .
166 "state2 = " . invalue('form_state2') . ", " .
167 "zip2 = " . invalue('form_zip2') . ", " .
168 "phone = " . invalue('form_phone') . ", " .
169 "phonew1 = " . invalue('form_phonew1') . ", " .
170 "phonew2 = " . invalue('form_phonew2') . ", " .
171 "phonecell = " . invalue('form_phonecell') . ", " .
172 "fax = " . invalue('form_fax') . ", " .
173 "notes = " . invalue('form_notes') . " " .
174 "WHERE id = '" . add_escape_custom($userid) . "'";
175 sqlStatement($query);
176 } else {
177 $userid = sqlInsert("INSERT INTO users ( " .
178 "username, password, authorized, info, source, " .
179 "title, fname, lname, mname, suffix, " .
180 "federaltaxid, federaldrugid, upin, facility, see_auth, active, npi, taxonomy, cpoe, " .
181 "specialty, organization, valedictory, assistant, billname, email, email_direct, url, " .
182 "street, streetb, city, state, zip, " .
183 "street2, streetb2, city2, state2, zip2, " .
184 "phone, phonew1, phonew2, phonecell, fax, notes, abook_type " .
185 ") VALUES ( " .
186 "'', " . // username
187 "'', " . // password
188 "0, " . // authorized
189 "'', " . // info
190 "NULL, " . // source
191 $form_title . ", " .
192 $form_fname . ", " .
193 $form_lname . ", " .
194 $form_mname . ", " .
195 $form_suffix . ", " .
196 invalue('form_federaltaxid') . ", " .
197 "'', " . // federaldrugid
198 invalue('form_upin') . ", " .
199 "'', " . // facility
200 "0, " . // see_auth
201 "1, " . // active
202 invalue('form_npi') . ", " .
203 invalue('form_taxonomy') . ", " .
204 invalue('form_cpoe') . ", " .
205 invalue('form_specialty') . ", " .
206 invalue('form_organization') . ", " .
207 invalue('form_valedictory') . ", " .
208 invalue('form_assistant') . ", " .
209 "'', " . // billname
210 invalue('form_email') . ", " .
211 invalue('form_email_direct') . ", " .
212 invalue('form_url') . ", " .
213 invalue('form_street') . ", " .
214 invalue('form_streetb') . ", " .
215 invalue('form_city') . ", " .
216 invalue('form_state') . ", " .
217 invalue('form_zip') . ", " .
218 invalue('form_street2') . ", " .
219 invalue('form_streetb2') . ", " .
220 invalue('form_city2') . ", " .
221 invalue('form_state2') . ", " .
222 invalue('form_zip2') . ", " .
223 invalue('form_phone') . ", " .
224 invalue('form_phonew1') . ", " .
225 invalue('form_phonew2') . ", " .
226 invalue('form_phonecell') . ", " .
227 invalue('form_fax') . ", " .
228 invalue('form_notes') . ", " .
229 invalue('form_abook_type') . " " .
230 ")");
232 } elseif (!empty($_POST['form_delete'])) {
233 if ($userid) {
234 // Be careful not to delete internal users.
235 sqlStatement("DELETE FROM users WHERE id = ? AND username = ''", array($userid));
239 if (!empty($_POST['form_save']) || !empty($_POST['form_delete'])) {
240 // Close this window and redisplay the updated list.
241 echo "<script>\n";
242 if ($info_msg) {
243 echo " alert(" . js_escape($info_msg) . ");\n";
246 echo " window.close();\n";
247 echo " if (opener.refreshme) opener.refreshme();\n";
248 echo "</script></body></html>\n";
249 exit();
252 if ($userid) {
253 $row = sqlQuery("SELECT * FROM users WHERE id = ?", array($userid));
256 if ($type) { // note this only happens when its new
257 // Set up type
258 $row['abook_type'] = $type;
263 <script>
264 $(function () {
265 // customize the form via the type options
266 typeSelect(<?php echo js_escape($row['abook_type'] ?? null); ?>);
267 if(typeof abook_type != 'undefined' && abook_type == 'ord_lab') {
268 $('#cpoe_span').css('display','inline');
271 </script>
273 <form method='post' name='theform' id="theform" action='addrbook_edit.php?userid=<?php echo attr_url($userid) ?>'>
274 <input type="hidden" name="csrf_token_form" value="<?php echo attr(CsrfUtils::collectCsrfToken()); ?>" />
275 <?php if (AclMain::aclCheckCore('admin', 'practice')) { // allow choose type option if have admin access ?>
276 <div class="form-row">
277 <div class='col-2'>
278 <label class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Type'); ?>:</label>
279 </div>
280 <div class="col">
281 <?php echo generate_select_list('form_abook_type', 'abook_type', ($row['abook_type'] ?? null), '', 'Unassigned', 'form-control-sm', 'typeSelect(this.value)'); ?>
282 </div>
283 </div>
284 <?php } // end of if has admin access ?>
286 <div class="form-row nameRow my-1">
287 <div class="col-auto">
288 <label for="title" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Name'); ?>:</label>
289 </div>
290 <div class="col-auto">
291 <?php generate_form_field(array('data_type' => 1,'field_id' => 'title','smallform' => 'true','list_id' => 'titles','empty_title' => ' '), ($row['title'] ?? '')); ?>
292 </div>
293 <div class="col-auto">
294 <label for="form_lname" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Last{{Name}}'); ?>:</label>
295 </div>
296 <div class="col-auto">
297 <input type='text' size='10' name='form_lname' class='form-control form-control-sm inputtext' maxlength='50' value='<?php echo attr($row['lname'] ?? ''); ?>'/>
298 </div>
299 <div class="col-auto">
300 <label for="form_fname" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('First{{Name}}'); ?>:</label>
301 </div>
302 <div class="col-auto">
303 <input type='text' size='10' name='form_fname' class='form-control form-control-sm inputtext' maxlength='50' value='<?php echo attr($row['fname'] ?? ''); ?>' />
304 </div>
305 <div class="col-auto">
306 <label for="form_mname" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Middle{{Name}}'); ?>:</label>
307 </div>
308 <div class="col-auto">
309 <input type='text' size='4' name='form_mname' class='form-control form-control-sm inputtext' maxlength='50' value='<?php echo attr($row['mname'] ?? ''); ?>' />
310 </div>
311 <div class="col-auto">
312 <label for="form_suffix" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Suffix'); ?>:</label>
313 </div>
314 <div class="col-auto">
315 <input type='text' size='4' name='form_suffix' class='form-control form-control-sm inputtext' maxlength='50' value='<?php echo attr($row['suffix'] ?? ''); ?>' />
316 </div>
317 </div>
319 <div class="form-row specialtyRow my-1">
320 <div class="col-2">
321 <label for="form_specialty" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Specialty'); ?>:</label>
322 </div>
323 <div class="col">
324 <input type='text' size='40' name='form_specialty' maxlength='250' value='<?php echo attr($row['specialty'] ?? ''); ?>' class='form-control form-control-sm inputtext w-100' />
325 </div>
326 </div>
328 <div class="form-row my-1">
329 <div class="col-2">
330 <label for="form_organization" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Organization'); ?>:</label>
331 </div>
332 <div class="col">
333 <input type='text' size='40' name='form_organization' maxlength='250' value='<?php echo attr($row['organization'] ?? ''); ?>' class='form-control form-control-sm inputtext' />
334 <span id='cpoe_span' style="display:none;">
335 <input type='checkbox' title="<?php echo xla('CPOE'); ?>" name='form_cpoe' id='form_cpoe' value='1' <?php echo (!empty($row['cpoe']) && ($row['cpoe'] == '1')) ? "CHECKED" : ""; ?>/>
336 <label for='form_cpoe' class="font-weight-bold"><?php echo xlt('CPOE'); ?></label>
337 </span>
338 </div>
339 </div>
340 <div class="nameDirectorRow">
341 <label for="director_title" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Director Name'); ?>:</label>
342 <div class="form-row my-1">
343 <div class="col-auto">
344 <?php
345 generate_form_field(array('data_type' => 1,'field_id' => 'director_title','smallform' => 'true','list_id' => 'titles','empty_title' => ' '), ($row['title'] ?? ''));
347 </div>
348 <div class="col-auto">
349 <label for="form_director_lname" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Last{{Name}}'); ?>:</label>
350 </div>
351 <div class="col-auto">
352 <input type='text' size='10' name='form_director_lname' class='form-control form-control-sm inputtext' maxlength='50' value='<?php echo attr($row['lname'] ?? ''); ?>'/>
353 </div>
354 <div class="col-auto">
355 <label for="form_director_fname" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('First{{Name}}'); ?>:</label>
356 </div>
357 <div class="col-auto">
358 <input type='text' size='10' name='form_director_fname' class='form-control form-control-sm inputtext' maxlength='50' value='<?php echo attr($row['fname'] ?? ''); ?>' />
359 </div>
360 <div class="col-auto">
361 <label for="form_director_mname" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Middle{{Name}}'); ?>:</label>
362 </div>
363 <div class="col-auto">
364 <input type='text' size='4' name='form_director_mname' class='form-control form-control-sm inputtext' maxlength='50' value='<?php echo attr($row['mname'] ?? ''); ?>' />
365 </div>
366 <div class="col-auto">
367 <label for="form_director_suffix" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Suffix'); ?>:</label>
368 </div>
369 <div class="col-auto">
370 <input type='text' size='4' name='form_director_suffix' class='form-control form-control-sm inputtext' maxlength='50' value='<?php echo attr($row['suffix'] ?? ''); ?>' />
371 </div>
372 </div>
373 </div>
375 <div class="form-row my-1">
376 <div class="col-2">
377 <label for="form_valedictory" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Valedictory'); ?>:</label>
378 </div>
379 <div class="col">
380 <input type='text' size='40' name='form_valedictory' maxlength='250' value='<?php echo attr($row['valedictory'] ?? ''); ?>' class='form-control form-control-sm inputtext' />
381 </div>
382 </div>
384 <div class="form-row my-1">
385 <div class="col-2">
386 <label for="form_phone" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Home Phone'); ?>:</label>
387 </div>
388 <div class="col">
389 <input type='text' size='11' name='form_phone' value='<?php echo attr($row['phone'] ?? ''); ?>' maxlength='30' class='form-control form-control-sm inputtext' />
390 </div>
391 <div class="col-2">
392 <label for="form_phonecell" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Mobile'); ?>:</label>
393 </div>
394 <div class="col">
395 <input type='text' size='11' name='form_phonecell' maxlength='30' value='<?php echo attr($row['phonecell'] ?? ''); ?>' class='form-control form-control-sm inputtext' />
396 </div>
397 </div>
398 <div class="form-row my-1">
399 <div class="col-2">
400 <label for="form_phonew1" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Work Phone'); ?>:</label>
401 </div>
402 <div class="col">
403 <input type='text' size='11' name='form_phonew1' value='<?php echo attr($row['phonew1'] ?? ''); ?>' maxlength='30' class='form-control form-control-sm inputtext' />
404 </div>
405 <div class="col-1">
406 <label class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('2nd'); ?>:</label>
407 </div>
408 <div class="col">
409 <input type='text' size='11' name='form_phonew2' value='<?php echo attr($row['phonew2'] ?? ''); ?>' maxlength='30' class='form-control form-control-sm inputtext' />
410 </div>
411 <div class="col-1">
412 <label class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Fax'); ?>:</label>
413 </div>
414 <div class="col">
415 <input type='text' size='11' name='form_fax' value='<?php echo attr($row['fax'] ?? ''); ?>' maxlength='30' class='form-control form-control-sm inputtext' />
416 </div>
417 </div>
419 <div class="form-row my-1">
420 <div class="col-2">
421 <label for="form_assistant" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Assistant'); ?>:</label>
422 </div>
423 <div class="col-10">
424 <input type='text' size='40' name='form_assistant' maxlength='250' value='<?php echo attr($row['assistant'] ?? ''); ?>' class='form-control form-control-sm inputtext w-100' />
425 </div>
426 </div>
428 <div class="form-row my-1">
429 <div class="col-2">
430 <label for="form_email" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Email'); ?>:</label>
431 </div>
432 <div class='col-10'>
433 <input type='text' size='40' name='form_email' maxlength='250' value='<?php echo attr($row['email'] ?? ''); ?>' class='form-control form-control-sm inputtext w-100' />
434 </div>
435 </div>
437 <div class="form-row my-1">
438 <div class="col-2">
439 <label for="form_email_direct" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Trusted Email'); ?>:</label>
440 </div>
441 <div class="col-10">
442 <input type='text' size='40' name='form_email_direct' maxlength='250' value='<?php echo attr($row['email_direct'] ?? ''); ?>' class='form-control form-control-sm inputtext' />
443 </div>
444 </div>
446 <div class="form-row my-1">
447 <div class="col-2">
448 <label for="form_url" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Website'); ?>:</label>
449 </div>
450 <div class="col-10">
451 <input type='text' size='40' name='form_url' maxlength='250' value='<?php echo attr($row['url'] ?? ''); ?>' class='form-control form-control-sm inputtext' />
452 </div>
453 </div>
455 <div class="form-row my-1 align-items-center">
456 <div class="col-2">
457 <label for="form_street form_streetb" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Main Address'); ?>:</label>
458 </div>
459 <div class="col-10">
460 <input type='text' size='40' name='form_street' maxlength='60' value='<?php echo attr($row['street'] ?? ''); ?>' class='form-control form-control-sm inputtext mb-1' placeholder="<?php echo xla('Address Line 1'); ?>" />
461 <input type='text' size='40' name='form_streetb' maxlength='60' value='<?php echo attr($row['streetb'] ?? ''); ?>' class='form-control form-control-sm inputtext mt-1' placeholder="<?php echo xla('Address Line 2'); ?>" />
462 </div>
463 </div>
465 <div class="form-row my-1">
466 <div class="col-2">
467 <label for="form_city" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('City'); ?>:</label>
468 </div>
469 <div class="col">
470 <input type='text' size='10' name='form_city' maxlength='30' value='<?php echo attr($row['city'] ?? ''); ?>' class='form-control form-control-sm inputtext' placeholder="<?php echo xla('City'); ?>" />
471 </div>
472 <div class="col-2">
473 <label for="form_state" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('State') . "/" . xlt('county'); ?>:</label>
474 </div>
475 <div class="col">
476 <?php echo generate_select_list('form_state', 'state', ($row['state'] ?? null), '', 'Unassigned', 'form-control-sm', 'typeSelect(this.value)'); ?>
477 </div>
478 <div class="col-2">
479 <label for="form_zip" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Postal code'); ?>:</label>
480 </div>
481 <div class="col">
482 <input type='text' size='10' name='form_zip' maxlength='20' value='<?php echo attr($row['zip'] ?? ''); ?>' class='form-control form-control-sm inputtext' placeholder="<?php echo xla('Postal code'); ?>" />
483 </div>
484 </div>
486 <div class="form-row my-1 align-items-center">
487 <div class="col-2">
488 <label for="form_street2 form_streetb2" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Alt Address'); ?>:</label>
489 </div>
490 <div class="col-10">
491 <input type='text' size='40' name='form_street2' maxlength='60' value='<?php echo attr($row['street2'] ?? ''); ?>' class='form-control form-control-sm mb-1 inputtext' placeholder="<?php echo xla('Address Line 1'); ?>" />
492 <input type='text' size='40' name='form_streetb2' maxlength='60' value='<?php echo attr($row['streetb2'] ?? ''); ?>' class='form-control form-control-sm mt-1 inputtext' placeholder="<?php echo xla('Address Line 2'); ?>" />
493 </div>
494 </div>
496 <div class="form-row my-1">
497 <div class="col-2">
498 <label for="form_city2" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Alt City'); ?>:</label>
499 </div>
500 <div class="col-auto">
501 <input type='text' size='10' name='form_city2' maxlength='30' value='<?php echo attr($row['city2'] ?? ''); ?>' class='form-control form-control-sm inputtext' placeholder="<?php echo xla('Alt City'); ?>" />
502 </div>
503 <div class="col-auto">
504 <label for="form_state2" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Alt State') . "/" . xlt('county'); ?>:</label>
505 </div>
506 <div class="col-auto">
507 <?php echo generate_select_list('form_state2', 'state', ($row['state2'] ?? null), '', 'Unassigned', 'form-control-sm', 'typeSelect(this.value)'); ?>
508 </div>
509 <div class="col-auto">
510 <label for="form_zip2" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Alt Postal code'); ?>:</label>
511 </div>
512 <div class="col-auto">
513 <input type='text' size='10' name='form_zip2' maxlength='20' value='<?php echo attr($row['zip2'] ?? ''); ?>' class='form-control form-control-sm inputtext' placeholder="<?php echo xla('Alt Postal code'); ?>" />
514 </div>
515 </div>
517 <div class="form-row my-1">
518 <div class="col-auto">
519 <label for="form_upin" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('UPIN'); ?>:</label>
520 </div>
521 <div class="col-auto">
522 <input type='text' size='6' name='form_upin' maxlength='6' value='<?php echo attr($row['upin'] ?? ''); ?>' class='form-control form-control-sm inputtext' />
523 </div>
524 <div class="col-auto">
525 <label for="form_npi" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('NPI'); ?>:</label>
526 </div>
527 <div class="col-auto">
528 <input type='text' size='10' name='form_npi' maxlength='10' value='<?php echo attr($row['npi'] ?? ''); ?>' class='form-control form-control-sm inputtext' />
529 </div>
530 <div class="col-auto">
531 <label for="form_federaltaxid" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('TIN'); ?>:</label>
532 </div>
533 <div class="col-auto">
534 <input type='text' size='10' name='form_federaltaxid' maxlength='10' value='<?php echo attr($row['federaltaxid'] ?? ''); ?>' class='form-control form-control-sm inputtext' />
535 </div>
536 <div class="col-auto">
537 <label for="form_taxonomy" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Taxonomy'); ?>:</label>
538 </div>
539 <div class="col-auto">
540 <input type='text' size='10' name='form_taxonomy' maxlength='10' value='<?php echo attr($row['taxonomy'] ?? ''); ?>' class='form-control form-control-sm inputtext' />
541 </div>
542 </div>
543 <div class="form-group">
544 <label for="form_notes" class="font-weight-bold col-form-label col-form-label-sm"><?php echo xlt('Notes'); ?>:</label>
545 <textarea rows='3' cols='40' name='form_notes' wrap='virtual' class='form-control inputtext w-100'><?php echo text($row['notes'] ?? '') ?></textarea>
546 </div>
548 <br />
550 <input type='submit' class='btn btn-primary' name='form_save' value='<?php echo xla('Save'); ?>' />
552 <?php if ($userid && !$row['username']) { ?>
553 &nbsp;
554 <input type='submit' class='btn btn-danger' name='form_delete' value='<?php echo xla('Delete'); ?>' />
555 <?php } ?>
557 &nbsp;
558 <input type='button' class='btn btn-secondary' value='<?php echo xla('Cancel'); ?>' onclick='window.close()' />
559 </p>
560 </form>
561 <?php $use_validate_js = 1;?>
562 <?php validateUsingPageRules($_SERVER['PHP_SELF']);?>
563 </body>
564 </html>