3 // +-----------------------------------------------------------------------------+
4 // Copyright (C) 2011 Z&H Consultancy Services Private Limited <sam@zhservices.com>
7 // 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.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
19 // A copy of the GNU General Public License is included along with this program:
20 // openemr/interface/login/GnuGPL.html
21 // For more information write to the Free Software
22 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 // Author: Eldho Chacko <eldho@zhservices.com>
25 // Jacob T Paul <jacob@zhservices.com>
27 // +------------------------------------------------------------------------------+
31 require_once("../../interface/globals.php");
33 use OpenEMR\Core\Header
;
35 $list_id = $_REQUEST['list_id'];
39 <?php Header
::setupHeader(); ?
>
41 function add_template(){
43 len
= document
.getElementById('provider').options
.length
;
47 if(document
.getElementById('provider').options
[i
].selected
==true){
49 val+
=document
.getElementById('provider').options
[i
].value+
"|";
58 list_id
: <?php
echo js_escape($list_id); ?
>,
60 source
: "save_provider"
63 success
: function(thedata
){
74 alert(<?php
echo xlj('You should select at least one Provider');?
>);
80 <body
class="body_top">
85 <select multiple name
="provider[]" id
="provider" size
="5">
87 $query = "SELECT id, lname, fname FROM users WHERE authorized = 1 AND username != '' " .
88 "AND active = 1 AND ( info IS NULL OR info NOT LIKE '%Inactive%' ) ORDER BY lname, fname";
89 $res = sqlStatement($query);
90 $sel_query = "SELECT tu_user_id FROM template_users WHERE tu_template_id=?";
91 $row_sel = sqlQuery($sel_query, array($list_id));
92 while ($row = sqlFetchArray($res)) {
93 foreach ($row_sel as $key => $value) {
94 if ($value == $row['id']) {
100 echo "<option value='" . attr($row['id']) . "' $sel>" . text($row['lname'] . "," . $row['fname']) . "</option>";
106 <a href
="#" onclick
="add_template()" class="btn btn-primary"><span
><?php
echo xlt('Save');?
></span
></a
>