34b5bc6a50e7479ca32719f9be027be9434d3d71
[openemr.git] / library / ajax / dated_reminders_counter.php
blob34b5bc6a50e7479ca32719f9be027be9434d3d71
1 <?php
2 // ------------------------------------------------------------------------ //
3 // OpenEMR Electronic Medical Records System //
4 // Copyright (c) 2012 tajemo.co.za //
5 // <http://www.tajemo.co.za/> //
6 // ------------------------------------------------------------------------ //
7 // This program is free software; you can redistribute it and/or modify //
8 // it under the terms of the GNU General Public License as published by //
9 // the Free Software Foundation; either version 2 of the License, or //
10 // (at your option) any later version. //
11 // //
12 // You may not change or alter any portion of this comment or credits //
13 // of supporting developers from this source code or any supporting //
14 // source code which is considered copyrighted (c) material of the //
15 // original comment or credit authors. //
16 // //
17 // This program is distributed in the hope that it will be useful, //
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
20 // GNU General Public License for more details. //
21 // //
22 // You should have received a copy of the GNU General Public License //
23 // along with this program; if not, write to the Free Software //
24 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
25 // --------------------------------------------------------------------------//
26 // Original Author of this file: Craig Bezuidenhout (Tajemo Enterprises) //
27 // Purpose of this file: Returns a count of due messages for current user //
28 // --------------------------------------------------------------------------//
30 //SANITIZE ALL ESCAPES
31 $sanitize_all_escapes=true;
34 //STOP FAKE REGISTER GLOBALS
35 $fake_register_globals=false;
37 require_once("../../interface/globals.php");
38 require_once("$srcdir/htmlspecialchars.inc.php");
39 require_once("$srcdir/dated_reminder_functions.php");
40 require_once("$srcdir/pnotes.inc");
42 //Collect number of due reminders
43 $dueReminders = GetDueReminderCount(5,strtotime(date('Y/m/d')));
45 //Collect number of active messages
46 $activeMessages = getPnotesByUser("1","no",$_SESSION['authUser'],true);
48 $totalNumber = $dueReminders + $activeMessages;
49 echo ($totalNumber > 0 ? '('.text(intval($totalNumber)).')' : '');