Code: Select all
// control if the course is elapsed
/*if($course['date_begin'] != '0000-00-00') {
$time_begin = fromDatetimeToTimestamp($course['date_begin']);
if($now < $time_begin) return array('can' => false, 'reason' => 'course_date', 'expiring_in' => $expiring);
}
if($course['date_end'] != '0000-00-00') {
$time_end = fromDatetimeToTimestamp($course['date_end']);
if($now > $time_end) return array('can' => false, 'reason' => 'course_date', 'expiring_in' => $expiring);
}
if($course['valid_time'] != '0' && $course['valid_time'] != '' && $course['date_first_access'] != '') {
$time_first_access = fromDatetimeToTimestamp($course['date_first_access']);
if($now > ( $time_first_access + ($course['valid_time'] * 24 * 3600 ) )) return array('can' => true, 'reason' => 'course_valid_time', 'expiring_in' => $expiring);
}*/