<?
require_once('modules/EcmReminders/ReminderHelper.php');

$meetings = array();
$calls = array();
$ecmreminders = array();

global $current_user;
$rem_time = $current_user->getPreference('reminder_time');

if(empty($rem_time)){
	$rem_time = -1;
}

if($rem_time != -1)
{

	$name = array();
	$ecmreminders=getList("ecmreminders","showall"," and reminder_time!='-1'","date_start","date_start","EcmReminders",1);
	
	if (!is_array($ecmreminders)) return;
	
		foreach ($ecmreminders as $v) {
		//echo $v['reminder_time'];
		if($v['reminder_time'] != -1)
		{
			$rem = strtotime($v['date_start'].' '.$v['time_start'])-$v['reminder_time']+calculateGMT()-$rem_time;
			$cur = mktime();
			if ($rem - $cur < 0) $name[] = $v;
		}
	}
		
	if(count($name)>0) {
		echo "ok";
	}


}

?>
