Fix bad entry for reg_request_rate
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 14 Nov 2017 16:46:24 +0000 (11:46 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 14 Nov 2017 16:46:24 +0000 (11:46 -0500)
Fixing bug when adding the reg_reguest_rate entries.

js/frontRegApp.js
js/views/front/regClass.js
models/admin/ajax/regFront/registrant.php
models/front/registrations/registration.php

index 8a5226c..3084bf5 100644 (file)
@@ -508,7 +508,7 @@ app.Views.Front.RegClass = Backbone.View.extend({
         console.log( timeId );
         // Check to see if the time is already in the collection
         // If it is then do nothing
-        console.log(this.model.regTimes);
+        console.log(this.model.regTimes.length);
 
         var findRegTime = this.model.regTimes.where({ id: timeId });
         console.log(findRegTime.length);
index be400db..dc9858e 100644 (file)
@@ -39,7 +39,7 @@ app.Views.Front.RegClass = Backbone.View.extend({
         console.log( timeId );
         // Check to see if the time is already in the collection
         // If it is then do nothing
-        console.log(this.model.regTimes);
+        console.log(this.model.regTimes.length);
 
         var findRegTime = this.model.regTimes.where({ id: timeId });
         console.log(findRegTime.length);
index 6f6d75c..c53744c 100644 (file)
@@ -250,10 +250,12 @@ class GlmMembersAdmin_registrations_ajax_registrant extends GlmDataRegistrations
                        FROM " .GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request_rate
                       WHERE reg_event = %d
                         AND rate = %d
-                        AND reg_request = %d",
+                        AND reg_request = %d
+                        AND reg_request_class = %d",
                     $modelData['reg_event'],
                     $modelData['reg_rate'],
-                    $modelData['reg_request']
+                    $modelData['reg_request'],
+                    $regRequestClassId
                 )
             );
             // At this point we need to get the rate data
index 4e33ac4..c0958ba 100644 (file)
             foreach ( $regEvent['reg_class'] as $key => $rClass ) {
                 // Pull the rate data
                 if ( isset( $rClass['times'] ) && is_array( $rClass['times'] ) && count( $rClass['times'] ) > 0 ) {
+                    // echo '<pre>$rClass[times]: ' . print_r( $rClass['times'], true ) . '</pre>';
                     foreach ( $rClass['times'] as &$time ) {
                         $rClass['loggedIn']            = ( isset($_SESSION['LoginAccount']) ) ? true : false;
                         $rClass['reg_rate_id']         = $time['id'];