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 $res = sqlStatement("SELECT * FROM customlists as cl left outer join users as u on cl_creator=u.id WHERE cl_list_type=3 AND cl_deleted=0");
39 <title
><!-- Insert your title here
--></title
>
40 <?php Header
::setupHeader('opener'); ?
>
41 <script src
="<?php echo $GLOBALS['webroot'] ?>/library/js/ajax_functions_writer.js"></script
>
44 function delete_full_category(id
){
52 source
: "delete_full_category"
54 success
: function(thedata
){
55 alert("<?php echo addslashes(xl('Deleted Successfully.'));?>");
56 document
.location
.reload();
63 function delete_category(id
){
65 if(confirm("<?php echo addslashes(xl('Do you want to delete?'));?>")){
72 source
: "delete_category"
74 success
: function(thedata
){
76 alert("<?php echo addslashes('There are currently other users of the category you are trying to delete. Please contact them and ask them to delete it. Categories may not be deleted while in use. This Categories are currently used by \n');?>"+thedata
);
79 delete_full_category(id
);
91 <body
class="body_top">
93 <table align
="center">
94 <tr
class="text reportTableHeadRow">
95 <th
><?php
echo htmlspecialchars('Sl.No', ENT_QUOTES
);?
></th
>
96 <th
><?php
echo htmlspecialchars(xl('Category'), ENT_QUOTES
);?
></th
>
97 <th
><?php
echo htmlspecialchars(xl('Context'), ENT_QUOTES
);?
></th
>
98 <th
><?php
echo htmlspecialchars(xl('Creator'), ENT_QUOTES
);?
></th
>
99 <th
><?php
echo htmlspecialchars(xl('Delete'), ENT_QUOTES
);?
></th
>
103 while ($row = sqlFetchArray($res)) {
104 $context = sqlQuery("SELECT * FROM customlists WHERE cl_list_slno=?", array($row['cl_list_id']));
106 $class = (($class ??
'') == 'reportTableOddRow') ?
'reportTableEvenRow' : 'reportTableOddRow';
107 echo "<tr class='text " . htmlspecialchars($class, ENT_QUOTES
) . "'>";
108 echo "<td>" . $i . "</td>";
109 echo "<td>" . htmlspecialchars($row['cl_list_item_long'], ENT_QUOTES
) . "</td>";
110 echo "<td>" . htmlspecialchars($context['cl_list_item_long'], ENT_QUOTES
) . "</td>";
111 echo "<td>" . htmlspecialchars($row['fname'] . " " . $row['mname'] . " " . $row['lname'], ENT_QUOTES
) . "</td>";
112 echo "<td><a href=#>";
113 echo "<img src='../../interface/pic/Delete.gif' border=0 title='Delete This Row' onclick=delete_category('" . htmlspecialchars($row['cl_list_slno'], ENT_QUOTES
) . "')>";