* @author Brady Miller * @copyright Copyright (c) 2012 tajemo.co.za * @copyright Copyright (c) 2018 Brady Miller * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 */ // removed as jquery is already called in messages page (if you need to use jQuery, uncomment it futher down) require_once(__DIR__ . '/../../globals.php'); require_once("$srcdir/dated_reminder_functions.php"); use OpenEMR\Common\Csrf\CsrfUtils; $days_to_show = 30; $alerts_to_show = $GLOBALS['dated_reminders_max_alerts_to_show']; $updateDelay = 60; // time is seconds // ----- get time stamp for start of today, this is used to check for due and overdue reminders $today = strtotime(date('Y/m/d')); // ----- set $hasAlerts to false, this is used for auto-hiding reminders if there are no due or overdue reminders $hasAlerts = false; // mulitply $updateDelay by 1000 to get miliseconds $updateDelay = $updateDelay * 1000; //----------------------------------------------------------------------------- // HANDLE AJAX TO MARK REMINDERS AS READ // Javascript will send a post // ---------------------------------------------------------------------------- if (isset($_POST['drR'])) { if (!CsrfUtils::verifyCsrfToken($_POST["csrf_token_form"])) { CsrfUtils::csrfNotVerified(); } // set as processed setReminderAsProcessed($_POST['drR']); // ----- get updated data $reminders = RemindersArray($days_to_show, $today, $alerts_to_show); // ----- echo for ajax to use echo getRemindersHTML($today, $reminders); // stop any other output exit; } //----------------------------------------------------------------------------- // END HANDLE AJAX TO MARK REMINDERS AS READ // ---------------------------------------------------------------------------- $reminders = RemindersArray($days_to_show, $today, $alerts_to_show); ?>
' . xla('Dated Reminders') . '
'; $pdHTML .= getRemindersHTML($today, $reminders); $pdHTML .= '
'; // print output echo $pdHTML; ?>