Change support desk contact information (#7561)
[openemr.git] / library / custom_template / share_template.php
blob0cad95b02df77a1bb81faf9763cefa0bfb9c5b66
1 <?php
3 // +-----------------------------------------------------------------------------+
4 // Copyright (C) 2011 Z&H Consultancy Services Private Limited <sam@zhservices.com>
5 //
6 //
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'];
37 <html>
38 <head>
39 <?php Header::setupHeader(); ?>
40 <script>
41 function add_template(){
42 top.restoreSession();
43 len = document.getElementById('provider').options.length;
44 sel_len=0;
45 val="";
46 for(i=0;i<len;i++){
47 if(document.getElementById('provider').options[i].selected==true){
48 sel_len++;
49 val+=document.getElementById('provider').options[i].value+"|";
52 if(sel_len>0){
53 $.ajax({
54 type: "POST",
55 url: "ajax_code.php",
56 dataType: "html",
57 data: {
58 list_id: <?php echo js_escape($list_id); ?>,
59 multi: val,
60 source: "save_provider"
62 async: false,
63 success: function(thedata){
66 error:function(){
67 alert("fail");
69 });
70 dlgclose();
71 return;
73 else{
74 alert(<?php echo xlj('You should select at least one Provider');?>);
78 </script>
79 </head>
80 <body class="body_top">
81 <form >
82 <table>
83 <tr class="text">
84 <td>
85 <select multiple name="provider[]" id="provider" size="5">
86 <?php
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']) {
95 $sel = "selected";
96 } else {
97 $sel = '';
100 echo "<option value='" . attr($row['id']) . "' $sel>" . text($row['lname'] . "," . $row['fname']) . "</option>";
103 </select>
104 </td>
105 <td>
106 <a href="#" onclick="add_template()" class="btn btn-primary"><span><?php echo xlt('Save');?></span></a>
107 </td>
108 </tr>
109 </table>
110 </form>
111 </body>
112 </html>