Now producing event Time/Rate info for non date specific events in getEventForRegistr...
authorChuck Scott <cscott@gaslightmedia.com>
Wed, 18 Oct 2017 13:54:35 +0000 (09:54 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Wed, 18 Oct 2017 13:54:35 +0000 (09:54 -0400)
classes/data/dataRegEvent.php

index 74a5ef3..ec94f45 100644 (file)
@@ -677,6 +677,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                             // 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');
 
@@ -695,6 +696,22 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                         // 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);
+                                }
+
+                            }
+
+
                         }
 
                     }