3 * edit per-facility user information.
6 * @link http://www.open-emr.org
7 * @author Scott Wakefield <scott@npclinics.com.au>
8 * @author Brady Miller <brady.g.miller@gmail.com>
9 * @copyright Copyright (c) 2012 NP Clinics <info@npclinics.com.au>
10 * @copyright Copyright (c) 2017 Brady Miller <brady.g.miller@gmail.com>
11 * @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");
17 require_once("$srcdir/acl.inc");
19 use OpenEMR\Core\Header
;
22 if (!acl_check('admin', 'users')) {
23 die(xlt("Unauthorized"));
26 // Ensure variables exist
27 if (!isset($_GET["user_id"]) ||
!isset($_GET["fac_id"])) {
36 <title
><?php
echo xlt("Edit Facility Specific User Information"); ?
></title
>
38 <?php Header
::setupHeader(['common','jquery-ui','datetime-picker','opener']); ?
>
40 <script language
="JavaScript">
41 $
(document
).ready(function(){
42 $
("#form_facility_user").submit(function (event
) {
44 event
.preventDefault();
45 var post_url
= $
(this
).attr("action");
46 var request_method
= $
(this
).attr("method");
47 var form_data
= $
(this
).serialize();
52 }).done(function (r
) {
53 dlgclose('refreshme', false);
57 $
("#cancel").click(function() {
61 $
('.datepicker').datetimepicker({
62 <?php
$datetimepicker_timepicker = false; ?
>
63 <?php
$datetimepicker_showseconds = false; ?
>
64 <?php
$datetimepicker_formatInput = true; ?
>
65 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
66 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
68 $
('.datetimepicker').datetimepicker({
69 <?php
$datetimepicker_timepicker = true; ?
>
70 <?php
$datetimepicker_showseconds = false; ?
>
71 <?php
$datetimepicker_formatInput = true; ?
>
72 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
73 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
79 <body
class="body_top">
81 // Collect user information
82 $user_info = sqlQuery("select * from `users` WHERE `id` = ?", array($_GET["user_id"]));
84 // Collect facility information
85 $fac_info = sqlQuery("select * from `facility` where `id` = ?", array($_GET["fac_id"]));
87 // Collect layout information and store them in an array
88 $l_res = sqlStatement("SELECT * FROM layout_options " .
89 "WHERE form_id = 'FACUSR' AND uor > 0 AND field_id != '' " .
90 "ORDER BY group_id, seq");
92 for ($i=0; $row=sqlFetchArray($l_res); $i++
) {
97 <div
class="container">
99 <div
class="col-xs-12">
100 <div
class="page-title">
101 <h3
><?php
echo xlt('Edit Facility Specific User Information'); ?
></h3
>
106 <form name
='form_facility_user' id
='form_facility_user' method
='post' action
="facility_user.php">
107 <input type
=hidden name
=mode value
="facility_user_id">
108 <input type
=hidden name
=user_id value
="<?php echo attr($_GET["user_id
"]);?>">
109 <input type
=hidden name
=fac_id value
="<?php echo attr($_GET["fac_id
"]);?>">
110 <?php
$iter = sqlQuery("select * from facility_user_ids where id=?", array($my_id)); ?
>
112 <table border
=0 cellpadding
=0 cellspacing
=0>
115 <?php
echo xlt('User'); ?
>:
118 <?php
echo text($user_info['username']); ?
>
123 <?php
echo xlt('Facility'); ?
>:
126 <?php
echo text($fac_info['name']); ?
>
129 <?php
foreach ($l_arr as $layout_entry) { ?
>
131 <td style
="width:180px;">
132 <?php
echo text(xl_layout_label($layout_entry['title'])) ?
>:
134 <td style
="width:270px;">
136 $entry_data = sqlQuery("SELECT `field_value` FROM `facility_user_ids` " .
137 "WHERE `uid` = ? AND `facility_id` = ? AND `field_id` = ?", array($user_info['id'],$fac_info['id'],$layout_entry['field_id']));
138 echo "<td>" . generate_form_field($layout_entry, $entry_data['field_value']) . " </td>";
146 <button type
="submit" class="btn btn-default btn-save" name
='form_save' id
='form_save' href
='#' >
147 <?php
echo xlt('Save');?
>
149 <a
class="btn btn-link btn-cancel oe-opt-btn-separate-left" id
='cancel' href
='#'>
150 <?php
echo xlt('Cancel');?
>
158 <!-- include support
for the
list-add selectbox feature
-->
159 <?php
include $GLOBALS['fileroot'] . "/library/options_listadd.inc"; ?
>
161 <script language
="JavaScript">
162 <?php
echo $date_init; ?
>