// Try to find a current rate for this time - within the start and end days before this time
foreach ($cv['reg_rate'] as $rk=>$rv) {
+ // Calculate earliest and latest days for this rate calculated from the start of this event time
$earliestTime = strtotime(date('m/d/Y', $tv['start_datetime']['timestamp']).' -'.$rv['start_days'].' days');
$latestTime = strtotime(date('m/d/Y', $tv['start_datetime']['timestamp']).' -'.($rv['end_days']-1).' days');
// If event time is for non time specific event (might be either mixed in)
if (!$tv['event_time']) {
+ // Try to find a current rate for this time - within the start and end days before this time
+ foreach ($cv['reg_rate'] as $rk=>$rv) {
+
+ // Calculate earliest and latest days for this rate calculated from the start of the first date/time for this event
+ // ** We may want to make it optional to use the last day of the event ???
+ $earliestTime = strtotime(date('m/d/Y', $this->regEventData['firstTime']['start_time']['timestamp']).' -'.$rv['start_days'].' days');
+ $latestTime = strtotime(date('m/d/Y', $this->regEventData['firstTime']['start_time']['timestamp']).' -'.($rv['end_days']-1).' days');
+
+ // If it's time to register with this time/rate - Add it to the class data
+ if (time() > $earliestTime && time() < $latestTime) {
+ $this->regEventData['reg_class'][$ck]['times'][$tv['event_time']] = array_merge($tv, $rv);
+ }
+
+ }
+
+
}
}