Email change of a developer (#503)
[openemr.git] / library / ajax / dated_reminders_counter.php
blobc4e7163603042838cf68603c4619a7a4ea74d272
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.g.miller@gmail.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/dated_reminder_functions.php");
33 require_once("$srcdir/pnotes.inc");
35 //Collect number of due reminders
36 $dueReminders = GetDueReminderCount(5,strtotime(date('Y/m/d')));
38 //Collect number of active messages
39 $activeMessages = getPnotesByUser("1","no",$_SESSION['authUser'],true);
41 $totalNumber = $dueReminders + $activeMessages;
42 echo ($totalNumber > 0 ? '('.text(intval($totalNumber)).')' : '');