2 // Copyright (C) 2011 Ensoftek, Inc
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // A copy of the GNU General Public License is included along with this program:
15 // openemr/interface/login/GnuGPL.html
16 // For more information write to the Free Software
17 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 class Controller_alerts
extends BaseController
{
21 function _action_listactmgr() {
22 $c = new CdrAlertManager();
23 $this->viewBean
->rules
= $c->populate();
24 $this->set_view("list_actmgr.php");
28 function _action_submitactmgr() {
32 $actives = $_POST["active"];
33 $passives = $_POST["passive"];
34 $reminders = $_POST["reminder"];
35 $access_controls = $_POST["access_control"];
38 // The array of check-boxes we get from the POST are only those of the checked ones with value 'on'.
39 // So, we have to manually create the entitre arrays with right values.
40 $actives_final = array();
41 $passives_final = array();
42 $reminders_final = array();
45 $numrows = count($ids);
46 for ($i = 0; $i < $numrows; ++
$i) {
48 if ( $actives[$i] == "on") {
49 $actives_final[] = "1";
52 $actives_final[] = "0";;
55 if ( $passives[$i] == "on") {
56 $passives_final[] = "1";
59 $passives_final[] = "0";;
62 if ( $reminders[$i] == "on") {
63 $reminders_final[] = "1";
66 $reminders_final[] = "0";;
72 // Reflect the changes to the database.
73 $c = new CdrAlertManager();
74 $c->update($ids, $actives_final, $passives_final, $reminders_final, $access_controls);
76 $this->forward("listactmgr");