Fix the dated reminders script headers.
[openemr.git] / library / ajax / dated_reminders_counter.php
blob7e34deb46b551de8989d01176d98ecc851c60c66
1 <?php
2 /**
3 * Returns a count of due messages for current user.
5 * Copyright (C) 2012 tajemo.co.za <http://www.tajemo.co.za/>
7 * LICENSE: 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 3
10 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
18 * @package OpenEMR
19 * @author Craig Bezuidenhout <http://www.tajemo.co.za/>
20 * @author Brady Miller <brady@sparmy.com>
21 * @link http://www.open-emr.org
24 //SANITIZE ALL ESCAPES
25 $sanitize_all_escapes=true;
28 //STOP FAKE REGISTER GLOBALS
29 $fake_register_globals=false;
31 require_once("../../interface/globals.php");
32 require_once("$srcdir/htmlspecialchars.inc.php");
33 require_once("$srcdir/dated_reminder_functions.php");
34 require_once("$srcdir/pnotes.inc");
36 //Collect number of due reminders
37 $dueReminders = GetDueReminderCount(5,strtotime(date('Y/m/d')));
39 //Collect number of active messages
40 $activeMessages = getPnotesByUser("1","no",$_SESSION['authUser'],true);
42 $totalNumber = $dueReminders + $activeMessages;
43 echo ($totalNumber > 0 ? '('.text(intval($totalNumber)).')' : '');