More work completed on reading carts.
authorChuck Scott <cscott@gaslightmedia.com>
Thu, 6 Apr 2017 20:23:51 +0000 (16:23 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Thu, 6 Apr 2017 20:23:51 +0000 (16:23 -0400)
Initial output of registrations list and detail.
Added data table for event times that will track summary data for registrations for a particular event time.
Added some additional fields to various tables to help track hold status for cart registrations that have now been processed.

27 files changed:
classes/data/dataMagicform.php
classes/data/dataMfData.php
classes/data/dataMfTempFile.php
classes/data/dataPaymentCode.php
classes/data/dataRegClass.php
classes/data/dataRegEvent.php
classes/data/dataRegRate.php [new file with mode: 0644]
classes/data/dataRegRates.php [deleted file]
classes/data/dataRegRequest.php
classes/data/dataRegRequestClass.php
classes/data/dataRegRequestEvent.php
classes/data/dataRegRequestRate.php
classes/data/dataRegRequestRegistrant.php
classes/registrationsSupport.php
index.php
models/admin/registrations/requests.php
setup/databaseScripts/create_database_V0.0.2.sql [deleted file]
setup/databaseScripts/create_database_V0.0.6.sql [new file with mode: 0644]
setup/databaseScripts/dbVersions.php
setup/databaseScripts/drop_database_V0.0.2.sql [deleted file]
setup/databaseScripts/drop_database_V0.0.6.sql [new file with mode: 0644]
setup/databaseScripts/update_database_V0.0.3.sql [new file with mode: 0644]
setup/databaseScripts/update_database_V0.0.4.sql [new file with mode: 0644]
setup/databaseScripts/update_database_V0.0.5.sql [new file with mode: 0644]
setup/databaseScripts/update_database_V0.0.6.sql [new file with mode: 0644]
views/admin/registrations/editRequest.html
views/admin/registrations/requests.html

index b8abf9f..330f800 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * GLM Member-DB WordPress Add-On Plugin
- * Registrations Added Info Fields data class
+ * Registrations MagicForm data class
  *
  * PHP version 5.3
  *
@@ -9,11 +9,11 @@
  * @package  GLM Member-DB
  * @author   Chuck Scott <cscott@gaslightmedia.com>
  * @license  http://www.gaslightmedia.com Gaslightmedia
- * @release  SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
+ * @release  SVN: $Id: dataMagicForm.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
  */
 
 /**
- * GlmDataRegistrationsAddedInfoFields class
+ * GlmDataRegistrationsMagicform class
  *
  * PHP version 5
  *
@@ -21,7 +21,7 @@
  * @package GLM Member DB
  * @author  Chuck Scott <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
- *          @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott
+ *          @release SVN: $Id: dataMagicForm.php,v 1.0 2011/01/25 19:31:47 cscott
  *          Exp $
  */
 class GlmDataRegistrationsMagicform extends GlmDataAbstract
@@ -115,7 +115,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract
                 'view_only' => true,
                 'use' => 'a'
             ),
-            
+
             // Form ID
             'form_id' => array (
                 'field' => 'form_id',
@@ -123,7 +123,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract
                 'required' => true,
                 'use' => 'a'
             ),
-            
+
             // Custom ID
             'custom_id' => array (
                 'field' => 'custom_id',
@@ -131,7 +131,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract
                 'required' => true,
                 'use' => 'a'
             ),
-            
+
             // Form Title
             'title' => array (
                 'field' => 'title',
@@ -139,7 +139,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract
                 'required' => true,
                 'use' => 'a'
             ),
-            
+
             // Form Title
             'type' => array (
                 'field' => 'type',
@@ -147,7 +147,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract
                 'required' => true,
                 'use' => 'a'
             ),
-            
+
             // Form Description
             'descr' => array (
                 'field'     => 'descr',
@@ -155,7 +155,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
+
             // Active
             'active' => array (
                 'field'     => 'active',
@@ -163,7 +163,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract
                 'use'       => 'a',
                 'default'   => '0'
             ),
-            
+
             // Required
             'required' => array (
                 'field'     => 'required',
@@ -171,7 +171,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract
                 'use'       => 'a',
                 'default'   => '0'
             ),
-            
+
             // Data 1
             'data1' => array (
                 'field'     => 'data1',
@@ -179,7 +179,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'a'
             ),
-            
+
             // Sort
             'sort' => array (
                 'field'     => 'sort',
@@ -187,7 +187,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'a'
             ),
-            
+
             // Expanded
             'expanded' => array (
                 'field'     => 'expanded',
@@ -195,7 +195,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract
                 'use'       => 'a',
                 'default'   => '0'
             ),
-            
+
             // Style
             'style' => array (
                 'field'     => 'style',
@@ -203,7 +203,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'a'
             ),
-            
+
             // File
             'file' => array (
                 'field'     => 'file',
@@ -211,7 +211,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract
                 'required'  => '',
                 'use'       => 'a'
             ),
-            
+
             // Columns
             'cols' => array (
                 'field'     => 'cols',
@@ -219,7 +219,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'a'
             ),
-            
+
             // Rows
             'rows' => array (
                 'field'     => 'rows',
@@ -227,7 +227,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'a'
             ),
-            
+
             // Size
             'size' => array (
                 'field'     => 'size',
@@ -235,7 +235,7 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'a'
             ),
-            
+
             // Format
             'format' => array (
                 'field'     => 'format',
@@ -243,16 +243,16 @@ class GlmDataRegistrationsMagicform extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'a'
             ),
-            
+
             // Default Value
             'default_val' => array (
                 'field'     => 'default_val',
                 'type'      => 'text',
                 'required'  => true,
                 'use'       => 'a'
-            ),          
-            
-            
+            ),
+
+
         );
 
     }
index d5f8e67..e9cf2d4 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * GLM Member-DB WordPress Add-On Plugin
- * Registrations Added Info Fields data class
+ * Registrations MagicForm Data data class
  *
  * PHP version 5.3
  *
@@ -9,11 +9,11 @@
  * @package  GLM Member-DB
  * @author   Chuck Scott <cscott@gaslightmedia.com>
  * @license  http://www.gaslightmedia.com Gaslightmedia
- * @release  SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
+ * @release  SVN: $Id: dataMfData.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
  */
 
 /**
- * GlmDataRegistrationsAddedInfoFields class
+ * GlmDataRegistrationsMfData class
  *
  * PHP version 5
  *
@@ -21,7 +21,7 @@
  * @package GLM Member DB
  * @author  Chuck Scott <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
- *          @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott
+ *          @release SVN: $Id: dataMfData.php,v 1.0 2011/01/25 19:31:47 cscott
  *          Exp $
  */
 class GlmDataRegistrationsMfData extends GlmDataAbstract
@@ -108,14 +108,14 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract
 
         $this->fields = array (
 
-            
+
             'id' => array (
                 'field' => 'id',
                 'type' => 'integer',
                 'view_only' => true,
                 'use' => 'a'
             ),
-            
+
             // FIID
             'fiid' => array (
                 'field'     => 'fiid',
@@ -123,7 +123,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'a'
             ),
-            
+
             // Form ID
             'form_id' => array (
                 'field'     => 'form_id',
@@ -131,7 +131,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'a'
             ),
-            
+
             // Field ID
             'field_id' => array (
                 'field'     => 'field_id',
@@ -139,7 +139,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'a'
             ),
-            
+
             // Level
             'level' => array (
                 'field'     => 'level',
@@ -147,7 +147,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'a'
             ),
-            
+
             // Form Title
             'title' => array (
                 'field'     => 'title',
@@ -155,7 +155,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'a'
             ),
-            
+
             // Form Type
             'type' => array (
                 'field'     => 'type',
@@ -163,7 +163,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'a'
             ),
-            
+
             // Text Type
             'txt_type' => array (
                 'field'     => 'txt_type',
@@ -171,7 +171,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'a'
             ),
-            
+
             // Value
             'value' => array (
                 'field'     => 'value',
@@ -179,7 +179,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'a'
             ),
-            
+
             // Number Value
             'numb_value' => array (
                 'field'     => 'numb_value',
@@ -187,7 +187,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'a'
             ),
-            
+
             // Text Value
             'txt_value' => array (
                 'field'     => 'txt_value',
@@ -195,7 +195,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'a'
             ),
-            
+
             // Option Number
             'opt_num' => array (
                 'field'     => 'opt_num',
@@ -203,7 +203,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'a'
             ),
-            
+
             // Valid
             'valid' => array (
                 'field'     => 'valid',
@@ -211,7 +211,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract
                 'use'       => 'a',
                 'default'   => 0
             ),
-            
+
             // Required
             'required' => array (
                 'field'     => 'required',
@@ -219,7 +219,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract
                 'use'       => 'a',
                 'default'   => 0
             ),
-            
+
             // Failure
             'failure' => array (
                 'field'     => 'failure',
@@ -227,7 +227,7 @@ class GlmDataRegistrationsMfData extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'a'
             ),
-            
+
         );
 
     }
index bec8eba..266e12f 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * GLM Member-DB WordPress Add-On Plugin
- * Registrations Added Info Fields data class
+ * Registrations MagicForm Temporary File data class
  *
  * PHP version 5.3
  *
@@ -9,11 +9,11 @@
  * @package  GLM Member-DB
  * @author   Chuck Scott <cscott@gaslightmedia.com>
  * @license  http://www.gaslightmedia.com Gaslightmedia
- * @release  SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
+ * @release  SVN: $Id: dataMfTempFile.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
  */
 
 /**
- * GlmDataRegistrationsAddedInfoFields class
+ * GlmDataRegistrationsMfTempFile class
  *
  * PHP version 5
  *
  * @package GLM Member DB
  * @author  Chuck Scott <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
- *          @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott
+ *          @release SVN: $Id: dataMfTempFile.php,v 1.0 2011/01/25 19:31:47 cscott
  *          Exp $
  */
-class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract
+class GlmDataRegistrationsMfTempFile extends GlmDataAbstract
 {
 
     /**
index 8395737..9e11e6a 100644 (file)
@@ -21,7 +21,7 @@
  * @package GLM Member DB
  * @author  Chuck Scott <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
- *          @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott
+ *          @release SVN: $Id: dataPaymentCode.php,v 1.0 2011/01/25 19:31:47 cscott
  *          Exp $
  */
 class GlmDataRegistrationsPaymentCode extends GlmDataAbstract
@@ -114,7 +114,7 @@ class GlmDataRegistrationsPaymentCode extends GlmDataAbstract
                 'view_only' => true,
                 'use' => 'a'
             ),
-            
+
 
             // Payment Code Type
             'code_type' => array (
index 8993ba8..164fea0 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * GLM Member-DB WordPress Add-On Plugin
- * Registrations Added Info Fields data class
+ * Registrations Class data class
  *
  * PHP version 5.3
  *
@@ -9,11 +9,11 @@
  * @package  GLM Member-DB
  * @author   Chuck Scott <cscott@gaslightmedia.com>
  * @license  http://www.gaslightmedia.com Gaslightmedia
- * @release  SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
+ * @release  SVN: $Id: dataRegClass.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
  */
 
 /**
- * GlmDataRegistrationsAddedInfoFields class
+ * GlmDataRegistrationsRegClass class
  *
  * PHP version 5
  *
@@ -21,7 +21,7 @@
  * @package GLM Member DB
  * @author  Chuck Scott <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
- *          @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott
+ *          @release SVN: $Id: dataRegClass.php,v 1.0 2011/01/25 19:31:47 cscott
  *          Exp $
  */
 class GlmDataRegistrationsRegClass extends GlmDataAbstract
@@ -107,7 +107,7 @@ class GlmDataRegistrationsRegClass extends GlmDataAbstract
          */
 
         $this->fields = array (
-            
+
             // ID
             'id' => array (
                 'field'     => 'id',
@@ -115,7 +115,7 @@ class GlmDataRegistrationsRegClass extends GlmDataAbstract
                 'view_only' => true,
                 'use'       => 'a'
             ),
-            
+
             // Pointer to reg_event table
             'reg_event'     => array (
                 'field'     => 'reg_event',
@@ -126,7 +126,7 @@ class GlmDataRegistrationsRegClass extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'lgneud'
             ),
-            
+
             // Name of this registration type
             'name' => array (
                 'field'     => 'name',
@@ -134,7 +134,7 @@ class GlmDataRegistrationsRegClass extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'a'
             ),
-            
+
             // Registration Description
             'descr' => array (
                 'field'     => 'descr',
@@ -142,7 +142,7 @@ class GlmDataRegistrationsRegClass extends GlmDataAbstract
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
+
         );
 
     }
index bb2f9ec..8c741c1 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * GLM Member-DB WordPress Add-On Plugin
- * Registrations Added Info Fields data class
+ * Registrations Event data class
  *
  * PHP version 5.3
  *
@@ -9,11 +9,11 @@
  * @package  GLM Member-DB
  * @author   Chuck Scott <cscott@gaslightmedia.com>
  * @license  http://www.gaslightmedia.com Gaslightmedia
- * @release  SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
+ * @release  SVN: $Id: dataRegEvent.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
  */
 
 /**
- * GlmDataRegistrationsAddedInfoFields class
+ * GlmDataRegistrationsRegEvent class
  *
  * PHP version 5
  *
@@ -21,7 +21,7 @@
  * @package GLM Member DB
  * @author  Chuck Scott <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
- *          @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott
+ *          @release SVN: $Id: dataRegEvent.php,v 1.0 2011/01/25 19:31:47 cscott
  *          Exp $
  */
 class GlmDataRegistrationsRegEvent extends GlmDataAbstract
@@ -115,18 +115,23 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                 'view_only' => true,
                 'use'       => 'a'
             ),
-            
+
             // Pointer to event in Events add-on
             'event' => array (
                 'field'     => 'event',
-                'type'      => 'pointer',
-                    'p_table'   => GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . 'events',
-                    'p_field'   => 'id',
-                    'p_static'  => true,
+                'type'      => 'integer',
+                'required'  => true,
+                'use'       => 'lgneud'
+            ),
+
+            // Event Name
+            'event_name' => array (
+                'field'     => 'event_name',
+                'type'      => 'text',
                 'required'  => true,
                 'use'       => 'lgneud'
             ),
-            
+
             // A short code used to reference this event
             'event_code' => array (
                 'field'     => 'event_code',
@@ -134,7 +139,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'a'
             ),
-            
+
             // E-Mail addresses to recieve notification of a registration other than org_internal_email in management, comma separated
             'notify_email' => array (
                 'field'     => 'notify_email',
@@ -142,7 +147,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                 'required'  => true,
                 'use'       => 'a'
             ),
-            
+
             // Active flag for admin from Events - If false, then does not show as a link from events to manage event. Still shows in registrations admin
             'admin_active' => array (
                 'field'     => 'admin_active',
@@ -150,7 +155,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                 'use'       => 'a',
                 'default'   => 0
             ),
-            
+
             // Active flag to indicate that this event is available for registrations
             'active' => array (
                 'field'     => 'active',
@@ -158,7 +163,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                 'use'       => 'a',
                 'default'   => 0
             ),
-            
+
             // Registration requires attendees - Otherwise the person submitting the registration is the registrant
             'attendees' => array (
                 'field'     => 'attendees',
@@ -166,7 +171,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                 'use'       => 'a',
                 'default'   => 0
             ),
-            
+
             // Attendee limit - 0 = unlimited
             'attendee_max' => array (
                 'field'     => 'attendee_max',
@@ -174,7 +179,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
+
             // Maximum attendees per registration submission - 0 = unlimited
             'attendee_max_per_reg' => array (
                 'field'     => 'attendee_max_per_reg',
@@ -182,15 +187,25 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
-            // Last calculated attendee count
-            'attendee_count' => array (
-                'field'     => 'attendee_count',
+
+            // Registration hold in Minutes since last cart access - How log to hold an attendee slot in a cart that has not completed checkout
+            'reg_hold_minutes' => array (
+                'field'     => 'reg_hold_minutes',
                 'type'      => 'integer',
-                'required'  => false,
+                'required'  => true,
+                'default'   => 60,
+                'use'       => 'a'
+            ),
+
+            // Cart hold in days since last cart access - How long to retain a cart that has not checked and has had no access
+            'cart_hold_days' => array (
+                'field'     => 'cart_hold_days',
+                'type'      => 'integer',
+                'required'  => true,
+                'default'   => 10,
                 'use'       => 'a'
             ),
-            
+
             // Bitmap of how user accounts may be used for this event - See registration_account_option in plugin.ini
             'registration_account_options' => array (
                 'field' => 'registration_account_options',
@@ -199,7 +214,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                 'default'  => 0, // none selected
                 'use'      => 'a'
             ),
-            
+
             // Bitmap of payment methods available to users for this event - See payment_method in plugin.ini
             'payment_methods' => array (
                 'field' => 'payment_methods',
@@ -208,8 +223,8 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                 'default'  => 0, // none selected
                 'use'      => 'a'
             ),
-            
-            
+
+
             // Bitmap of restricted (admin use only) payment methods for this event - see payment_method
             'restricted_payment_methods' => array (
                 'field' => 'restricted_payment_methods',
@@ -218,7 +233,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                 'default'  => 0, // none selected
                 'use'      => 'a'
             ),
-            
+
             // Terms and Conditions for registration
             'terms' => array (
                 'field'     => 'terms',
@@ -226,7 +241,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
+
             // Name of a downloadable file
             'reg_file' => array (
                 'field'     => 'reg_file',
@@ -234,7 +249,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
+
             // Title for downloadable file
             'reg_file_title' => array (
                 'field'     => 'reg_file_title',
@@ -242,7 +257,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
+
             // Current MagicForm form revision
             'form_revision' => array (
                 'field'     => 'form_revision',
@@ -250,7 +265,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
+
             // System operator's notes for this event - Not visible to users
             'notes' => array (
                 'field'     => 'notes',
@@ -258,7 +273,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
+
         );
 
     }
diff --git a/classes/data/dataRegRate.php b/classes/data/dataRegRate.php
new file mode 100644 (file)
index 0000000..6c49032
--- /dev/null
@@ -0,0 +1,189 @@
+<?php
+/**
+ * GLM Member-DB WordPress Add-On Plugin
+ * Registrations Rate data class
+ *
+ * PHP version 5.3
+ *
+ * @category Data
+ * @package  GLM Member-DB
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @release  SVN: $Id: dataRegRate.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
+ */
+
+/**
+ * GlmDataRegistrationsRegRates class
+ *
+ * PHP version 5
+ *
+ * @category Data
+ * @package GLM Member DB
+ * @author  Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ *          @release SVN: $Id: dataRegRate.php,v 1.0 2011/01/25 19:31:47 cscott
+ *          Exp $
+ */
+class GlmDataRegistrationsRegRates extends GlmDataAbstract
+{
+
+    /**
+     * WordPress Database Object
+     *
+     * @var $wpdb
+     * @access public
+     */
+    public $wpdb;
+    /**
+     * Plugin Configuration Data
+     *
+     * @var $config
+     * @access public
+     */
+    public $config;
+    /**
+     * Data Table Name
+     *
+     * @var $table
+     * @access public
+     */
+    public $table;
+    /**
+     * Field definitions
+     *
+     * 'type' is type of field as defined by the application
+     * text Regular text field
+     * pointer Pointer to an entry in another table
+     * 'filters' is the filter name for a particular filter ID in PHP filter
+     * functions
+     * See PHP filter_id()
+     *
+     * 'use' is when to use the field
+     * l = List
+     * g = Get
+     * n = New
+     * i = Insert
+     * e = Edit
+     * u = Update
+     * d = Delete
+     * a = All
+     *
+     * @var $ini
+     * @access public
+     */
+    public $fields = false;
+
+    /**
+     * Constructor
+     *
+     * @param object $d database connection
+     * @param array $config Configuration array
+     * @param bool $limitedEdit Flag to say indicate limited edit requested
+     *
+     * @return void
+     * @access public
+     */
+    public function __construct($wpdb, $config, $limitedEdit = false)
+    {
+
+        // If this class is not being extended along with existing $wpdb and $config
+        if (!$this->wpdb) {
+
+            // Save WordPress Database object
+            $this->wpdb = $wpdb;
+
+            // Save plugin configuration object
+            $this->config = $config;
+
+        }
+
+        /*
+         * Table Name
+         */
+        $this->table = GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_rate';
+
+        /*
+         * Table Data Fields
+         */
+
+        $this->fields = array (
+
+            // ID
+            'id' => array (
+                'field'     => 'id',
+                'type'      => 'integer',
+                'view_only' => true,
+                'use'       => 'a'
+            ),
+
+            // Pointer to reg_event table
+            'reg_event' => array (
+                'field'     => 'reg_event',
+                'type'      => 'integer',
+                'required'  => true,
+                'use'       => 'lgneud'
+            ),
+
+            // Pointer to reg_class table
+            'reg_class' => array (
+                'field'     => 'reg_class',
+                'type'      => 'integer',
+                'required'  => true,
+                'use'       => 'lgneud'
+            ),
+
+            // Name of this rate
+            'name' => array (
+                'field'     => 'name',
+                'type'      => 'text',
+                'required'  => true,
+                'use'       => 'lgneud'
+            ),
+
+            // # of days before event time rate becomes available - may be entered as a date then coverted for storage
+            'start_days' => array (
+                'field'   => 'start_days',
+                'type'      => 'integer',
+                'required'  => false,
+                'use'       => 'a'
+            ),
+
+            // # of days before event time rate becomes available - may be entered as a date then coverted for storage
+            'end_days' => array (
+                'field'     => 'end_days',
+                'type'      => 'integer',
+                'required'  => false,
+                'use'       => 'a'
+            ),
+
+            // Base rate to register
+            'base_rate' => array (
+                'field'     => 'base_rate',
+                'type'      => 'money',
+                'required'  => false,
+                'use'       => 'a'
+            ),
+
+            // Rate per registrant
+            'per_registrant' => array (
+                'field'     => 'per_registrant',
+                'type'      => 'money',
+                'required'  => false,
+                'use'       => 'a'
+            ),
+
+            // Number of registrants included in base rate
+            'registrant_credits' => array (
+                'field'     => 'registrant_credits',
+                'type'      => 'integer',
+                'required'  => false,
+                'use'       => 'a'
+            ),
+
+        );
+
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/classes/data/dataRegRates.php b/classes/data/dataRegRates.php
deleted file mode 100644 (file)
index 5aa128a..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-<?php
-/**
- * GLM Member-DB WordPress Add-On Plugin
- * Registrations Added Info Fields data class
- *
- * PHP version 5.3
- *
- * @category Data
- * @package  GLM Member-DB
- * @author   Chuck Scott <cscott@gaslightmedia.com>
- * @license  http://www.gaslightmedia.com Gaslightmedia
- * @release  SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
- */
-
-/**
- * GlmDataRegistrationsAddedInfoFields class
- *
- * PHP version 5
- *
- * @category Data
- * @package GLM Member DB
- * @author  Chuck Scott <cscott@gaslightmedia.com>
- * @license http://www.gaslightmedia.com Gaslightmedia
- *          @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott
- *          Exp $
- */
-class GlmDataRegistrationsRegRates extends GlmDataAbstract
-{
-
-    /**
-     * WordPress Database Object
-     *
-     * @var $wpdb
-     * @access public
-     */
-    public $wpdb;
-    /**
-     * Plugin Configuration Data
-     *
-     * @var $config
-     * @access public
-     */
-    public $config;
-    /**
-     * Data Table Name
-     *
-     * @var $table
-     * @access public
-     */
-    public $table;
-    /**
-     * Field definitions
-     *
-     * 'type' is type of field as defined by the application
-     * text Regular text field
-     * pointer Pointer to an entry in another table
-     * 'filters' is the filter name for a particular filter ID in PHP filter
-     * functions
-     * See PHP filter_id()
-     *
-     * 'use' is when to use the field
-     * l = List
-     * g = Get
-     * n = New
-     * i = Insert
-     * e = Edit
-     * u = Update
-     * d = Delete
-     * a = All
-     *
-     * @var $ini
-     * @access public
-     */
-    public $fields = false;
-
-    /**
-     * Constructor
-     *
-     * @param object $d database connection
-     * @param array $config Configuration array
-     * @param bool $limitedEdit Flag to say indicate limited edit requested
-     *
-     * @return void
-     * @access public
-     */
-    public function __construct($wpdb, $config, $limitedEdit = false)
-    {
-
-        // If this class is not being extended along with existing $wpdb and $config
-        if (!$this->wpdb) {
-
-            // Save WordPress Database object
-            $this->wpdb = $wpdb;
-
-            // Save plugin configuration object
-            $this->config = $config;
-
-        }
-
-        /*
-         * Table Name
-         */
-        $this->table = GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_rates';
-
-        /*
-         * Table Data Fields
-         */
-
-        $this->fields = array (
-            
-            // ID
-            'id' => array (
-                'field'     => 'id',
-                'type'      => 'integer',
-                'view_only' => true,
-                'use'       => 'a'
-            ),
-            
-            // Pointer to reg_event table
-            'reg_event' => array (
-                'field'     => 'id',
-                'as'        => 'reg_event',
-                'type'      => 'pointer',
-                    'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_event',
-                    'p_field' => 'id',
-                    'p_static' => true,
-                'required'  => true,
-                'use'       => 'lgneud'
-            ),
-            
-            // Pointer to reg_class table
-            'reg_class' => array (
-                'field'     => 'id',
-                'as'        => 'reg_class',
-                'type'      => 'pointer',
-                    'p_table'   => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_class',
-                    'p_field'   => 'id',
-                    'p_static'  => true,
-                'required'  => true,
-                'use'       => 'lgneud'
-            ),
-            
-            // # of days before event time rate becomes available - may be entered as a date then coverted for storage
-            'start_days' => array (
-                'field'   => 'start_days',
-                'type'      => 'integer',
-                'required'  => false,
-                'use'       => 'a'
-            ),
-            
-            // # of days before event time rate becomes available - may be entered as a date then coverted for storage
-            'end_days' => array (
-                'field'     => 'end_days',
-                'type'      => 'integer',
-                'required'  => false,
-                'use'       => 'a'
-            ),
-            
-            // Base rate to register
-            'base_rate' => array (
-                'field'     => 'base_rate',
-                'type'      => 'money',
-                'required'  => false,
-                'use'       => 'a'
-            ),
-            
-            // Rate per registrant
-            'per_registrant' => array (
-                'field'     => 'per_registrant',
-                'type'      => 'money',
-                'required'  => false,
-                'use'       => 'a'
-            ),
-            
-            // Number of registrants included in base rate
-            'registrant_credits' => array (
-                'field'     => 'registrant_credits',
-                'type'      => 'integer',
-                'required'  => false,
-                'use'       => 'a'
-            ),
-            
-        );
-
-    }
-
-}
-
-?>
\ No newline at end of file
index 31ec304..56203d8 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * GLM Member-DB WordPress Add-On Plugin
- * Registrations Added Info Fields data class
+ * Registrations Request data class
  *
  * PHP version 5.3
  *
@@ -9,11 +9,11 @@
  * @package  GLM Member-DB
  * @author   Chuck Scott <cscott@gaslightmedia.com>
  * @license  http://www.gaslightmedia.com Gaslightmedia
- * @release  SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
+ * @release  SVN: $Id: dataRegRequest.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
  */
 
 /**
- * GlmDataRegistrationsAddedInfoFields class
+ * GlmDataRegistrationsRequest class
  *
  * PHP version 5
  *
  * @package GLM Member DB
  * @author  Chuck Scott <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
- *          @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott
+ *          @release SVN: $Id: dataRegRequest.php,v 1.0 2011/01/25 19:31:47 cscott
  *          Exp $
  */
-class GlmDataRegistrationRequest extends GlmDataAbstract
+class GlmDataRegistrationsRequest extends GlmDataAbstract
 {
 
     /**
index cb3b16b..af8768a 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * GLM Member-DB WordPress Add-On Plugin
- * Registrations Added Info Fields data class
+ * Registrations Request Class data class
  *
  * PHP version 5.3
  *
@@ -9,11 +9,11 @@
  * @package  GLM Member-DB
  * @author   Chuck Scott <cscott@gaslightmedia.com>
  * @license  http://www.gaslightmedia.com Gaslightmedia
- * @release  SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
+ * @release  SVN: $Id: dataRegRequestClass.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
  */
 
 /**
- * GlmDataRegistrationsAddedInfoFields class
+ * GlmDataRegistrationsRequestClass class
  *
  * PHP version 5
  *
@@ -21,7 +21,7 @@
  * @package GLM Member DB
  * @author  Chuck Scott <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
- *          @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott
+ *          @release SVN: $Id: dataRegRequestClass.php,v 1.0 2011/01/25 19:31:47 cscott
  *          Exp $
  */
 class GlmDataRegistrationsRequestClass extends GlmDataAbstract
@@ -107,7 +107,7 @@ class GlmDataRegistrationsRequestClass extends GlmDataAbstract
          */
 
         $this->fields = array (
-            
+
             // ID
             'id' => array (
                 'field'     => 'id',
@@ -115,67 +115,87 @@ class GlmDataRegistrationsRequestClass extends GlmDataAbstract
                 'view_only' => true,
                 'use'       => 'a'
             ),
-            
+
             // Pointer to account (person submitting the registration)
             'account' => array (
-                'field'     => 'contact_id',
-                'type'      => 'pointer',
-                    'p_table'   => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'account',
-                    'p_field'   => 'id',
-                    'p_static'  => true,
+                'field'     => 'account',
+                'type'      => 'integer',
                 'required'  => true,
                 'use'       => 'lgneud'
             ),
-            
+
             // Pointer to reg_event
             'event' => array (
                 'field'     => 'event',
-                'type'      => 'pointer',
-                    'p_table'   => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_event',
-                    'p_field'   => 'id',
-                    'p_static'  => true,
+                'type'      => 'integer',
+                'required'  => true,
+                'use'       => 'lgneud'
+            ),
+
+            // Event Name
+            'event_name' => array (
+                'field'     => 'event_name',
+                'type'      => 'text',
                 'required'  => true,
                 'use'       => 'lgneud'
             ),
-            
-            // Pointer to event_times table entry in Events add-on
+
+            // Pointer to times table entry in Events add-on
             'event_time' => array (
                 'field'     => 'event_time',
-                'type'      => 'pointer',
-                    'p_table'   => GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . 'event_times',
-                    'p_field'   => 'id',
-                    'p_static'  => true,
+                'type'      => 'integer',
+                'required'  => true,
+                'use'       => 'lgneud'
+            ),
+
+            // Selected Start Time
+            'event_datetime' => array (
+                'field'     => 'event_datetime',
+                'type'      => 'datetime',
                 'required'  => true,
                 'use'       => 'lgneud'
             ),
-            
+
             // Pointer to reg_request_event table
             'reg_request_event' => array (
                 'field'     => 'reg_request_event',
-                'type'      => 'pointer',
-                    'p_table'   => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request_event',
-                    'p_field'   => 'id',
-                    'p_static'  => true,
+                'type'      => 'integer',
+                'required'  => true,
+                'use'       => 'lgneud'
+            ),
+
+            // Pointer to reg_class table entry
+            'class' => array (
+                'field'     => 'class',
+                'type'      => 'integer',
+                'required'  => true,
+                'use'       => 'lgneud'
+            ),
+
+            // Class Name
+            'class_name' => array (
+                'field'     => 'class_name',
+                'type'      => 'text',
                 'required'  => true,
                 'use'       => 'lgneud'
             ),
-            
-            // Last calculated total of all charges for registration to this event for all registrants 
+
+            // Last calculated total of all charges for registration to this event for all registrants
             'total_class_charge' => array (
                 'field'     => 'total_class_charge',
                 'type'      => 'money',
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
-            // Any MagicForm data associated with requested event 
+
+            // Any MagicForm data associated with requested event
             'mf_data' => array (
                 'field'     => 'mf_data',
                 'type'      => 'text',
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
+
             // System operator's notes for this registration request
             'notes' => array (
                 'field'     => 'notes',
@@ -183,7 +203,7 @@ class GlmDataRegistrationsRequestClass extends GlmDataAbstract
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
+
         );
 
     }
index d87ff4e..4c4ad62 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * GLM Member-DB WordPress Add-On Plugin
- * Registrations Added Info Fields data class
+ * Registrations Request Event data class
  *
  * PHP version 5.3
  *
@@ -9,11 +9,11 @@
  * @package  GLM Member-DB
  * @author   Chuck Scott <cscott@gaslightmedia.com>
  * @license  http://www.gaslightmedia.com Gaslightmedia
- * @release  SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
+ * @release  SVN: $Id: dataRegRequestEvent.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
  */
 
 /**
- * GlmDataRegistrationsAddedInfoFields class
+ * GlmDataRegistrationsRequestEvent class
  *
  * PHP version 5
  *
  * @package GLM Member DB
  * @author  Chuck Scott <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
- *          @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott
+ *          @release SVN: $Id: dataRegRequestEvent.php,v 1.0 2011/01/25 19:31:47 cscott
  *          Exp $
  */
-class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract
+class GlmDataRegistrationsRequestEvent extends GlmDataAbstract
 {
 
     /**
@@ -115,59 +115,63 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract
                 'view_only' => true,
                 'use'       => 'a'
             ),
-            
+
             // Pointer to account (person submitting the registration)
             'account' => array (
-                'field'     => 'contact_id',
-                'type'      => 'pointer',
-                    'p_table'   => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'account',
-                    'p_field'   => 'id',
-                    'p_static'  => true,
+                'field'     => 'account',
+                'type'      => 'integer',
                 'required'  => true,
                 'use'       => 'lgneud'
             ),
-            
+
             // Pointer to reg_request table
             'reg_request' => array (
                 'field'     => 'reg_request',
-                'type'      => 'pointer',
-                    'p_table'   => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request',
-                    'p_field'   => 'id',
-                    'p_static'  => true,
+                'type'      => 'integer',
                 'required'  => true,
                 'use'       => 'lgneud'
             ),
-            
+
             // Pointer to reg_event
             'event' => array (
                 'field'     => 'event',
-                'type'      => 'pointer',
-                    'p_table'   => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_event',
-                    'p_field'   => 'id',
-                    'p_static'  => true,
+                'type'      => 'integer',
+                'required'  => true,
+                'use'       => 'lgneud'
+            ),
+
+            // Event Name
+            'event_name' => array (
+                'field'     => 'event_name',
+                'type'      => 'text',
                 'required'  => true,
                 'use'       => 'lgneud'
             ),
-            
-            // Pointer to event_times table entry in Events add-on
+
+            // Pointer to times table entry in Events add-on
             'event_time' => array (
                 'field'     => 'event_time',
-                'type'      => 'pointer',
-                    'p_table'   => GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . 'event_times',
-                    'p_field'   => 'id',
-                    'p_static'  => true,
+                'type'      => 'integer',
+                'required'  => true,
+                'use'       => 'lgneud'
+            ),
+
+            // Selected Start Time
+            'event_datetime' => array (
+                'field'     => 'event_datetime',
+                'type'      => 'datetime',
                 'required'  => true,
                 'use'       => 'lgneud'
             ),
-            
-            // Last calculated total of all charges for registration to this event for all registrants 
+
+            // Last calculated total of all charges for registration to this event for all registrants
             'total_charge' => array (
                 'field'     => 'total_charge',
                 'type'      => 'money',
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
+
             // System operator's notes for this registration request
             'notes' => array (
                 'field'     => 'notes',
@@ -175,14 +179,14 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract
                 'required'  => false,
                 'use'       => 'a'
             ),
-            // Any MagicForm data associated with requested event 
+            // Any MagicForm data associated with requested event
             'mf_data' => array (
                 'field'     => 'mf_data',
                 'type'      => 'text',
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
+
         );
 
     }
index dcfbc81..c0c8c7a 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * GLM Member-DB WordPress Add-On Plugin
- * Registrations Added Info Fields data class
+ * Registrations Request Event Rate data class
  *
  * PHP version 5.3
  *
@@ -9,11 +9,11 @@
  * @package  GLM Member-DB
  * @author   Chuck Scott <cscott@gaslightmedia.com>
  * @license  http://www.gaslightmedia.com Gaslightmedia
- * @release  SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
+ * @release  SVN: $Id: dataRegRequestRate.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
  */
 
 /**
- * GlmDataRegistrationsAddedInfoFields class
+ * GlmDataRegistrationsRegRequestRate class
  *
  * PHP version 5
  *
  * @package GLM Member DB
  * @author  Chuck Scott <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
- *          @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott
+ *          @release SVN: $Id: dataRegRequestRate.php,v 1.0 2011/01/25 19:31:47 cscott
  *          Exp $
  */
-class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract
+class GlmDataRegistrationsRegRequestRate extends GlmDataAbstract
 {
 
     /**
@@ -107,8 +107,8 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract
          */
 
         $this->fields = array (
-            
-            
+
+
             // ID
             'id' => array (
                 'field'     => 'id',
@@ -116,70 +116,87 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract
                 'view_only' => true,
                 'use'       => 'a'
             ),
-            
+
             // Pointer to account (person submitting the registration)
             'account' => array (
-                'field'     => 'contact_id',
-                'type'      => 'pointer',
-                    'p_table'   => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'account',
-                    'p_field'   => 'id',
-                    'p_static'  => true,
+                'field'     => 'account',
+                'type'      => 'integer',
                 'required'  => true,
                 'use'       => 'lgneud'
             ),
-            
+
             // Pointer to reg_event entry
             'event' => array (
                 'field'     => 'event',
-                'type'      => 'pointer',
-                    'p_table'   => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_event',
-                    'p_field'   => 'id',
-                    'p_static'  => true,
+                'type'      => 'integer',
+                'required'  => true,
+                'use'       => 'lgneud'
+            ),
+
+            // Event Name
+            'event_name' => array (
+                'field'     => 'event_name',
+                'type'      => 'text',
                 'required'  => true,
                 'use'       => 'lgneud'
             ),
-            
-            // Pointer to event_times table entry in Events add-on - To help with registrant searches
+
+            // Pointer to times table entry in Events add-on - To help with registrant searches
             'event_time' => array (
                 'field'     => 'event_time',
-                'type'      => 'pointer',
-                    'p_table'   => GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . 'event_times',
-                    'p_field'   => 'id',
-                    'p_static'  => true,
+                'type'      => 'integer',
+                'required'  => true,
+                'use'       => 'lgneud'
+            ),
+
+            // Selected Start Time
+            'event_datetime' => array (
+                'field'     => 'event_datetime',
+                'type'      => 'datetime',
                 'required'  => true,
                 'use'       => 'lgneud'
             ),
-            
+
             // Pointer to reg_request_event table entry
             'reg_request_event' => array (
                 'field'     => 'reg_request_event',
-                'type'      => 'pointer',
-                    'p_table'   => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request_event',
-                    'p_field'   => 'id',
-                    'p_static'  => true,
+                'type'      => 'integer',
                 'required'  => true,
                 'use'       => 'lgneud'
             ),
-            
+
             // Pointer to reg_request_class table entry
             'reg_request_class' => array (
                 'field'     => 'reg_request_class',
-                'type'      => 'pointer',
-                    'p_table'   => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request_class',
-                    'p_field'   => 'id',
-                    'p_static'  => true,
+                'type'      => 'integer',
+                'required'  => true,
+                'use'       => 'lgneud'
+            ),
+
+            // Pointer to reg_rate table entry
+            'rate' => array (
+                'field'     => 'rate',
+                'type'      => 'integer',
                 'required'  => true,
                 'use'       => 'lgneud'
             ),
-            
+
+            // Rate Name
+            'rate_name' => array (
+                'field'     => 'rate_name',
+                'type'      => 'text',
+                'required'  => true,
+                'use'       => 'lgneud'
+            ),
+
             // Base rate at time of registration
-            'rate_base' => array (
-                'field'     => 'rate_base',
+            'base_rate' => array (
+                'field'     => 'base_rate',
                 'type'      => 'money',
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
+
             // Per Registrant Rate at time of registration
             'per_registrant' => array (
                 'field'     => 'per_registrant',
@@ -187,7 +204,7 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
+
             // Number of registrant credits in base rate at time of registration
             'registrant_credits' => array (
                 'field'     => 'registrant_credits',
@@ -195,7 +212,7 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
+
             // Last calculated number of registrants with this rate
             'numb_registrants' => array (
                 'field'     => 'numb_registrants',
@@ -203,7 +220,7 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
+
             // Per Registrant Rate at time of registration
             'total_registrant_charges' => array (
                 'field'     => 'total_registrant_charges',
@@ -211,7 +228,7 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
+
             // Any MagicForm data associated with registrant
             'mf_data' => array (
                 'field'     => 'mf_data',
@@ -219,7 +236,7 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
+
             // System operator's notes for this registration request
             'notes' => array (
                 'field'     => 'notes',
@@ -227,7 +244,7 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
+
         );
 
     }
index a8561fd..6af8dde 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * GLM Member-DB WordPress Add-On Plugin
- * Registrations Added Info Fields data class
+ * Registrations Request Registrant data class
  *
  * PHP version 5.3
  *
@@ -9,11 +9,11 @@
  * @package  GLM Member-DB
  * @author   Chuck Scott <cscott@gaslightmedia.com>
  * @license  http://www.gaslightmedia.com Gaslightmedia
- * @release  SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
+ * @release  SVN: $Id: dataRegRequestRegistrant.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
  */
 
 /**
- * GlmDataRegistrationsAddedInfoFields class
+ * GlmDataRegistrationsRequestRegistrant class
  *
  * PHP version 5
  *
  * @package GLM Member DB
  * @author  Chuck Scott <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
- *          @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott
+ *          @release SVN: $Id: dataRegRequestRegistrant.php,v 1.0 2011/01/25 19:31:47 cscott
  *          Exp $
  */
-class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract
+class GlmDataRegistrationsRequestRegistrant extends GlmDataAbstract
 {
 
     /**
@@ -107,7 +107,7 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract
          */
 
         $this->fields = array (
-           
+
             // ID
             'id' => array (
                 'field'     => 'id',
@@ -115,84 +115,102 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract
                 'view_only' => true,
                 'use'       => 'a'
             ),
-            
+
             // Pointer to account for person submitting the registration
             'account' => array (
-                'field'     => 'contact_id',
-                'type'      => 'pointer',
-                    'p_table'   => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'account',
-                    'p_field'   => 'id',
-                    'p_static'  => true,
+                'field'     => 'account',
+                'type'      => 'integer',
                 'required'  => true,
                 'use'       => 'lgneud'
             ),
-            
+
             // Pointer to reg_event entry
             'event' => array (
                 'field'     => 'event',
-                'type'      => 'pointer',
-                    'p_table'   => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_event',
-                    'p_field'   => 'id',
-                    'p_static'  => true,
+                'type'      => 'integer',
+                'required'  => true,
+                'use'       => 'lgneud'
+            ),
+
+            // Event Name
+            'event_name' => array (
+                'field'     => 'event_name',
+                'type'      => 'text',
                 'required'  => true,
                 'use'       => 'lgneud'
             ),
-            
-            // Pointer to event_times table entry in Events add-on - To help with registrant searches
+
+            // Pointer to times table entry in Events add-on - To help with registrant searches
             'event_time' => array (
                 'field'     => 'event_time',
-                'type'      => 'pointer',
-                    'p_table'   => GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . 'event_times',
-                    'p_field'   => 'id',
-                    'p_static'  => true,
+                'type'      => 'integer',
+                'required'  => true,
+                'use'       => 'lgneud'
+            ),
+
+            // Selected Start Time
+            'event_datetime' => array (
+                'field'     => 'event_datetime',
+                'type'      => 'datetime',
                 'required'  => true,
                 'use'       => 'lgneud'
             ),
-            
+
             // Pointer to reg_request_event table entry
             'reg_request_event' => array (
                 'field'     => 'reg_request_event',
-                'type'      => 'pointer',
-                    'p_table'   => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request_event',
-                    'p_field'   => 'id',
-                    'p_static'  => true,
+                'type'      => 'integer',
                 'required'  => true,
                 'use'       => 'lgneud'
             ),
-            
+
             // Pointer to reg_request_class table entry
             'reg_request_class' => array (
                 'field'     => 'reg_request_class',
-                'type'      => 'pointer',
-                    'p_table'   => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request_class',
-                    'p_field'   => 'id',
-                    'p_static'  => true,
+                'type'      => 'integer',
                 'required'  => true,
                 'use'       => 'lgneud'
             ),
-            
+
             // Pointer to reg_request_rate table entry
             'reg_request_rate' => array (
                 'field'     => 'reg_request_rate',
-                'type'      => 'pointer',
-                    'p_table'   => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request_rate',
-                    'p_field'   => 'id',
-                    'p_static'  => true,
+                'type'      => 'integer',
                 'required'  => true,
                 'use'       => 'lgneud'
             ),
-            
+
             // Pointer to account for registrant (person attending) - Not needed if registrants are off for the event
             'reg_request_registrant' => array (
                 'field'     => 'reg_request_registrant',
-                'type'      => 'pointer',
-                    'p_table'   => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request_registrant',
-                    'p_field'   => 'id',
-                    'p_static'  => true,
+                'type'      => 'integer',
+                'required'  => true,
+                'use'       => 'lgneud'
+            ),
+
+            // First Name of registrant
+            'reg_request_hold' => array (
+                'field'     => 'reg_request_hold',
+                'type'      => 'checkbox',
+                'use'       => 'lgneud'
+            ),
+
+            // First Name of registrant
+            'fname' => array (
+                'field'     => 'fname',
+                'type'      => 'text',
+                'required'  => true,
+                'use'       => 'lgneud'
+            ),
+
+            // Last Name
+            'lname' => array (
+                'field'     => 'lname',
+                'type'      => 'text',
                 'required'  => true,
                 'use'       => 'lgneud'
             ),
-                        
+
             // Any MagicForm data associated with registrant
             'mf_data' => array (
                 'field'     => 'mf_data',
@@ -200,7 +218,7 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
+
             // System operator's notes for this registration request
             'notes' => array (
                 'field'     => 'notes',
@@ -208,7 +226,7 @@ class GlmDataRegistrationsAddedInfoFields extends GlmDataAbstract
                 'required'  => false,
                 'use'       => 'a'
             ),
-            
+
         );
 
     }
index 817353a..58351f4 100644 (file)
  * @link     http://dev.gaslightmedia.com/
  */
 
-/*
- * This class provides some standard methods used by this plugin
- */
+// Load required data classes for registration events
+require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
+require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegClass.php';
+require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRate.php';
+
+// Load required data classes for registration requests
+require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataAccount.php';
+require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequest.php';
+require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequestEvent.php';
+require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequestClass.php';
+require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequestRate.php';
+require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequestRegistrant.php';
+
 class GlmRegistrationsSupport
 {
 
@@ -34,6 +44,13 @@ class GlmRegistrationsSupport
      * @access public
      */
     public $config;
+    /**
+     * Registration Request Cart
+     *
+     * $var $cart
+     * @access public
+     */
+    public $cart = false;
 
     /**
      * Constructor
@@ -64,81 +81,144 @@ class GlmRegistrationsSupport
     /*
      * Retrieve a complete cart
      *
+     * Structure of returned data
+     *
+     * array (
+     *      status
+     *      errorMsg
+     *      notes
+     *      accounts        Array of accounts associated with this cart, both for the person submitting and those being registered - Index is account ID
+     *      request         Array of base request data - If no submission account yet, that value is false
+     *      events          Array of events requested
+     *          classes         Array of registration classes being requested
+     *              rates           Array of rates selected for this event class
+     *                 registrants      Array of registrants selected for this rate - Also points to account for registrants in "accounts" array above
+     *
+     * )
+     *
      * @param integer $requestID
      *
      * @return array Array of request and all associated information or false
      * @access public
      */
-    public function getRegistrationCart($requestID = false)
+    public function getRegistrationCart($requestId = false)
     {
 
-        // Create return data array
-        $cart = array(
+        // Clear cart data
+        $this->cart = array(
             'status'        => false,           // Return status, default to false, true if valid request returned
             'errorMsg'      => '',              // Any applicable error message
             'notes'         => array(),         // System generated notes regarding status of request
             'accounts'      => array(),         // Accounts associated with this request - both requesting and attending (might be the same)
                                                 // Index in this array is the account ID as used in data below
-            'request'       => false,           // Request reccord
-            'events'        => false            // Array of events with 'class', 'rate', 'registrant' data under each event
+            'request'       => false,           // Base request record
+            'events'        => array()         // List of events requested
         );
 
         // Validate request ID
-        if (!$requestID || ($requestID-0) <= 0) {
+        if (!$requestId || ($requestId-0) <= 0) {
             return false;
         }
 
-        /*
-         * Base registration request
-         */
+        // Try to get the base registration request data
+        $RegRequest = new GlmDataRegistrationsRequest($this->wpdb, $this->config);
+        $this->cart['request'] = $RegRequest->getEntry($requestId);
+        if (!$this->cart['request']) {
+            $this->cart['errorMsg'] = 'Unable to retrieve the requested registration request.';
+            return $this->cart;
+        }
 
-        // Load Registration Requests data abstract
-        require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequest.php';
-        $RegRequest = new GlmDataRegistrationRequest($this->wpdb, $this->config);
+        // Add submitting account if not guest submission (at this point)
+        $this->addAccountToCart($this->cart['request']['account']);
 
-        // Try to get the base registration request data
-        $cart['request'] = $RegRequest->getEntry($requestID);
+        // Get list of events being requested
+        $RequestEvent = new GlmDataRegistrationsRequestEvent($this->wpdb, $this->config);
+        $this->cart['events'] = $RequestEvent->getList("T.reg_request =  $requestId");
 
-        if (!$cart['request']) {
-            $cart['errorMsg'] = 'Unable to retrieve the requested registration request.';
-            return $cart;
-        }
+        // For each event
+        if ($this->cart['events']) {
+            foreach ($this->cart['events'] as $eventKey => $event) {
 
-        /*
-         * Registration requested by
-         */
+                // Get list of event classes requested for this event
+                $RequestClass = new GlmDataRegistrationsRequestClass($this->wpdb, $this->config);
+                $this->cart['events'][$eventKey]['classes'] = $RequestClass->getList("T.reg_request =  $requestId");
 
-        // Load Registration Requests data abstract
-        require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataAccount.php';
-        $Account = new GlmDataRegistrationsAccount($this->wpdb, $this->config);
+                // For each class selected for this event
+                if ($this->cart['events'][$eventKey]['classes']) {
+                    foreach ($this->cart['events'][$eventKey]['classes'] as $classKey => $class) {
 
-        // Try to get the account record for the person who submitted (is submitting) the request
-        if ($cart['request']['account']) {
+                        // Get list of rates requested for this class
+                        $RequestRate = new GlmDataRegistrationsRegRequestRate($this->wpdb, $this->config);
+                        $this->cart['events'][$eventKey]['classes'][$classKey]['rates'] = $RequestRate->getList("T.reg_request =  $requestId");
+
+                        // For each rate selected for this class
+                        if ($this->cart['events'][$eventKey]['classes'][$classKey]['rates']) {
+                            foreach ($this->cart['events'][$eventKey]['classes'][$classKey]['rates'] as $rateKey => $rate) {
+
+                                // Get list of registrants requested for this rate
+                                $RequestRegistrant = new GlmDataRegistrationsRequestRegistrant($this->wpdb, $this->config);
+                                $this->cart['events'][$eventKey]['classes'][$classKey]['rates'][$rateKey]['registrants'] = $RequestRegistrant->getList("T.reg_request =  $requestId");
 
-            // Get the the account ID of the person who submitted the request
-            $accountID = ($cart['request']['account'] - 0);
+                                // For each rate selected for this class
+                                if ($this->cart['events'][$eventKey]['classes'][$classKey]['rates'][$rateKey]['registrants']) {
+                                    foreach ($this->cart['events'][$eventKey]['classes'][$classKey]['rates'][$rateKey]['registrants'] as $registrantKey => $registrant) {
 
-            // Make sure it's a positive integer
-            if (is_int($accountID) && $accountID > 0) {
+                                        // Add registrant account to accounts table
+                                        $this->addAccountToCart($registrant['account']);
 
-                // Try to get account information
-                $account = $Account->getEntry($accountID);
+                                    } // Each Registrant
+                                }
 
-                // If we found a good account, add that to the accounts list in the cart.
-                if ($account) {
-                    $cart['accounts'][$account['id']] = $account;
-                } else {
-                    $cart['notes'][] = 'Registration request does not have an account for the person submitting the request. (Guest registration?)';
+                            } // Each Rate
+                        }
+
+
+                    } // Each Class
                 }
 
-            }
 
+            } // Each Event
         }
 
-        return $cart;
+        return $this->cart;
 
     }
 
+    /*
+     * Add an account to the accounts list if not already there
+     *
+     *
+     * @param integer $accountId
+     *
+     * @return boolean Success or fail
+     * @access public
+     */
+    public function addAccountToCart($accountId)
+    {
+
+        // Check the supplied account ID
+        $accountId = ($accountId-0);
+        if ($accountId == 0) {
+            return false;
+        }
+
+        // Try to get the account record for the person who submitted (is submitting) the request
+        $Account = new GlmDataRegistrationsAccount($this->wpdb, $this->config);
+        $account = $Account->getEntry($accountId);
+
+        // If account was not found
+        if (!$account) {
+            return false;
+        }
+
+        // If the account doesn't exist in the accounts array, add it
+        if (!isset($this->cart['accounts'][$accountId])) {
+            $this->cart['accounts'][$account['id']] = $account;
+        }
+
+        return true;
+
+    }
 
     /*
      *  Add temporary test data
@@ -164,17 +244,31 @@ class GlmRegistrationsSupport
     public function addTestData()
     {
 
+        // Grab the first event from the events database
+        $sql = "SELECT id, name FROM ".GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX."events LIMIT 1";
+        $event = $this->wpdb->get_results($sql, ARRAY_A);
+        $eventId = $event[0]['id'];
+        $eventName = $event[0]['name'];
+
+        // Grab the first time from this event
+        $sql = "SELECT id, start_time FROM ".GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX."times WHERE event = $eventId LIMIT 1";
+        $time = $this->wpdb->get_results($sql, ARRAY_A);
+        $timeId = $event[0]['id'];
+        $eventTime = $time[0]['start_time'];
+
         // Event
         $sql = "
             INSERT INTO ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_event
                 (
                 event,
+                event_name,
                 event_code,
                 active
                 )
                 VALUES
                 (
-                0,
+                $eventId,
+                '$eventName',
                 'TEST-EVENT',
                 true
                 )
@@ -200,12 +294,13 @@ class GlmRegistrationsSupport
         $this->wpdb->query($sql);
         $regClassID = $this->wpdb->insert_id;
 
-        // Event Registration Rates
+        // Event Registration Rate
         $sql = "
-            INSERT INTO ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_rates
+            INSERT INTO ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_rate
                 (
                 reg_event,
                 reg_class,
+                name,
                 start_days,
                 end_days,
                 base_rate,
@@ -216,6 +311,7 @@ class GlmRegistrationsSupport
                 (
                 $regEventID,
                 $regClassID,
+                'Rate Name',
                 100,
                 50,
                 20,
@@ -306,8 +402,6 @@ class GlmRegistrationsSupport
         $this->wpdb->query($sql);
         $requestID = $this->wpdb->insert_id;
 
-// **** NEED TO RECHECK EVERYTHING FROM HERE DOWN ****
-
         // Registration Request Event
         $sql = "
             INSERT INTO ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_request_event
@@ -315,7 +409,9 @@ class GlmRegistrationsSupport
                 account,
                 reg_request,
                 event,
+                event_name,
                 event_time,
+                event_datetime,
                 total_charge,
                 mf_data,
                 notes
@@ -325,7 +421,9 @@ class GlmRegistrationsSupport
                 $accountID,
                 $requestID,
                 $regEventID,
-                0,
+                '$eventName',
+                $timeId,
+                '$eventTime',
                 100,
                 '',
                 ''
@@ -340,9 +438,13 @@ class GlmRegistrationsSupport
                 (
                 account,
                 event,
+                event_name,
                 event_time,
+                event_datetime,
                 reg_request,
                 reg_request_event,
+                class,
+                class_name,
                 total_class_charge,
                 mf_data,
                 notes
@@ -351,9 +453,13 @@ class GlmRegistrationsSupport
                 (
                 $accountID,
                 $regEventID,
-                0,
+                '$eventName',
+                $timeId,
+                '$eventTime',
                 $requestID,
                 $requestEventID,
+                0,
+                'Class Name',
                 100,
                 '',
                 ''
@@ -369,10 +475,14 @@ class GlmRegistrationsSupport
                 (
                 account,
                 event,
+                event_name,
                 event_time,
+                event_datetime,
                 reg_request,
                 reg_request_event,
                 reg_request_class,
+                rate,
+                rate_name,
                 base_rate,
                 per_registrant,
                 registrant_credits,
@@ -385,10 +495,14 @@ class GlmRegistrationsSupport
                 (
                 $accountID,
                 $regEventID,
-                0,
+                '$eventName',
+                $timeId,
+                '$eventTime',
                 $requestID,
                 $requestEventID,
                 $requestClassID,
+                0,
+                'Rate Name',
                 100,
                 10,
                 1,
@@ -408,12 +522,16 @@ class GlmRegistrationsSupport
                 (
                 account,
                 event,
+                event_name,
                 event_time,
+                event_datetime,
                 reg_request,
                 reg_request_event,
                 reg_request_class,
                 reg_request_rate,
                 reg_request_registrant,
+                fname,
+                lname,
                 mf_data,
                 notes
                 )
@@ -421,12 +539,16 @@ class GlmRegistrationsSupport
                 (
                 $accountID,
                 $regEventID,
-                0,
+                '$eventName',
+                $timeId,
+                '$eventTime',
                 $requestID,
                 $requestEventID,
                 $requestClassID,
                 $requestRateID,
                 $accountID,
+                'First',
+                'Last',
                 '',
                 ''
                 )
@@ -438,11 +560,11 @@ class GlmRegistrationsSupport
 
     }
 
-    public function removeRegistrationRequestData($testIDs)
+    public function removeRegistrationRequestData()
     {
         $this->wpdb->query("DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_event;");
         $this->wpdb->query("DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_class;");
-        $this->wpdb->query("DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_rates;");
+        $this->wpdb->query("DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_rate;");
         $this->wpdb->query("DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."account;");
         $this->wpdb->query("DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_request;");
         $this->wpdb->query("DELETE FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_request_event;");
index 25e2ffe..a8d5b61 100644 (file)
--- a/index.php
+++ b/index.php
@@ -38,7 +38,7 @@
  *  version from this plugin.
  */
 define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_VERSION', '0.0.1');
-define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_VERSION', '0.0.2');
+define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_VERSION', '0.0.6');
 
 // This is the minimum version of the GLM Members DB plugin require for this plugin.
 define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '2.8.0');
index b67f3cb..aad096c 100644 (file)
@@ -16,7 +16,7 @@
 // Load Registration Requests data abstract
 require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequest.php';
 
-class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationRequest
+class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationsRequest
 {
 
     /**
@@ -157,14 +157,14 @@ class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationRequest
         }
 
 // Temporary debug info
-$cart_r = print_r($requestCart,1);
+//$cart_r = print_r($requestCart,1);
 
         // Compile template data
         $templateData = array(
             'haveRequests'  => $haveRequests,
             'requests'      => $requests,
             'haveRequest'   => $haveRequest,
-            'requestCart'   => $requestCart,
+            'cart'          => $requestCart,
             'errorMsg'      => $errorMsg,
 
             'cart_r'        => $cart_r
diff --git a/setup/databaseScripts/create_database_V0.0.2.sql b/setup/databaseScripts/create_database_V0.0.2.sql
deleted file mode 100644 (file)
index d2c3a72..0000000
+++ /dev/null
@@ -1,763 +0,0 @@
--- Gaslight Media Registration Database
--- File Created: 01/18/2017 14:40:00
--- Database Version: 0.0.3
--- Database Creation Script
---
--- To permit each query below to be executed separately,
--- all queries must be separated by a line with four dashes
---
-/*
- * General Database Organization
- * -----------------------------
- * 
- * management - General options and configuration - Site manager access only
- * 
- * misc - Misc settings and text - Site owner may update 
- * 
- * Magic Forms Tables
- *      magicforms - Forms
- *          --> Event, Registration, Rate Class, Account, Registrant 
- *      mf_data - Data submitted to a form
- *          --> Submission, Event Registration, Rate Class selected, Account, Registrant 
- *      mf_temp_file - Temporary file meta-data
- * 
- * added_info_fields - Additional fields
- *      added_info_data - Submitted additional field data 
- *          --> added_info_fields
- * 
- * payment codes - Promotional payment codes - Used with various things
- *      --> Event, Submission, Event Registration, Event Registrant, Account or global
- * 
- * reg_event - Describes registration for that event
- *      reg_class - Type of registration for this event (one or more)
- *          reg_rates - Date range / rate for a reg class (one or more)
- *              
- * reg_account - Describes someone who submits / pays for a registration
- * Make these two things the same table....
- * registrant - A person who is registered for an event
- * 
- * reg_request - Information on a specific request for registrations
- *      reg_request_event - Event selected (one or more)
- *          reg_request_class - Class of registration (one or more)
- *              reg_request_rate - Specific registration date/rate (one or more)
- *                  reg_request_registrant - Registrant (one or more)
- * 
- * 
- * Overall Flow
- * ------------
- *
- * User selects an event
- * If the event has available registrations
- *  User selects a date for the registration (or if only one that's selected automatically)
- *    User can log back into registrations at this point if they've been there before and have a password, create an account, or continue as guest ???
- *      User selects an available rate type and adds one or more registrants for that rate type
- *      User may loop back to select additional rate type(s) and registrants
- *    User may go back to date selection and request additional rate types and registrants for the addional dates
- *  User may go back to select additional dates and do registrations for those dates as above
- * User may go back to select other events and do registrations for them as above
- * User may select the "Cart" and deselect something added to it
- * User may checkout
- *
- */
-
-/*
- * NOTE: Anything below here may not be completed or accurate yet. I'm still working though this
- * Lines commented out are selected for possible deletion.
- * The INSERT statements are not up-to-date with the tables.
- * The "config/plugin.ini" file in this plugin is also a work in progress.
- */
-
--- Management Options
--- General configurationm parameters for the Registrations application
--- Only one entry in this table!
-CREATE TABLE {prefix}management (
-    id INT NOT NULL AUTO_INCREMENT,
-    canonical_reg_page TINYTEXT NULL,                           -- Canonical page slug for registrations
-    -- System Owner Information
-    reg_org_name TINYTEXT NULL,                                     -- Customer Information - Name of Organization
-    reg_org_short TINYTEXT NULL,
-    reg_org_address TINYTEXT NULL,
-    reg_org_city TINYTEXT NULL,
-    reg_org_state TINYTEXT NULL,
-    reg_org_zip TINYTEXT NULL,
-    reg_org_phone TINYTEXT NULL,
-    reg_org_toll_free TINYTEXT NULL,
-    reg_org_internal_email TINYTEXT NULL,
-    reg_org_from_email TINYTEXT NULL,
-    reg_payment_methods SMALLINT NULL,                               -- Payment methods available for all registrations - Bitmap - see payment_method in plugin.ini
-    reg_proc_methods SMALLINT NULL,                                  -- Payment processing methods available - Bitmap - see proc_method in plugin.ini
-    reg_cc_accepts SMALLINT NULL,                                   -- Credit Cards Accepted - Bitmap - See credit_card in plugin.ini
-    -- Authorize.net Credentials
-    reg_authorize_net_login TINYTEXT NULL,
-    reg_authorize_net_key TINYTEXT NULL,
-    reg_authorize_net_test TINYINT NULL,                            -- Authorize.net test mode - List - see proc_test_mode in plugin.ini
-    reg_authorize_net_conf BOOLEAN NULL,                            -- Flag to send payment confirmation Email from Authorize.net            
-    reg_authorize_net_merchant_email TINYTEXT NULL,                 -- E-Mail Authorize.net will send copy of confirmation E-Mail
-    -- Merchant Solutions Credentials
-    reg_merchant_solutions_acctid TINYTEXT NULL,                    -- Merchant Solutions credentials
-    reg_merchant_solutions_merchantpin TINYTEXT NULL,
-    reg_merchant_solutions_test TINYINT NULL,                       -- Merchant Solutions test mode - List - see proc_test_mode in plugin.ini
-    -- Billing settings    
-    reg_full_billing_info BOOLEAN NULL,                             -- Always request full billing information in checkout page regardless of the following settings
-    reg_bill_info_req_no_charge SMALLINT NULL,                       -- Bitmap of fields to use in checkout for these types of payments - See billing_field in plugin.conf
-    reg_bill_info_req_comp_code SMALLINT NULL,     
-    reg_bill_info_req_cash SMALLINT NULL,          
-    reg_bill_info_req_check SMALLINT NULL,         
-    reg_bill_info_req_credit_card SMALLINT NULL,   
-    reg_bill_info_req_merchant_call SMALLINT NULL, 
-    -- Misc Options
-    reg_medical_info BOOLEAN NULL,                                  -- This site can ask for "Medical Info" - set in main category of an event
-    PRIMARY KEY (id)
-);
-
-----
-
--- Terms used in site modifiable on Management page in admin - Only 1 entry in this table
--- Terms in this table should be all self-explanatory
-CREATE TABLE {prefix}settings_terms (
-    id INT NOT NULL AUTO_INCREMENT,
-    reg_term_registrations_name TINYTEXT NULL,                      -- Term "Event Registration"
-    reg_term_registration TINYTEXT NULL,
-    reg_term_registration_cap TINYTEXT NULL,
-    reg_term_registration_plur TINYTEXT NULL,
-    reg_term_registration_plur_cap TINYTEXT NULL,
-    reg_term_register TINYTEXT NULL,
-    reg_term_register_cap TINYTEXT NULL,
-    reg_term_registers TINYTEXT NULL,                               -- Intransitive verb of register
-    reg_term_registering TINYTEXT NULL,
-    reg_term_registering_cap TINYTEXT NULL,
-    reg_term_registered TINYTEXT NULL,
-    reg_term_registered_cap TINYTEXT NULL,
-    reg_term_attendee TINYTEXT NULL,
-    reg_term_attendee_cap TINYTEXT NULL,
-    reg_term_attendee_plur TINYTEXT NULL,
-    reg_term_attendee_plur_cap TINYTEXT NULL,
-    reg_term_attending TINYTEXT NULL,
-    reg_term_attended TINYTEXT NULL,
-    reg_term_registered_user TINYTEXT NULL,
-    reg_term_registered_user_cap TINYTEXT NULL,
-    reg_term_registered_user_plur TINYTEXT NULL,
-    reg_term_registered_user_plur_cap TINYTEXT NULL,
-    reg_term_id TINYTEXT NULL,
-    reg_term_id_cap TINYTEXT NULL,
-    reg_term_id_plur TINYTEXT NULL,
-    reg_term_id_plur_cap TINYTEXT NULL,
-    reg_term_password TINYTEXT NULL,
-    reg_term_password_cap TINYTEXT NULL,
-    reg_term_password_plur TINYTEXT NULL,
-    reg_term_password_plur_cap TINYTEXT NULL,
-    reg_term_instructor TINYTEXT NULL,
-    reg_term_instructor_cap TINYTEXT NULL,
-    reg_term_instructor_plur TINYTEXT NULL,
-    reg_term_instructor_plur_cap TINYTEXT NULL,
-    reg_term_payment_code TINYTEXT NULL,
-    reg_term_payment_code_cap TINYTEXT NULL,
-    reg_term_payment_code_plur TINYTEXT NULL,
-    reg_term_payment_code_plur_cap TINYTEXT NULL,
-    reg_term_registration_button TINYTEXT NULL,
-    reg_term_contact_information TINYTEXT NULL,
-    PRIMARY KEY (id)
-);
-
-----
-
--- Misc system-wide customer configurable configuration
--- Various text and flags to be configured by customer
--- Only one entry in this table!
-CREATE TABLE {prefix}misc (
-    id INT NOT NULL AUTO_INCREMENT,
-    reg_bulletin TEXT NULL,                                     -- Text to display at top of first registration page
-    cart_page_text TEXT NULL,                                   -- Text to display at top of cart page
-    checkout_page_text TEXT NULL,                               -- Text to display at top of checkout page
-    summary_page_text TEXT NULL,                                -- Text to display at top of summary page (after checkout)
-    reg_terms TEXT NULL,                                        -- Registration terms and conditions
-    notify_subject TEXT NULL,                                   -- Subject of notification E-Mail to site owner
-    notify_text TEXT NULL,                                      -- Notification E-Mail text for site owner
-    instr_notify_subject TEXT NULL,                             -- Subject of notification E-Mail to instructor
-    instr_notify_text TEXT NULL,                                -- Notification E-Mail text for instructor
-    submission_notify_subject TEXT NULL,                        -- Subject of notification E-Mail to person submitting the registrations
-    submission_notify_text TEXT NULL,                           -- Notification E-Mail text to person submitting the registrations
-    registrant_notify_subject TEXT NULL,                        -- Subject of notification E-Mail to registrant
-    registrant_notify_text TEXT NULL,                           -- Text of notification E-Mail to registrant
-    submission_ack_subject TEXT NULL,                           -- Subject of acknowledgement E-Mail to person submitting the registrations
-    submission_ack_text TEXT NULL,                              -- Text of acknowledgement E-Mail text to person submitting the registrations
-    registrant_ack_subject TEXT NULL,                           -- Subject of acknowledgement E-Mail to registrant
-    registrant_ack_text TEXT NULL,                              -- Text of acknowledgement E-Mail to registrant
-    PRIMARY KEY (id)
-);
-
-----
-
--- Additional fields for collecting information for various things - submission, event registration, or registrant
--- Related to the registration submission or specific event registration
-CREATE TABLE {prefix}added_info_fields (
-    id INT NOT NULL AUTO_INCREMENT,
-    ref_type TINYINT NULL,                                      -- See data_ref_type table in plugin.ini 
-    ref_dest INT NULL,                                          -- Pointer to the specific entity of ref_type - (not user submitted data record)
-    name TINYTEXT NULL,                                         -- Displayed field prompt - also used on retrieval of data
-    description TINYTEXT NULL,                                  -- Description of field - possibly to display to user
-    PRIMARY KEY (id),
-    INDEX (ref_dest)
-);
-
-----
-
--- Additional field data for various specific things
-CREATE TABLE {prefix}added_info_data (
-    id INT NOT NULL AUTO_INCREMENT,
-    added_info_field INT NULL,                                  -- Pointer to added_info_field table
-    ref_type TINYINT NULL,                                      -- See data ref_type table in plugin.ini
-    ref_dest INT NULL,                                          -- Pointer to specific entryt of the correct type (user submitted data record)
-    field_value TINYTEXT NULL,                                  
-    PRIMARY KEY (id),
-    INDEX (ref_dest)
-);
-
-
-----
-
--- magicform
-CREATE TABLE {prefix}magicform (
-    id INT NOT NULL AUTO_INCREMENT,
-    form_id TINYTEXT NULL,
-    custom_id TINYTEXT NULL,
-    title TINYTEXT NULL,
-    type SMALLINT NULL,
-    descr TEXT NULL,
-    active BOOLEAN NULL,
-    required BOOLEAN NULL,
-    data1 TINYTEXT NULL,
-    sort SMALLINT NULL,
-    expanded BOOLEAN NULL,
-    style TEXT NULL,
-    file TINYTEXT NULL,
-    cols INT NULL,
-    rows INT NULL,
-    size TINYTEXT NULL,
-    format TINYTEXT NULL,
-    default_val TINYTEXT NULL,
-    PRIMARY KEY (id),
-    INDEX(form_id(20))
-);
-
-----
-
--- mf_data
-CREATE TABLE {prefix}mf_data (
-    id INT NOT NULL AUTO_INCREMENT,
-    fiid INT NULL,
-    form_id TINYTEXT NULL,
-    field_id TINYTEXT NULL,
-    level TINYTEXT NULL,
-    title TINYTEXT NULL,
-    type INT NULL,
-    txt_type TEXT NULL,
-    value TEXT NULL,
-    numb_value DOUBLE PRECISION NULL,
-    txt_value TEXT NULL,
-    opt_num INT NULL,
-    valid BOOLEAN NULL,
-    required BOOLEAN NULL,
-    failure TEXT NULL,
-    PRIMARY KEY (id),
-    INDEX(form_id(20)),
-    INDEX(fiid)
-);
-
-----
-
--- mf_temp_file
-CREATE TABLE {prefix}mf_temp_file (
-    id INT NOT NULL AUTO_INCREMENT,
-    file_name TINYTEXT NULL,
-    upload_time DATE NULL,
-    PRIMARY KEY (id),
-    INDEX(file_name(20)),
-    INDEX(upload_time)
-);
-
-----
-
--- Payment Codes
--- Promotional payment codes for free/discounted payment
-CREATE TABLE {prefix}payment_code (
-    id INT NOT NULL AUTO_INCREMENT,
-    code_type TINYINT NULL,                                     -- Type of adjustment - Free only to start with - See pay_code_type in plugin.ini
-    ref_type TINYINT NULL,                                      -- See payment_ref_type in plugin.ini
-    ref_dest INT NULL,                                          -- Pointer to the specific entity of ref_type
-    code TINYTEXT NULL,                                         -- Text code user must enter to use 
-    amount FLOAT,                                               -- Amount of discount if not type "Free" - Either $ amount or percent
-    descr TEXT NULL, 
-    PRIMARY KEY (id),
-    INDEX (ref_dest),
-    INDEX (code(10))
-);
-
-----
-
--- Registration event specific information
--- One record for each event in Events add-on
--- Only created when selecting registrations for a particular event in the Events add-on
-CREATE TABLE {prefix}reg_event (
-    id INT NOT NULL AUTO_INCREMENT,
-    event INT NULL,                                             -- Pointer to event in Events add-on
-    event_code TINYTEXT NULL,                                   -- A short code used to reference this event - can be used to directly select an event to register for
-    notify_email TINYTEXT NULL,                                 -- E-Mail addresses to recieve notification of a registration other than org_internal_email in management, comma separated
-    admin_active BOOLEAN NULL,                                  -- Active flag for admin from Events - If false, then does not show as a link from events to manage event. Still shows in registrations admin
-    active BOOLEAN NULL,                                        -- Active flag to indicate that this event is available for registrations
-    attendees BOOLEAN NULL,                                     -- Registration requires attendees - Otherwise the person submitting the registration is the registrant
-    attendee_max MEDIUMINT NULL,                                -- Attendee limit - 0 = unlimited
-    attendee_max_per_reg TINYINT NULL,                          -- Maximum attendees per registration submission - 0 = unlimited
-    attendee_count MEDIUMINT NULL,                              -- Last calculated attendee count
-    registration_account_options SMALLINT NULL,                  -- Bitmap of how user accounts may be used for this event - See registration_account_option in plugin.ini
-    payment_methods SMALLINT NULL,                               -- Bitmap of payment methods available to users for this event - See payment_method in plugin.ini
-    restricted_payment_methods SMALLINT NULL,                    -- Bitmap of restricted (admin use only) payment methods for this event - see payment_method
-    terms TEXT NULL,                                            -- Terms and Conditions for registration
-    reg_file TINYTEXT NULL,                                     -- Name of a downloadable file
-    reg_file_title TINYTEXT NULL,                               -- Title for downloadable file
-    form_revision SMALLINT NULL,                                -- Current MagicForm form revision
-    notes TEXT NULL,                                            -- System operator's notes for this event - Not visible to users
-    PRIMARY KEY (id),
-    INDEX (event),
-    INDEX (event_code(10))
-);
-
-----
-
--- Registration Class - Type of registration for a specific event - Equates to "Rate Options" in the old system
--- One or more for each event
-CREATE TABLE {prefix}reg_class (
-    id INT NOT NULL AUTO_INCREMENT,
-    reg_event INT NULL,                                         -- Pointer to reg_event table
-    name TINYTEXT NULL,                                         -- Name of this registration type
-    descr TEXT NULL,                                            -- Description
-    PRIMARY KEY (id),
-    INDEX (reg_event)
-);
-
-----
-
--- Rates and dates for a particular reg_class
--- One or more per reg_class - **** Days should not overlap for a particular reg_class
-CREATE TABLE {prefix}reg_rates (
-    id INT NOT NULL AUTO_INCREMENT,
-    reg_event INT NULL,                                         -- Pointer to reg_event table
-    reg_class INT NULL,                                         -- Pointer to reg_class table
-    start_days INT NULL,                                        -- # of days before event time rate becomes available - may be entered as a date then coverted for storage
-    end_days INT NULL,                                          -- # of days before event time rate becomes unavailable
-    base_rate FLOAT,                                            -- Base rate to register
-    per_registrant FLOAT,                                       -- Rate per registrant
-    registrant_credits TINYINT NULL,                            -- Number of registrants included in base rate
-    PRIMARY KEY (id),
-    INDEX (reg_event),
-    INDEX (reg_class)
-);
-
-----
-
--- An account for a person submitting a registration or a registrant for an event
--- Depending on the use of these entries may not have all data included
--- A single account may be referenced as a person submitting registrations and/or a person registered for an event
-CREATE TABLE {prefix}account (
-    id INT NOT NULL AUTO_INCREMENT,
-    active BOOLEAN NULL,                                        -- Is active flag (may be accessed or used) - default is true
-    registered_by INT NULL,                                     -- Account
-    member_id TINYTEXT NULL,                                    -- Free-form field for a member ID (not a GLM Associate member ID)
-    fname TINYTEXT NULL,                                        -- Account primary address
-    lname TINYTEXT NULL,
-    org TINYTEXT NULL,
-    title TINYTEXT NULL,
-    addr1 TINYTEXT NULL,
-    addr2 TINYTEXT NULL,
-    city TINYTEXT NULL,
-    state TINYTEXT NULL,
-    zip TINYTEXT NULL,
-    country TINYTEXT NULL,
-    phone TINYTEXT NULL,
-    fax TINYTEXT NULL,
-    bill_fname TINYTEXT NULL,                                   -- Last used billing information - Also stored in each registration request
-    bill_lname TINYTEXT NULL,
-    bill_org TINYTEXT NULL,
-    bill_title TINYTEXT NULL,
-    bill_addr1 TINYTEXT NULL,
-    bill_addr2 TINYTEXT NULL,
-    bill_city TINYTEXT NULL,
-    bill_state TINYTEXT NULL,
-    bill_zip TINYTEXT NULL,
-    bill_country TINYTEXT NULL,
-    bill_phone TINYTEXT NULL,
-    bill_fax TINYTEXT NULL,
-    email TINYTEXT NULL,
-    password TINYTEXT NULL,                                     -- Crypted password for login back into this account
-    email_ok BOOLEAN NULL,
-    is_member BOOLEAN NULL,                                     -- Is a member of the entity that owns the site
-    contact_id INT NULL,                                        -- Pointer to GLM Associate member contact record if account is for a member contact
-    contact_fname TINYTEXT NULL,
-    contact_lname TINYTEXT NULL,
-    contact_org TINYTEXT NULL,
-    contact_title TINYTEXT NULL,
-    contact_addr1 TINYTEXT NULL,
-    contact_addr2 TINYTEXT NULL,
-    contact_city TINYTEXT NULL,
-    contact_state TINYTEXT NULL,
-    contact_zip TINYTEXT NULL,
-    contact_country TINYTEXT NULL,
-    contact_phone TINYTEXT NULL,
-    contact_fax TINYTEXT NULL,
-    contact_email TINYTEXT NULL,
-    contact_email_ok BOOLEAN NULL,
-    guardian TINYTEXT NULL,
-    emer_contact TINYTEXT NULL,
-    emer_phone TINYTEXT NULL,
-    med_history TINYTEXT NULL,
-    allergy_med TINYTEXT NULL,
-    date_created DATE NULL,
-    notes TEXT NULL,                                            -- System operator's notes for this account - not visible to account owner
-    user_trace_info TINYTEXT NULL,                              -- IP Address of user computer and timestamp of last update
-    PRIMARY KEY (id),
-    INDEX (registered_by),
-    INDEX (member_id(10)),
-    INDEX (fname(10)),
-    INDEX (lname(10)),
-    INDEX (org(10)),
-    INDEX (city(10)),
-    INDEX (state(5)),
-    INDEX (zip(5)),
-    INDEX (email(10)),
-    INDEX (contact_id)    
-);
-
-----
-
--- A request for registration
--- Has one or more reg_detail records associated with it
-CREATE TABLE {prefix}reg_request (
-    id INT NOT NULL AUTO_INCREMENT,
-    account INT NULL,                                           -- Pointer to user account (reg_account) who submitted the registrations
-    bill_fname TINYTEXT NULL,                                   -- Billing information used for this registration submission - Updates account billing address - Kept here for each request
-    bill_lname TINYTEXT NULL,
-    bill_org TINYTEXT NULL,
-    bill_title TINYTEXT NULL,
-    bill_addr1 TINYTEXT NULL,
-    bill_addr2 TINYTEXT NULL,
-    bill_city TINYTEXT NULL,
-    bill_state TINYTEXT NULL,
-    bill_zip TINYTEXT NULL,
-    bill_country TINYTEXT NULL,
-    date_submitted DATE NULL,
-    pay_method INT NULL,                                        -- See payment_method in plugin.ini
-    payment_code TINYTEXT NULL,                                 -- Payment_code (code text) - if submitted and validated
-    status SMALLINT NULL,                                       -- See submission_status in plugin.ini
-    total DOUBLE PRECISION NULL,                                -- Total charge including all fees and taxes
-    cc_type TINYINT NULL,                                       -- Credit Card type (if used) - See credit_card in plugin.ini
-    cc_name TINYTEXT NULL,
-    cc_numb TINYTEXT NULL,
-    cc_exp TINYTEXT NULL,
-    cc_cvv TINYTEXT NULL,
-    cc_conf TINYTEXT NULL,                                      -- Confirmation code back from card processor
-    summary TEXT NULL,                                          -- HTML summary of cart contents, costs and payment - Use same HTML displayed to user
-    mf_data TEXT NULL,                                          -- Any MagicForm data associated with registrant
-    notes TEXT NULL,                                            -- System operator's notes for this registration request
-    user_trace_info TINYTEXT NULL,                              -- IP Address of user computer and timestamp
-    PRIMARY KEY (id),
-    INDEX (account),
-    INDEX (date_submitted)
-);
-
-----
-
--- Registration for a specific event
--- Has one or more reg_selected_rate records associated with it
-CREATE TABLE {prefix}reg_request_event (
-    id INT NOT NULL AUTO_INCREMENT,
-    account INT NULL,                                           -- Pointer to account (person submitting the registration)
-    reg_request INT NULL,                                       -- Pointer to reg_request table
-    event INT NULL,                                             -- Pointer to reg_event
-    event_time INT NULL,                                        -- Pointer to event_times table entry in Events add-on
-    total_charge FLOAT,                                         -- Last calculated total of all charges for registration to this event for all registrants 
-    mf_data TEXT NULL,                                          -- Any MagicForm data associated with requested event
-    notes TEXT NULL,                                            -- System operator's notes for this registration request
-    PRIMARY KEY (id),
-    INDEX (reg_request),
-    INDEX (account),
-    INDEX (event),
-    INDEX (event_time)
-);
-
-----
-
---  A particular reg_class selected
---  Has one or more reg_request_rate records associated with it
-CREATE TABLE {prefix}reg_request_class (
-    id INT NOT NULL AUTO_INCREMENT,
-    account INT NULL,                                           -- Pointer to account (person submitting the registration)
-    event INT NULL,                                             -- Pointer to reg_event entry
-    event_time INT NULL,                                        -- Pointer to event_times table entry in Events add-on - To help with registrant searches
-    reg_request INT NULL,                                       -- Pointer to the registration request record
-    reg_request_event INT NULL,                                 -- Pointer to reg_request_event table entry
-    total_class_charge FLOAT,                                   -- Last calculated total of all charges for this registration class for this request 
-    mf_data TEXT NULL,                                          -- Any MagicForm data associated with registrant
-    notes TEXT NULL,                                            -- System operator's notes for this registration request
-    PRIMARY KEY (id),
-    INDEX (account),
-    INDEX (event),
-    INDEX (event_time),
-    INDEX (reg_request_event)
-);
-
-----
-
---  A particular reg_rate selected
---  Has one or more reg_request_registrant records associated with it
-CREATE TABLE {prefix}reg_request_rate (
-    id INT NOT NULL AUTO_INCREMENT,
-    account INT NULL,                                           -- Pointer to account (person submitting the registration)
-    event INT NULL,                                             -- Pointer to reg_event entry
-    event_time INT NULL,                                        -- Pointer to event_times table entry in Events add-on - To help with registrant searches
-    reg_request INT NULL,                                       -- Pointer to the registration request record
-    reg_request_event INT NULL,                                 -- Pointer to reg_request_event table entry
-    reg_request_class INT NULL,                                 -- Pointer to reg_request_class table entry
-    base_rate FLOAT,                                            -- Base rate at time of registration
-    per_registrant FLOAT,                                       -- Per Registrant Rate at time of registration
-    registrant_credits TINYINT NULL,                            -- Number of registrant credits in base rate at time of registration
-    numb_registrants TINYINT NULL,                              -- Last calculated number of registrants with this rate
-    total_registrant_charges FLOAT,                             -- Last calculation registrant charges assoicated with this selected rate
-    mf_data TEXT NULL,                                          -- Any MagicForm data associated with registrant
-    notes TEXT NULL,                                            -- System operator's notes for this registration request
-    PRIMARY KEY (id),
-    INDEX (account),
-    INDEX (event),
-    INDEX (event_time),
-    INDEX (reg_request_event),
-    INDEX (reg_request_class)
-);
-
-----
-
---  A specific registrant for a selected registration rate
-CREATE TABLE {prefix}reg_request_registrant (
-    id INT NOT NULL AUTO_INCREMENT,
-    account INT NULL,                                           -- Pointer to account for person submitting the registration
-    event INT NULL,                                             -- Pointer to reg_event entry
-    event_time INT NULL,                                        -- Pointer to event_times table entry in Events add-on - To help with registrant searches
-    reg_request INT NULL,                                       -- Pointer to the registration request record
-    reg_request_event INT NULL,                                 -- Pointer to reg_request_event table entry
-    reg_request_class INT NULL,                                 -- Pointer to reg_request_class table entry
-    reg_request_rate INT NULL,                                  -- Pointer to reg_request_rate table entry
-    reg_request_registrant INT NULL,                            -- Pointer to account for registrant (person attending) - Not needed if registrants are off for the event
-    mf_data TEXT NULL,                                          -- Any MagicForm data associated with registrant
-    notes TEXT NULL,                                            -- System operator's notes for this registration request
-    PRIMARY KEY (id),
-    INDEX (account),
-    INDEX (event),
-    INDEX (event_time),
-    INDEX (reg_request),
-    INDEX (reg_request_event),
-    INDEX (reg_request_class),
-    INDEX (reg_request_rate),
-    INDEX (reg_request_registrant)
-);
-
-----
-
--- Insert into management table
-INSERT INTO {prefix}management
-    (
-    canonical_reg_page,
-    reg_org_name,
-    reg_org_short,
-    reg_org_address,
-    reg_org_city,
-    reg_org_state,
-    reg_org_zip,
-    reg_org_phone,
-    reg_org_toll_free,
-    reg_org_internal_email,
-    reg_org_from_email,
-    reg_payment_methods,
-    reg_proc_methods,
-    reg_cc_accepts,
-    reg_authorize_net_login,
-    reg_authorize_net_key,
-    reg_authorize_net_test,
-    reg_authorize_net_conf,
-    reg_authorize_net_merchant_email,
-    reg_merchant_solutions_acctid,
-    reg_merchant_solutions_merchantpin,
-    reg_merchant_solutions_test,
-    reg_full_billing_info,
-    reg_bill_info_req_no_charge,
-    reg_bill_info_req_comp_code,
-    reg_bill_info_req_cash,
-    reg_bill_info_req_check,
-    reg_bill_info_req_credit_card,
-    reg_bill_info_req_merchant_call,
-    reg_medical_info
-    )
-    VALUES
-    (
-    'registrations',                                            -- reg_canonical_reg_page,
-    'Gaslight Media',                                           -- reg_org_name,
-    'GLM',                                                      -- reg_org_short,
-    '120 E. Lake St.',                                          -- reg_org_address,
-    'Petoskey',                                                 -- reg_org_city,
-    'MI',                                                       -- reg_org_state,
-    '49770',                                                    -- reg_org_zip,
-    '231-487-0692',                                             -- reg_org_phone,
-    '800-123-1234',                                             -- reg_org_toll_free,
-    'internal@gaslightmedia.com',                               -- reg_org_internal_email,
-    'info@gaslightmedia.com',                                   -- reg_org_from_email,
-    0,                                                          -- reg_payment_methods,
-    0,                                                          -- reg_proc_methods,
-    0,                                                          -- reg_cc_accepts,
-    '',                                                         -- reg_authorize_net_login,
-    '',                                                         -- reg_authorize_net_key,
-    1,                                                          -- reg_authorize_net_test,
-    true,                                                       -- reg_authorize_net_conf
-    '',                                                         -- reg_authorize_net_merchant_email,
-    '',                                                         -- reg_merchant_solutions_acctid,
-    '',                                                         -- reg_merchant_solutions_merchantpin,
-    1,                                                          -- reg_merchant_solutions_test, 
-    true,                                                       -- reg_full_billing_info,
-    0,                                                          -- reg_bill_info_req_no_charge,
-    0,                                                          -- reg_bill_info_req_comp_code,
-    0,                                                          -- reg_bill_info_req_cash,
-    0,                                                          -- reg_bill_info_req_check,
-    0,                                                          -- reg_bill_info_req_credit_card,
-    0,                                                          -- reg_bill_info_req_merchant_call,
-    true                                                        -- reg_medical_info,
-    );
-
-----
-
--- Insert into settings_terms table
-INSERT INTO {prefix}settings_terms
-    (
-    reg_term_registrations_name,
-    reg_term_registration,
-    reg_term_registration_cap,
-    reg_term_registration_plur,
-    reg_term_registration_plur_cap,
-    reg_term_register,
-    reg_term_register_cap,
-    reg_term_registers,
-    reg_term_registering,
-    reg_term_registering_cap,
-    reg_term_registered,
-    reg_term_registered_cap,
-    reg_term_attendee,
-    reg_term_attendee_cap,
-    reg_term_attendee_plur,
-    reg_term_attendee_plur_cap,
-    reg_term_attending,
-    reg_term_attended,
-    reg_term_registered_user,
-    reg_term_registered_user_cap,
-    reg_term_registered_user_plur,
-    reg_term_registered_user_plur_cap,
-    reg_term_id,
-    reg_term_id_cap,
-    reg_term_id_plur,
-    reg_term_id_plur_cap,
-    reg_term_password,
-    reg_term_password_cap,
-    reg_term_password_plur,
-    reg_term_password_plur_cap,
-    reg_term_instructor,
-    reg_term_instructor_cap,
-    reg_term_instructor_plur,
-    reg_term_instructor_plur_cap,
-    reg_term_payment_code,
-    reg_term_payment_code_cap,
-    reg_term_payment_code_plur,
-    reg_term_payment_code_plur_cap,
-    reg_term_registration_button,
-    reg_term_contact_information
-    )
-    VALUES
-    (
-    'Event Registrations',                                      -- reg_term_registrations_name
-    'registration',                                             -- reg_term_registration
-    'Registration',                                             -- reg_term_registration_cap
-    'registrations',                                            -- reg_term_registration_plur
-    'Registrations',                                            -- reg_term_registration_plur_cap
-    'register',                                                 -- reg_term_registe
-    'Register',                                                 -- reg_term_register_cap
-    'registers',                                                -- reg_term_registers
-    'registering',                                              -- reg_term_registering
-    'Registering',                                              -- reg_term_registering_cap
-    'registered',                                               -- reg_term_registered
-    'Registered',                                               -- reg_term_registered_cap
-    'attendee',                                                 -- reg_term_attendee
-    'Attendee',                                                 -- reg_term_attendee_cap
-    'attendees',                                                -- reg_term_attendee_plur
-    'Attendees',                                                -- reg_term_attendee_plur_cap
-    'attending',                                                -- reg_term_attending
-    'attended',                                                 -- reg_term_attended
-    'user',                                                     -- reg_term_registered_user
-    'User',                                                     -- reg_term_registered_user_cap
-    'users',                                                    -- reg_term_registered_user_plur
-    'Users',                                                    -- reg_term_registered_user_plur_cap
-    'ID',                                                       -- reg_term_id
-    'ID',                                                       -- reg_term_id_cap
-    'IDs',                                                      -- reg_term_id_plur
-    'IDs',                                                      -- reg_term_id_plur_cap
-    'password',                                                 -- reg_term_password
-    'passwords',                                                -- reg_term_password_cap
-    'Password',                                                 -- reg_term_password_plur
-    'Passwords',                                                -- reg_term_password_plur_cap
-    'instructor',                                               -- reg_term_instructor
-    'Instructor',                                               -- reg_term_instructor_cap
-    'instructors',                                              -- reg_term_instructor_plur
-    'Instructors',                                              -- reg_term_instructor_plur_cap
-    'payment code',                                             -- reg_term_payment_code
-    'Payment code',                                             -- reg_term_payment_code_cap
-    'payment codes',                                            -- reg_term_payment_code_plur
-    'Payment codes',                                            -- reg_term_payment_code_plur_cap
-    'Register for Event',                                       -- reg_term_registration_button
-    'Contact Information'                                       -- reg_term_contact_information
-    );
-    
-----
-
--- Insert into misc table
-INSERT INTO {prefix}misc
-    (
-    reg_bulletin,
-    cart_page_text,
-    checkout_page_text,
-    summary_page_text,
-    reg_terms,
-    notify_subject,
-    notify_text,
-    instr_notify_subject,
-    instr_notify_text,
-    submission_notify_subject,
-    submission_notify_text,
-    registrant_notify_subject,
-    registrant_notify_text,
-    submission_ack_subject,
-    submission_ack_text,
-    registrant_ack_subject,
-    registrant_ack_text
-    )
-    VALUES
-    (
-    'Registration Bulletin Text',
-    'Text for top of Cart Page',
-    'Text for top of Checkout Page',
-    'Text for top of Summary Page',
-    'Terms and Conditions',
-    'Subject of notification to site owner of a registration',
-    'Text of notification to site owner of a registration',
-    'Subject of notification to instructor of registration',
-    'Text for notification to instructor of registration',
-    'Subject of notification to person submitting registration',
-    'Text of notification to person submitting registration',
-    'Subject for notification to registrant',
-    'Text for notification to registrant',
-    'Subject of acknowledgement to person submitting registration',
-    'Text of acknowledgement to person submitting registration',
-    'Subject of acknowledgement to registrant',
-    'Text of acknowledgement to registrant'
-    );
diff --git a/setup/databaseScripts/create_database_V0.0.6.sql b/setup/databaseScripts/create_database_V0.0.6.sql
new file mode 100644 (file)
index 0000000..5a9b410
--- /dev/null
@@ -0,0 +1,811 @@
+-- Gaslight Media Registration Database
+-- File Created: 01/18/2017 14:40:00
+-- Database Version: 0.0.3
+-- Database Creation Script
+--
+-- To permit each query below to be executed separately,
+-- all queries must be separated by a line with four dashes
+--
+/*
+ * General Database Organization
+ * -----------------------------
+ * 
+ * management - General options and configuration - Site manager access only
+ * 
+ * misc - Misc settings and text - Site owner may update 
+ * 
+ * Magic Forms Tables
+ *      magicforms - Forms
+ *          --> Event, Registration, Rate Class, Account, Registrant 
+ *      mf_data - Data submitted to a form
+ *          --> Submission, Event Registration, Rate Class selected, Account, Registrant 
+ *      mf_temp_file - Temporary file meta-data
+ * 
+ * added_info_fields - Additional fields
+ *      added_info_data - Submitted additional field data 
+ *          --> added_info_fields
+ * 
+ * payment codes - Promotional payment codes - Used with various things
+ *      --> Event, Submission, Event Registration, Event Registrant, Account or global
+ * 
+ * reg_event - Describes registration for that event
+ *      reg_time - One record for each date/time this event has people registered - Primarily tracks attendee counts and charge totals 
+ *      reg_class - Type of registration for this event (one or more)
+ *          reg_rates - Date range / rate for a reg class (one or more)
+ *              
+ * reg_account - Describes someone who submits / pays for a registration
+ * Make these two things the same table....
+ * registrant - A person who is registered for an event
+ * 
+ * reg_request - Information on a specific request for registrations
+ *      reg_request_event - Event selected (one or more)
+ *          reg_request_class - Class of registration (one or more)
+ *              reg_request_rate - Specific registration date/rate (one or more)
+ *                  reg_request_registrant - Registrant (one or more)
+ * 
+ * 
+ * Overall Flow
+ * ------------
+ *
+ * User selects an event
+ * If the event has available registrations
+ *  User selects a date for the registration (or if only one that's selected automatically)
+ *    User can log back into registrations at this point if they've been there before and have a password, create an account, or continue as guest ???
+ *      User selects an available rate type and adds one or more registrants for that rate type
+ *      User may loop back to select additional rate type(s) and registrants
+ *    User may go back to date selection and request additional rate types and registrants for the addional dates
+ *  User may go back to select additional dates and do registrations for those dates as above
+ * User may go back to select other events and do registrations for them as above
+ * User may select the "Cart" and deselect something added to it
+ * User may checkout
+ *
+ */
+
+/*
+ * NOTE: Anything below here may not be completed or accurate yet. I'm still working though this
+ * Lines commented out are selected for possible deletion.
+ * The INSERT statements are not up-to-date with the tables.
+ * The "config/plugin.ini" file in this plugin is also a work in progress.
+ */
+
+-- Management Options
+-- General configurationm parameters for the Registrations application
+-- Only one entry in this table!
+CREATE TABLE {prefix}management (
+    id INT NOT NULL AUTO_INCREMENT,
+    canonical_reg_page TINYTEXT NULL,                           -- Canonical page slug for registrations
+    -- System Owner Information
+    reg_org_name TINYTEXT NULL,                                     -- Customer Information - Name of Organization
+    reg_org_short TINYTEXT NULL,
+    reg_org_address TINYTEXT NULL,
+    reg_org_city TINYTEXT NULL,
+    reg_org_state TINYTEXT NULL,
+    reg_org_zip TINYTEXT NULL,
+    reg_org_phone TINYTEXT NULL,
+    reg_org_toll_free TINYTEXT NULL,
+    reg_org_internal_email TINYTEXT NULL,
+    reg_org_from_email TINYTEXT NULL,
+    reg_payment_methods SMALLINT NULL,                               -- Payment methods available for all registrations - Bitmap - see payment_method in plugin.ini
+    reg_proc_methods SMALLINT NULL,                                  -- Payment processing methods available - Bitmap - see proc_method in plugin.ini
+    reg_cc_accepts SMALLINT NULL,                                   -- Credit Cards Accepted - Bitmap - See credit_card in plugin.ini
+    -- Authorize.net Credentials
+    reg_authorize_net_login TINYTEXT NULL,
+    reg_authorize_net_key TINYTEXT NULL,
+    reg_authorize_net_test TINYINT NULL,                            -- Authorize.net test mode - List - see proc_test_mode in plugin.ini
+    reg_authorize_net_conf BOOLEAN NULL,                            -- Flag to send payment confirmation Email from Authorize.net            
+    reg_authorize_net_merchant_email TINYTEXT NULL,                 -- E-Mail Authorize.net will send copy of confirmation E-Mail
+    -- Merchant Solutions Credentials
+    reg_merchant_solutions_acctid TINYTEXT NULL,                    -- Merchant Solutions credentials
+    reg_merchant_solutions_merchantpin TINYTEXT NULL,
+    reg_merchant_solutions_test TINYINT NULL,                       -- Merchant Solutions test mode - List - see proc_test_mode in plugin.ini
+    -- Billing settings    
+    reg_full_billing_info BOOLEAN NULL,                             -- Always request full billing information in checkout page regardless of the following settings
+    reg_bill_info_req_no_charge SMALLINT NULL,                       -- Bitmap of fields to use in checkout for these types of payments - See billing_field in plugin.conf
+    reg_bill_info_req_comp_code SMALLINT NULL,     
+    reg_bill_info_req_cash SMALLINT NULL,          
+    reg_bill_info_req_check SMALLINT NULL,         
+    reg_bill_info_req_credit_card SMALLINT NULL,   
+    reg_bill_info_req_merchant_call SMALLINT NULL, 
+    -- Misc Options
+    reg_medical_info BOOLEAN NULL,                                  -- This site can ask for "Medical Info" - set in main category of an event
+    PRIMARY KEY (id)
+);
+
+----
+
+-- Terms used in site modifiable on Management page in admin - Only 1 entry in this table
+-- Terms in this table should be all self-explanatory
+CREATE TABLE {prefix}settings_terms (
+    id INT NOT NULL AUTO_INCREMENT,
+    reg_term_registrations_name TINYTEXT NULL,                      -- Term "Event Registration"
+    reg_term_registration TINYTEXT NULL,
+    reg_term_registration_cap TINYTEXT NULL,
+    reg_term_registration_plur TINYTEXT NULL,
+    reg_term_registration_plur_cap TINYTEXT NULL,
+    reg_term_register TINYTEXT NULL,
+    reg_term_register_cap TINYTEXT NULL,
+    reg_term_registers TINYTEXT NULL,                               -- Intransitive verb of register
+    reg_term_registering TINYTEXT NULL,
+    reg_term_registering_cap TINYTEXT NULL,
+    reg_term_registered TINYTEXT NULL,
+    reg_term_registered_cap TINYTEXT NULL,
+    reg_term_attendee TINYTEXT NULL,
+    reg_term_attendee_cap TINYTEXT NULL,
+    reg_term_attendee_plur TINYTEXT NULL,
+    reg_term_attendee_plur_cap TINYTEXT NULL,
+    reg_term_attending TINYTEXT NULL,
+    reg_term_attended TINYTEXT NULL,
+    reg_term_registered_user TINYTEXT NULL,
+    reg_term_registered_user_cap TINYTEXT NULL,
+    reg_term_registered_user_plur TINYTEXT NULL,
+    reg_term_registered_user_plur_cap TINYTEXT NULL,
+    reg_term_id TINYTEXT NULL,
+    reg_term_id_cap TINYTEXT NULL,
+    reg_term_id_plur TINYTEXT NULL,
+    reg_term_id_plur_cap TINYTEXT NULL,
+    reg_term_password TINYTEXT NULL,
+    reg_term_password_cap TINYTEXT NULL,
+    reg_term_password_plur TINYTEXT NULL,
+    reg_term_password_plur_cap TINYTEXT NULL,
+    reg_term_instructor TINYTEXT NULL,
+    reg_term_instructor_cap TINYTEXT NULL,
+    reg_term_instructor_plur TINYTEXT NULL,
+    reg_term_instructor_plur_cap TINYTEXT NULL,
+    reg_term_payment_code TINYTEXT NULL,
+    reg_term_payment_code_cap TINYTEXT NULL,
+    reg_term_payment_code_plur TINYTEXT NULL,
+    reg_term_payment_code_plur_cap TINYTEXT NULL,
+    reg_term_registration_button TINYTEXT NULL,
+    reg_term_contact_information TINYTEXT NULL,
+    PRIMARY KEY (id)
+);
+
+----
+
+-- Misc system-wide customer configurable configuration
+-- Various text and flags to be configured by customer
+-- Only one entry in this table!
+CREATE TABLE {prefix}misc (
+    id INT NOT NULL AUTO_INCREMENT,
+    reg_bulletin TEXT NULL,                                     -- Text to display at top of first registration page
+    cart_page_text TEXT NULL,                                   -- Text to display at top of cart page
+    checkout_page_text TEXT NULL,                               -- Text to display at top of checkout page
+    summary_page_text TEXT NULL,                                -- Text to display at top of summary page (after checkout)
+    reg_terms TEXT NULL,                                        -- Registration terms and conditions
+    notify_subject TEXT NULL,                                   -- Subject of notification E-Mail to site owner
+    notify_text TEXT NULL,                                      -- Notification E-Mail text for site owner
+    instr_notify_subject TEXT NULL,                             -- Subject of notification E-Mail to instructor
+    instr_notify_text TEXT NULL,                                -- Notification E-Mail text for instructor
+    submission_notify_subject TEXT NULL,                        -- Subject of notification E-Mail to person submitting the registrations
+    submission_notify_text TEXT NULL,                           -- Notification E-Mail text to person submitting the registrations
+    registrant_notify_subject TEXT NULL,                        -- Subject of notification E-Mail to registrant
+    registrant_notify_text TEXT NULL,                           -- Text of notification E-Mail to registrant
+    submission_ack_subject TEXT NULL,                           -- Subject of acknowledgement E-Mail to person submitting the registrations
+    submission_ack_text TEXT NULL,                              -- Text of acknowledgement E-Mail text to person submitting the registrations
+    registrant_ack_subject TEXT NULL,                           -- Subject of acknowledgement E-Mail to registrant
+    registrant_ack_text TEXT NULL,                              -- Text of acknowledgement E-Mail to registrant
+    PRIMARY KEY (id)
+);
+
+----
+
+-- Additional fields for collecting information for various things - submission, event registration, or registrant
+-- Related to the registration submission or specific event registration
+CREATE TABLE {prefix}added_info_fields (
+    id INT NOT NULL AUTO_INCREMENT,
+    ref_type TINYINT NULL,                                      -- See data_ref_type table in plugin.ini 
+    ref_dest INT NULL,                                          -- Pointer to the specific entity of ref_type - (not user submitted data record)
+    name TINYTEXT NULL,                                         -- Displayed field prompt - also used on retrieval of data
+    description TINYTEXT NULL,                                  -- Description of field - possibly to display to user
+    PRIMARY KEY (id),
+    INDEX (ref_dest)
+);
+
+----
+
+-- Additional field data for various specific things
+CREATE TABLE {prefix}added_info_data (
+    id INT NOT NULL AUTO_INCREMENT,
+    added_info_field INT NULL,                                  -- Pointer to added_info_field table
+    ref_type TINYINT NULL,                                      -- See data ref_type table in plugin.ini
+    ref_dest INT NULL,                                          -- Pointer to specific entryt of the correct type (user submitted data record)
+    field_value TINYTEXT NULL,                                  
+    PRIMARY KEY (id),
+    INDEX (ref_dest)
+);
+
+
+----
+
+-- magicform
+CREATE TABLE {prefix}magicform (
+    id INT NOT NULL AUTO_INCREMENT,
+    form_id TINYTEXT NULL,
+    custom_id TINYTEXT NULL,
+    title TINYTEXT NULL,
+    type SMALLINT NULL,
+    descr TEXT NULL,
+    active BOOLEAN NULL,
+    required BOOLEAN NULL,
+    data1 TINYTEXT NULL,
+    sort SMALLINT NULL,
+    expanded BOOLEAN NULL,
+    style TEXT NULL,
+    file TINYTEXT NULL,
+    cols INT NULL,
+    rows INT NULL,
+    size TINYTEXT NULL,
+    format TINYTEXT NULL,
+    default_val TINYTEXT NULL,
+    PRIMARY KEY (id),
+    INDEX(form_id(20))
+);
+
+----
+
+-- mf_data
+CREATE TABLE {prefix}mf_data (
+    id INT NOT NULL AUTO_INCREMENT,
+    fiid INT NULL,
+    form_id TINYTEXT NULL,
+    field_id TINYTEXT NULL,
+    level TINYTEXT NULL,
+    title TINYTEXT NULL,
+    type INT NULL,
+    txt_type TEXT NULL,
+    value TEXT NULL,
+    numb_value DOUBLE PRECISION NULL,
+    txt_value TEXT NULL,
+    opt_num INT NULL,
+    valid BOOLEAN NULL,
+    required BOOLEAN NULL,
+    failure TEXT NULL,
+    PRIMARY KEY (id),
+    INDEX(form_id(20)),
+    INDEX(fiid)
+);
+
+----
+
+-- mf_temp_file
+CREATE TABLE {prefix}mf_temp_file (
+    id INT NOT NULL AUTO_INCREMENT,
+    file_name TINYTEXT NULL,
+    upload_time DATE NULL,
+    PRIMARY KEY (id),
+    INDEX(file_name(20)),
+    INDEX(upload_time)
+);
+
+----
+
+-- Payment Codes
+-- Promotional payment codes for free/discounted payment
+CREATE TABLE {prefix}payment_code (
+    id INT NOT NULL AUTO_INCREMENT,
+    code_type TINYINT NULL,                                     -- Type of adjustment - Free only to start with - See pay_code_type in plugin.ini
+    ref_type TINYINT NULL,                                      -- See payment_ref_type in plugin.ini
+    ref_dest INT NULL,                                          -- Pointer to the specific entity of ref_type
+    code TINYTEXT NULL,                                         -- Text code user must enter to use 
+    amount FLOAT,                                               -- Amount of discount if not type "Free" - Either $ amount or percent
+    descr TEXT NULL, 
+    PRIMARY KEY (id),
+    INDEX (ref_dest),
+    INDEX (code(10))
+);
+
+----
+
+-- Registration event specific information
+-- One record for each event in Events add-on
+-- Only created when selecting registrations for a particular event in the Events add-on
+CREATE TABLE {prefix}reg_event (
+    id INT NOT NULL AUTO_INCREMENT,
+    event INT NULL,                                             -- Pointer to event in Events add-on
+    event_name TINYTEXT NULL,                                   -- Name of Event so it will always be in the cart data
+    event_code TINYTEXT NULL,                                   -- A short code used to reference this event - can be used to directly select an event to register for
+    notify_email TINYTEXT NULL,                                 -- E-Mail addresses to recieve notification of a registration other than org_internal_email in management, comma separated
+    admin_active BOOLEAN NULL,                                  -- Active flag for admin from Events - If false, then does not show as a link from events to manage event. Still shows in registrations admin
+    active BOOLEAN NULL,                                        -- Active flag to indicate that this event is available for registrations
+    attendees BOOLEAN NULL,                                     -- Registration requires attendees - Otherwise the person submitting the registration is the registrant
+    attendee_max MEDIUMINT NULL,                                -- Attendee limit - 0 = unlimited
+    attendee_max_per_reg TINYINT NULL,                          -- Maximum attendees per registration submission - 0 = unlimited
+    reg_hold_minutes MEDIUMINT NULL,                            -- Number of minutes hold time for an inactive cart before registrant count hold expires (after which cart attempts to hold again on next access)
+    cart_hold_days MEDIUMINT NULL,                              -- Number of days hold time for inactive cart before cart is purged
+    registration_account_options SMALLINT NULL,                 -- Bitmap of how user accounts may be used for this event - See registration_account_option in plugin.ini
+    payment_methods SMALLINT NULL,                              -- Bitmap of payment methods available to users for this event - See payment_method in plugin.ini
+    restricted_payment_methods SMALLINT NULL,                   -- Bitmap of restricted (admin use only) payment methods for this event - see payment_method
+    terms TEXT NULL,                                            -- Terms and Conditions for registration
+    reg_file TINYTEXT NULL,                                     -- Name of a downloadable file
+    reg_file_title TINYTEXT NULL,                               -- Title for downloadable file
+    form_revision SMALLINT NULL,                                -- Current MagicForm form revision
+    notes TEXT NULL,                                            -- System operator's notes for this event - Not visible to users
+    PRIMARY KEY (id),
+    INDEX (event),
+    INDEX (event_code(10))
+);
+
+----
+
+-- Registration Event Time - Information and summary data for a specific event instance (relates to a perticular time record in events)
+-- These are created the first time a person tries to register for an event instance (time) 
+-- One or more for each event
+CREATE TABLE {prefix}reg_time (
+    id INT NOT NULL AUTO_INCREMENT,
+    reg_event INT NULL,                                         -- Pointer to reg_event table
+    event_time INT NULL,                                        -- Pointer to events times table entry
+    start_datetime DATETIME NULL,                               -- Date and time when event instance starts - Informational - Actual events data is definitive
+    end_datetime DATETIME NULL,                                 -- Date and time when event instance ends - Informational
+    all_day BOOLEAN NULL,                                       -- All Day flag - Informational
+    attendees BOOLEAN NULL,                                     -- Flag if tracking attendees or if only one per registration submission (registers account submitting) - get from reg_event
+    attendee_max MEDIUMINT NULL,                                -- Attendee count limit - 0 = unlimited - get from reg_event record 
+    attendee_count MEDIUMINT NULL,                              -- Current attendee count - calculated on the fly and stored here for reference
+    attendees_pending MEDIUMINT NULL,                           -- Current number of attendees for this time in active pending carts (not processed) - Updated when carts are processed
+    attendees_available MEDIUMINT NULL,                         -- Currently available attendee count (limit - current - pending)
+    total_base_charge DOUBLE NULL,                              -- Total base charges
+    total_per_attendee DOUBLE NULL,                             -- Total per-attendee charges
+    total_other DOUBLE NULL,                                    -- Total other charges (meals, extras, fees, ...)
+    total_taxes DOUBLE NULL,                                    -- Total taxes charged
+    total_charges DOUBLE NULL,                                  -- Total charges (sum of all above)
+    total_discounts DOUBLE NULL,                                -- Total discounts of all types (applied payment codes, etc...)
+    total_payments DOUBLE NULL,                                 -- Total net payments (total charges - total discounts)
+    PRIMARY KEY (id),
+    INDEX (reg_event)
+);
+
+----
+
+-- Registration Class - Type of registration for a specific event - Equates to "Rate Options" in the old system
+-- One or more for each event
+CREATE TABLE {prefix}reg_class (
+    id INT NOT NULL AUTO_INCREMENT,
+    reg_event INT NULL,                                         -- Pointer to reg_event table
+    name TINYTEXT NULL,                                         -- Name of this registration type
+    descr TEXT NULL,                                            -- Description
+    PRIMARY KEY (id),
+    INDEX (reg_event)
+);
+
+----
+
+-- Rates and dates for a particular reg_class
+-- One or more per reg_class - **** Days should not overlap for a particular reg_class
+CREATE TABLE {prefix}reg_rate (
+    id INT NOT NULL AUTO_INCREMENT,
+    reg_event INT NULL,                                         -- Pointer to reg_event table
+    reg_class INT NULL,                                         -- Pointer to reg_class table
+    name TINYTEXT NULL,                                         -- Namme of this rate
+    start_days INT NULL,                                        -- # of days before event time rate becomes available - may be entered as a date then coverted for storage
+    end_days INT NULL,                                          -- # of days before event time rate becomes unavailable
+    base_rate FLOAT,                                            -- Base rate to register
+    per_registrant FLOAT,                                       -- Rate per registrant
+    registrant_credits TINYINT NULL,                            -- Number of registrants included in base rate
+    PRIMARY KEY (id),
+    INDEX (reg_event),
+    INDEX (reg_class)
+);
+
+----
+
+-- An account for a person submitting a registration or a registrant for an event
+-- Depending on the use of these entries may not have all data included
+-- A single account may be referenced as a person submitting registrations and/or a person registered for an event
+CREATE TABLE {prefix}account (
+    id INT NOT NULL AUTO_INCREMENT,
+    active BOOLEAN NULL,                                        -- Is active flag (may be accessed or used) - default is true
+    registered_by INT NULL,                                     -- Account
+    member_id TINYTEXT NULL,                                    -- Free-form field for a member ID (not a GLM Associate member ID)
+    fname TINYTEXT NULL,                                        -- Account primary address
+    lname TINYTEXT NULL,
+    org TINYTEXT NULL,
+    title TINYTEXT NULL,
+    addr1 TINYTEXT NULL,
+    addr2 TINYTEXT NULL,
+    city TINYTEXT NULL,
+    state TINYTEXT NULL,
+    zip TINYTEXT NULL,
+    country TINYTEXT NULL,
+    phone TINYTEXT NULL,
+    fax TINYTEXT NULL,
+    bill_fname TINYTEXT NULL,                                   -- Last used billing information - Also stored in each registration request
+    bill_lname TINYTEXT NULL,
+    bill_org TINYTEXT NULL,
+    bill_title TINYTEXT NULL,
+    bill_addr1 TINYTEXT NULL,
+    bill_addr2 TINYTEXT NULL,
+    bill_city TINYTEXT NULL,
+    bill_state TINYTEXT NULL,
+    bill_zip TINYTEXT NULL,
+    bill_country TINYTEXT NULL,
+    bill_phone TINYTEXT NULL,
+    bill_fax TINYTEXT NULL,
+    email TINYTEXT NULL,
+    password TINYTEXT NULL,                                     -- Crypted password for login back into this account
+    email_ok BOOLEAN NULL,
+    is_member BOOLEAN NULL,                                     -- Is a member of the entity that owns the site
+    contact_id INT NULL,                                        -- Pointer to GLM Associate member contact record if account is for a member contact
+    contact_fname TINYTEXT NULL,
+    contact_lname TINYTEXT NULL,
+    contact_org TINYTEXT NULL,
+    contact_title TINYTEXT NULL,
+    contact_addr1 TINYTEXT NULL,
+    contact_addr2 TINYTEXT NULL,
+    contact_city TINYTEXT NULL,
+    contact_state TINYTEXT NULL,
+    contact_zip TINYTEXT NULL,
+    contact_country TINYTEXT NULL,
+    contact_phone TINYTEXT NULL,
+    contact_fax TINYTEXT NULL,
+    contact_email TINYTEXT NULL,
+    contact_email_ok BOOLEAN NULL,
+    guardian TINYTEXT NULL,
+    emer_contact TINYTEXT NULL,
+    emer_phone TINYTEXT NULL,
+    med_history TINYTEXT NULL,
+    allergy_med TINYTEXT NULL,
+    date_created DATE NULL,
+    notes TEXT NULL,                                            -- System operator's notes for this account - not visible to account owner
+    user_trace_info TINYTEXT NULL,                              -- IP Address of user computer and timestamp of last update
+    PRIMARY KEY (id),
+    INDEX (registered_by),
+    INDEX (member_id(10)),
+    INDEX (fname(10)),
+    INDEX (lname(10)),
+    INDEX (org(10)),
+    INDEX (city(10)),
+    INDEX (state(5)),
+    INDEX (zip(5)),
+    INDEX (email(10)),
+    INDEX (contact_id)    
+);
+
+----
+
+-- A request for registration
+-- Has one or more reg_detail records associated with it
+CREATE TABLE {prefix}reg_request (
+    id INT NOT NULL AUTO_INCREMENT,
+    account INT NULL,                                           -- Pointer to user account (reg_account) who submitted the registrations
+    bill_fname TINYTEXT NULL,                                   -- Billing information used for this registration submission - Updates account billing address - Kept here for each request
+    bill_lname TINYTEXT NULL,
+    bill_org TINYTEXT NULL,
+    bill_title TINYTEXT NULL,
+    bill_addr1 TINYTEXT NULL,
+    bill_addr2 TINYTEXT NULL,
+    bill_city TINYTEXT NULL,
+    bill_state TINYTEXT NULL,
+    bill_zip TINYTEXT NULL,
+    bill_country TINYTEXT NULL,
+    date_submitted DATE NULL,
+    pay_method INT NULL,                                        -- See payment_method in plugin.ini
+    payment_code TINYTEXT NULL,                                 -- Payment_code (code text) - if submitted and validated
+    status SMALLINT NULL,                                       -- See submission_status in plugin.ini
+    total DOUBLE PRECISION NULL,                                -- Total charge including all fees and taxes
+    cc_type TINYINT NULL,                                       -- Credit Card type (if used) - See credit_card in plugin.ini
+    cc_name TINYTEXT NULL,
+    cc_numb TINYTEXT NULL,
+    cc_exp TINYTEXT NULL,
+    cc_cvv TINYTEXT NULL,
+    cc_conf TINYTEXT NULL,                                      -- Confirmation code back from card processor
+    summary TEXT NULL,                                          -- HTML summary of cart contents, costs and payment - Use same HTML displayed to user
+    mf_data TEXT NULL,                                          -- Any MagicForm data associated with registrant
+    notes TEXT NULL,                                            -- System operator's notes for this registration request
+    user_trace_info TINYTEXT NULL,                              -- IP Address of user computer and timestamp
+    last_update DATETIME NULL,                                  -- Last update date/time - Used for timing out pending carts and attendee counts
+    PRIMARY KEY (id),
+    INDEX (account),
+    INDEX (date_submitted)
+);
+
+----
+
+-- Registration for a specific event
+-- Has one or more reg_selected_rate records associated with it
+CREATE TABLE {prefix}reg_request_event (
+    id INT NOT NULL AUTO_INCREMENT,
+    account INT NULL,                                           -- Pointer to account (person submitting the registration)
+    reg_request INT NULL,                                       -- Pointer to reg_request table
+    event INT NULL,                                             -- Pointer to reg_event
+    event_name TINYTEXT NULL,                                   -- Name of Event so it will always be in the cart data
+    event_time INT NULL,                                        -- Pointer to times table entry in Events add-on
+    event_datetime DATETIME NULL,                               -- Date and time of event time selected so it will always be in the cart
+    total_charge FLOAT,                                         -- Last calculated total of all charges for registration to this event for all registrants 
+    mf_data TEXT NULL,                                          -- Any MagicForm data associated with requested event
+    notes TEXT NULL,                                            -- System operator's notes for this registration request
+    PRIMARY KEY (id),
+    INDEX (reg_request),
+    INDEX (account),
+    INDEX (event),
+    INDEX (event_time)
+);
+
+----
+
+--  A particular reg_class selected
+--  Has one or more reg_request_rate records associated with it
+CREATE TABLE {prefix}reg_request_class (
+    id INT NOT NULL AUTO_INCREMENT,
+    account INT NULL,                                           -- Pointer to account (person submitting the registration)
+    event INT NULL,                                             -- Pointer to reg_event entry
+    event_name TINYTEXT NULL,                                   -- Name of Event so it will always be in the cart data
+    event_time INT NULL,                                        -- Pointer to times table entry in Events add-on - To help with registrant searches
+    event_datetime DATETIME NULL,                               -- Date and time of event time selected so it will always be in the cart
+    reg_request INT NULL,                                       -- Pointer to the registration request record
+    reg_request_event INT NULL,                                 -- Pointer to reg_request_event table entry
+    class INT NULL,                                             -- Pointer to event reg_class table
+    class_name TINYTEXT NULL,                                   -- Name of event class at the time selected
+    total_class_charge FLOAT,                                   -- Last calculated total of all charges for this registration class for this request 
+    mf_data TEXT NULL,                                          -- Any MagicForm data associated with registrant
+    notes TEXT NULL,                                            -- System operator's notes for this registration request
+    PRIMARY KEY (id),
+    INDEX (account),
+    INDEX (event),
+    INDEX (event_time),
+    INDEX (reg_request_event)
+);
+
+----
+
+--  A particular reg_rate selected
+--  Has one or more reg_request_registrant records associated with it
+CREATE TABLE {prefix}reg_request_rate (
+    id INT NOT NULL AUTO_INCREMENT,
+    account INT NULL,                                           -- Pointer to account (person submitting the registration)
+    event INT NULL,                                             -- Pointer to reg_event entry
+    event_name TINYTEXT NULL,                                   -- Name of Event so it will always be in the cart data
+    event_time INT NULL,                                        -- Pointer to times table entry in Events add-on - To help with registrant searches
+    event_datetime DATETIME NULL,                               -- Date and time of event time selected so it will always be in the cart
+    reg_request INT NULL,                                       -- Pointer to the registration request record
+    reg_request_event INT NULL,                                 -- Pointer to reg_request_event table entry
+    reg_request_class INT NULL,                                 -- Pointer to reg_request_class table entry
+    rate INT NULL,                                             -- Pointer to event reg_rate table
+    rate_name TINYTEXT NULL,                                   -- Name of event class rate at the time selected
+    base_rate FLOAT,                                            -- Base rate at time of registration
+    per_registrant FLOAT,                                       -- Per Registrant Rate at time of registration
+    registrant_credits TINYINT NULL,                            -- Number of registrant credits in base rate at time of registration
+    numb_registrants TINYINT NULL,                              -- Last calculated number of registrants with this rate
+    total_registrant_charges FLOAT,                             -- Last calculation registrant charges assoicated with this selected rate
+    mf_data TEXT NULL,                                          -- Any MagicForm data associated with registrant
+    notes TEXT NULL,                                            -- System operator's notes for this registration request
+    PRIMARY KEY (id),
+    INDEX (account),
+    INDEX (event),
+    INDEX (event_time),
+    INDEX (reg_request_event),
+    INDEX (reg_request_class)
+);
+
+----
+
+--  A specific registrant for a selected registration rate
+CREATE TABLE {prefix}reg_request_registrant (
+    id INT NOT NULL AUTO_INCREMENT,
+    account INT NULL,                                           -- Pointer to account for person submitting the registration
+    event INT NULL,                                             -- Pointer to reg_event entry
+    event_name TINYTEXT NULL,                                   -- Name of Event so it will always be in the cart data
+    event_time INT NULL,                                        -- Pointer to times table entry in Events add-on - To help with registrant searches
+    event_datetime DATETIME NULL,                               -- Date and time of event time selected so it will always be in the cart
+    reg_request INT NULL,                                       -- Pointer to the registration request record
+    reg_request_event INT NULL,                                 -- Pointer to reg_request_event table entry
+    reg_request_class INT NULL,                                 -- Pointer to reg_request_class table entry
+    reg_request_rate INT NULL,                                  -- Pointer to reg_request_rate table entry
+    reg_request_registrant INT NULL,                            -- Pointer to account for registrant (person attending) - Not needed if registrants are off for the event
+    reg_request_hold BOOLEAN NULL,                              -- Registrant hold active - Registrant slots held certain time since last cart access - After this the slot needs to be updated if available 
+    fname TINYTEXT NULL,                                        -- First name of registrant at the time of selection
+    lname TINYTEXT NULL,                                        -- Last name of registrant at the time of selection
+    mf_data TEXT NULL,                                          -- Any MagicForm data associated with registrant
+    notes TEXT NULL,                                            -- System operator's notes for this registration request
+    PRIMARY KEY (id),
+    INDEX (account),
+    INDEX (event),
+    INDEX (event_time),
+    INDEX (reg_request),
+    INDEX (reg_request_event),
+    INDEX (reg_request_class),
+    INDEX (reg_request_rate),
+    INDEX (reg_request_registrant)
+);
+
+----
+
+-- Insert into management table
+INSERT INTO {prefix}management
+    (
+    canonical_reg_page,
+    reg_org_name,
+    reg_org_short,
+    reg_org_address,
+    reg_org_city,
+    reg_org_state,
+    reg_org_zip,
+    reg_org_phone,
+    reg_org_toll_free,
+    reg_org_internal_email,
+    reg_org_from_email,
+    reg_payment_methods,
+    reg_proc_methods,
+    reg_cc_accepts,
+    reg_authorize_net_login,
+    reg_authorize_net_key,
+    reg_authorize_net_test,
+    reg_authorize_net_conf,
+    reg_authorize_net_merchant_email,
+    reg_merchant_solutions_acctid,
+    reg_merchant_solutions_merchantpin,
+    reg_merchant_solutions_test,
+    reg_full_billing_info,
+    reg_bill_info_req_no_charge,
+    reg_bill_info_req_comp_code,
+    reg_bill_info_req_cash,
+    reg_bill_info_req_check,
+    reg_bill_info_req_credit_card,
+    reg_bill_info_req_merchant_call,
+    reg_medical_info
+    )
+    VALUES
+    (
+    'registrations',                                            -- reg_canonical_reg_page,
+    'Gaslight Media',                                           -- reg_org_name,
+    'GLM',                                                      -- reg_org_short,
+    '120 E. Lake St.',                                          -- reg_org_address,
+    'Petoskey',                                                 -- reg_org_city,
+    'MI',                                                       -- reg_org_state,
+    '49770',                                                    -- reg_org_zip,
+    '231-487-0692',                                             -- reg_org_phone,
+    '800-123-1234',                                             -- reg_org_toll_free,
+    'internal@gaslightmedia.com',                               -- reg_org_internal_email,
+    'info@gaslightmedia.com',                                   -- reg_org_from_email,
+    0,                                                          -- reg_payment_methods,
+    0,                                                          -- reg_proc_methods,
+    0,                                                          -- reg_cc_accepts,
+    '',                                                         -- reg_authorize_net_login,
+    '',                                                         -- reg_authorize_net_key,
+    1,                                                          -- reg_authorize_net_test,
+    true,                                                       -- reg_authorize_net_conf
+    '',                                                         -- reg_authorize_net_merchant_email,
+    '',                                                         -- reg_merchant_solutions_acctid,
+    '',                                                         -- reg_merchant_solutions_merchantpin,
+    1,                                                          -- reg_merchant_solutions_test, 
+    true,                                                       -- reg_full_billing_info,
+    0,                                                          -- reg_bill_info_req_no_charge,
+    0,                                                          -- reg_bill_info_req_comp_code,
+    0,                                                          -- reg_bill_info_req_cash,
+    0,                                                          -- reg_bill_info_req_check,
+    0,                                                          -- reg_bill_info_req_credit_card,
+    0,                                                          -- reg_bill_info_req_merchant_call,
+    true                                                        -- reg_medical_info,
+    );
+
+----
+
+-- Insert into settings_terms table
+INSERT INTO {prefix}settings_terms
+    (
+    reg_term_registrations_name,
+    reg_term_registration,
+    reg_term_registration_cap,
+    reg_term_registration_plur,
+    reg_term_registration_plur_cap,
+    reg_term_register,
+    reg_term_register_cap,
+    reg_term_registers,
+    reg_term_registering,
+    reg_term_registering_cap,
+    reg_term_registered,
+    reg_term_registered_cap,
+    reg_term_attendee,
+    reg_term_attendee_cap,
+    reg_term_attendee_plur,
+    reg_term_attendee_plur_cap,
+    reg_term_attending,
+    reg_term_attended,
+    reg_term_registered_user,
+    reg_term_registered_user_cap,
+    reg_term_registered_user_plur,
+    reg_term_registered_user_plur_cap,
+    reg_term_id,
+    reg_term_id_cap,
+    reg_term_id_plur,
+    reg_term_id_plur_cap,
+    reg_term_password,
+    reg_term_password_cap,
+    reg_term_password_plur,
+    reg_term_password_plur_cap,
+    reg_term_instructor,
+    reg_term_instructor_cap,
+    reg_term_instructor_plur,
+    reg_term_instructor_plur_cap,
+    reg_term_payment_code,
+    reg_term_payment_code_cap,
+    reg_term_payment_code_plur,
+    reg_term_payment_code_plur_cap,
+    reg_term_registration_button,
+    reg_term_contact_information
+    )
+    VALUES
+    (
+    'Event Registrations',                                      -- reg_term_registrations_name
+    'registration',                                             -- reg_term_registration
+    'Registration',                                             -- reg_term_registration_cap
+    'registrations',                                            -- reg_term_registration_plur
+    'Registrations',                                            -- reg_term_registration_plur_cap
+    'register',                                                 -- reg_term_registe
+    'Register',                                                 -- reg_term_register_cap
+    'registers',                                                -- reg_term_registers
+    'registering',                                              -- reg_term_registering
+    'Registering',                                              -- reg_term_registering_cap
+    'registered',                                               -- reg_term_registered
+    'Registered',                                               -- reg_term_registered_cap
+    'attendee',                                                 -- reg_term_attendee
+    'Attendee',                                                 -- reg_term_attendee_cap
+    'attendees',                                                -- reg_term_attendee_plur
+    'Attendees',                                                -- reg_term_attendee_plur_cap
+    'attending',                                                -- reg_term_attending
+    'attended',                                                 -- reg_term_attended
+    'user',                                                     -- reg_term_registered_user
+    'User',                                                     -- reg_term_registered_user_cap
+    'users',                                                    -- reg_term_registered_user_plur
+    'Users',                                                    -- reg_term_registered_user_plur_cap
+    'ID',                                                       -- reg_term_id
+    'ID',                                                       -- reg_term_id_cap
+    'IDs',                                                      -- reg_term_id_plur
+    'IDs',                                                      -- reg_term_id_plur_cap
+    'password',                                                 -- reg_term_password
+    'passwords',                                                -- reg_term_password_cap
+    'Password',                                                 -- reg_term_password_plur
+    'Passwords',                                                -- reg_term_password_plur_cap
+    'instructor',                                               -- reg_term_instructor
+    'Instructor',                                               -- reg_term_instructor_cap
+    'instructors',                                              -- reg_term_instructor_plur
+    'Instructors',                                              -- reg_term_instructor_plur_cap
+    'payment code',                                             -- reg_term_payment_code
+    'Payment code',                                             -- reg_term_payment_code_cap
+    'payment codes',                                            -- reg_term_payment_code_plur
+    'Payment codes',                                            -- reg_term_payment_code_plur_cap
+    'Register for Event',                                       -- reg_term_registration_button
+    'Contact Information'                                       -- reg_term_contact_information
+    );
+    
+----
+
+-- Insert into misc table
+INSERT INTO {prefix}misc
+    (
+    reg_bulletin,
+    cart_page_text,
+    checkout_page_text,
+    summary_page_text,
+    reg_terms,
+    notify_subject,
+    notify_text,
+    instr_notify_subject,
+    instr_notify_text,
+    submission_notify_subject,
+    submission_notify_text,
+    registrant_notify_subject,
+    registrant_notify_text,
+    submission_ack_subject,
+    submission_ack_text,
+    registrant_ack_subject,
+    registrant_ack_text
+    )
+    VALUES
+    (
+    'Registration Bulletin Text',
+    'Text for top of Cart Page',
+    'Text for top of Checkout Page',
+    'Text for top of Summary Page',
+    'Terms and Conditions',
+    'Subject of notification to site owner of a registration',
+    'Text of notification to site owner of a registration',
+    'Subject of notification to instructor of registration',
+    'Text for notification to instructor of registration',
+    'Subject of notification to person submitting registration',
+    'Text of notification to person submitting registration',
+    'Subject for notification to registrant',
+    'Text for notification to registrant',
+    'Subject of acknowledgement to person submitting registration',
+    'Text of acknowledgement to person submitting registration',
+    'Subject of acknowledgement to registrant',
+    'Text of acknowledgement to registrant'
+    );
index c922a13..4a4bca7 100644 (file)
 
 $glmMembersRegistrationsDbVersions = array(
     '0.0.1' => array('version' => '0.0.1', 'tables' => 18, 'date' => '03/3/2017'),
-    '0.0.2' => array('version' => '0.0.2', 'tables' => 18, 'date' => '03/28/2017')
+    '0.0.2' => array('version' => '0.0.2', 'tables' => 18, 'date' => '03/28/2017'),
+    '0.0.3' => array('version' => '0.0.3', 'tables' => 18, 'date' => '04/03/2017'),
+    '0.0.4' => array('version' => '0.0.4', 'tables' => 18, 'date' => '04/03/2017'),
+    '0.0.5' => array('version' => '0.0.5', 'tables' => 18, 'date' => '04/04/2017'),
+    '0.0.6' => array('version' => '0.0.6', 'tables' => 19, 'date' => '04/06/2017')
 );
 
 
diff --git a/setup/databaseScripts/drop_database_V0.0.2.sql b/setup/databaseScripts/drop_database_V0.0.2.sql
deleted file mode 100644 (file)
index eb608ea..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
--- Gaslight Media Members Database
--- File Created: 12/09/14 15:27:15
--- Database Version: 1.1.23
--- Database Deletion Script
--- Note: Tables with DELETE CASCADE must appear before referenced table
-
-DROP TABLE IF EXISTS
-    {prefix}management,
-    {prefix}settings_terms,
-    {prefix}misc,
-    {prefix}added_info_fields,
-    {prefix}added_info_data,
-    {prefix}magicform,
-    {prefix}mf_data,
-    {prefix}mf_temp_file,
-    {prefix}payment_code,
-    {prefix}reg_event,
-    {prefix}reg_class,
-    {prefix}reg_rates,
-    {prefix}account,
-    {prefix}reg_request,
-    {prefix}reg_request_event,
-    {prefix}reg_request_class,
-    {prefix}reg_request_rate,
-    {prefix}reg_request_registrant
-;
-
diff --git a/setup/databaseScripts/drop_database_V0.0.6.sql b/setup/databaseScripts/drop_database_V0.0.6.sql
new file mode 100644 (file)
index 0000000..ef68960
--- /dev/null
@@ -0,0 +1,28 @@
+-- Gaslight Media Members Database
+-- File Created: 12/09/14 15:27:15
+-- Database Version: 1.1.23
+-- Database Deletion Script
+-- Note: Tables with DELETE CASCADE must appear before referenced table
+
+DROP TABLE IF EXISTS
+    {prefix}management,
+    {prefix}settings_terms,
+    {prefix}misc,
+    {prefix}added_info_fields,
+    {prefix}added_info_data,
+    {prefix}magicform,
+    {prefix}mf_data,
+    {prefix}mf_temp_file,
+    {prefix}payment_code,
+    {prefix}reg_event,
+    {prefix}reg_time,
+    {prefix}reg_class,
+    {prefix}reg_rate,
+    {prefix}account,
+    {prefix}reg_request,
+    {prefix}reg_request_event,
+    {prefix}reg_request_class,
+    {prefix}reg_request_rate,
+    {prefix}reg_request_registrant
+;
+
diff --git a/setup/databaseScripts/update_database_V0.0.3.sql b/setup/databaseScripts/update_database_V0.0.3.sql
new file mode 100644 (file)
index 0000000..e877349
--- /dev/null
@@ -0,0 +1,9 @@
+-- Gaslight Media Members Database - Registrations Add-On 
+-- File Created: 03/28/17 11:33:00
+-- Database Version: 0.0.2
+-- Database Update From Previous Version Script
+-- 
+-- To permit each query below to be executed separately,
+-- all queries must be separated by a line with four dashses
+
+RENAME TABLE {prefix}reg_rates TO {prefix}reg_rate;
diff --git a/setup/databaseScripts/update_database_V0.0.4.sql b/setup/databaseScripts/update_database_V0.0.4.sql
new file mode 100644 (file)
index 0000000..caa1193
--- /dev/null
@@ -0,0 +1,45 @@
+-- Gaslight Media Members Database - Registrations Add-On 
+-- File Created: 03/28/17 11:33:00
+-- Database Version: 0.0.2
+-- Database Update From Previous Version Script
+-- 
+-- To permit each query below to be executed separately,
+-- all queries must be separated by a line with four dashses
+
+ALTER TABLE {prefix}reg_event ADD COLUMN event_name TINYTEXT;
+
+----
+
+ALTER TABLE {prefix}reg_request_event ADD COLUMN event_name TINYTEXT;
+
+----
+
+ALTER TABLE {prefix}reg_request_event ADD COLUMN event_datetime DATETIME;
+
+----
+
+ALTER TABLE {prefix}reg_request_class ADD COLUMN event_name TINYTEXT;
+
+----
+
+ALTER TABLE {prefix}reg_request_class ADD COLUMN event_datetime DATETIME;
+
+----
+
+ALTER TABLE {prefix}reg_request_rate ADD COLUMN event_name TINYTEXT;
+
+----
+
+ALTER TABLE {prefix}reg_request_rate ADD COLUMN event_datetime DATETIME;
+
+----
+
+ALTER TABLE {prefix}reg_request_registrant ADD COLUMN event_name TINYTEXT;
+
+----
+
+ALTER TABLE {prefix}reg_request_registrant ADD COLUMN event_datetime DATETIME;
+
+
+
+
diff --git a/setup/databaseScripts/update_database_V0.0.5.sql b/setup/databaseScripts/update_database_V0.0.5.sql
new file mode 100644 (file)
index 0000000..8e2c887
--- /dev/null
@@ -0,0 +1,33 @@
+-- Gaslight Media Members Database - Registrations Add-On 
+-- File Created: 03/28/17 11:33:00
+-- Database Version: 0.0.2
+-- Database Update From Previous Version Script
+-- 
+-- To permit each query below to be executed separately,
+-- all queries must be separated by a line with four dashses
+
+ALTER TABLE {prefix}reg_rate ADD COLUMN name TINYTEXT;
+
+----
+
+ALTER TABLE {prefix}reg_request_class ADD COLUMN class INTEGER;
+
+----
+
+ALTER TABLE {prefix}reg_request_class ADD COLUMN class_name TINYTEXT;
+
+----
+
+ALTER TABLE {prefix}reg_request_rate ADD COLUMN rate INTEGER;
+
+----
+
+ALTER TABLE {prefix}reg_request_rate ADD COLUMN rate_name TINYTEXT;
+
+----
+
+ALTER TABLE {prefix}reg_request_registrant ADD COLUMN fname TINYTEXT;
+
+----
+
+ALTER TABLE {prefix}reg_request_registrant ADD COLUMN lname TINYTEXT;
diff --git a/setup/databaseScripts/update_database_V0.0.6.sql b/setup/databaseScripts/update_database_V0.0.6.sql
new file mode 100644 (file)
index 0000000..4bb12c6
--- /dev/null
@@ -0,0 +1,49 @@
+-- Gaslight Media Members Database  - Registratiuons Add-On
+-- File Created: 08/30/16 09:47:15
+-- Database Version: 0.0.23
+-- Database Update From Previous Version Script
+--
+-- To permit each query below to be executed separately,
+-- all queries must be separated by a line with four dashes
+
+-- Registration Event Time - Information and summary data for a specific event instance (relates to a perticular time record in events)
+-- These are created the first time a person tries to register for an event instance (time) 
+-- One or more for each event
+CREATE TABLE {prefix}reg_time (
+    id INT NOT NULL AUTO_INCREMENT,
+    reg_event INT NULL,                                         -- Pointer to reg_event table
+    event_time INT NULL,                                        -- Pointer to events times table entry
+    start_datetime DATETIME NULL,                               -- Date and time when event instance starts - Informational - Actual events data is definitive
+    end_datetime DATETIME NULL,                                 -- Date and time when event instance ends - Informational
+    all_day BOOLEAN NULL,                                       -- All Day flag - Informational
+    attendees BOOLEAN NULL,                                     -- Flag if tracking attendees or if only one per registration submission (registers account submitting) - get from reg_event
+    attendee_max MEDIUMINT NULL,                                -- Attendee count limit - 0 = unlimited - get from reg_event record 
+    attendee_count MEDIUMINT NULL,                              -- Current attendee count - calculated on the fly and stored here for reference
+    attendees_pending MEDIUMINT NULL,                           -- Current number of attendees for this time in active pending carts (not processed) - Updated when carts are processed
+    attendees_available MEDIUMINT NULL,                         -- Currently available attendee count (limit - current - pending)
+    total_base_charge DOUBLE NULL,                              -- Total base charges
+    total_per_attendee DOUBLE NULL,                             -- Total per-attendee charges
+    total_other DOUBLE NULL,                                    -- Total other charges (meals, extras, fees, ...)
+    total_taxes DOUBLE NULL,                                    -- Total taxes charged
+    total_charges DOUBLE NULL,                                  -- Total charges (sum of all above)
+    total_discounts DOUBLE NULL,                                -- Total discounts of all types (applied payment codes, etc...)
+    total_payments DOUBLE NULL,                                 -- Total net payments (total charges - total discounts)
+    PRIMARY KEY (id),
+    INDEX (reg_event)
+);
+
+----
+
+ALTER TABLE {prefix}reg_event DROP COLUMN attendee_count;
+
+----
+
+ALTER TABLE {prefix}reg_event ADD COLUMN reg_hold_minutes MEDIUMINT;
+
+----
+
+ALTER TABLE {prefix}reg_event ADD COLUMN cart_hold_days MEDIUMINT;
+
+----
+
+ALTER TABLE {prefix}reg_request_registrant ADD COLUMN reg_request_hold BOOLEAN;
index 9fd144e..23b56ad 100644 (file)
 
-<h3>Registration Request</h3>
+{include file='admin/registrations/header.html'}
 
-<p>Person submitting the registration: {$requestCart.request.bill_fname} (ID = {$requestCart.request.id})</p>
-
-<p>
-Info in registration request:
-{if $requestCart.request.account}
-    {$requestCart.accounts.{$requestCart.request.account}.fname}
-{else}
-    (No account)
-{/if}
-
-
-</p>
-
-<p>Info from account of person who submitted the registration</p>
-
-<p>Events selected:</p>
 
+    <a href="{$thisUrl}?page={$thisPage}&glm_action=requests" class="button button-secondary glm-button glm-right">Return to Registration Requests List</a>
 
+  {if $option == 'edit' || $option == 'update'}
+*** Edit or Update ***<!--   
+    <a id="deleteAccountButton" class="button button-secondary glm-button glm-right">Delete this Account</a>
+    <div id="deleteAccountDialog" class="glm-dialog-box" title="Delete Account">
+        <center>
+            <p><a id="deleteAccountCancel" class="button button-primary">Cancel</a></p>
+            <p><input id="deleteAccountSubmit" type="submit" value="Delete this contact"></p>
+        </center>
+        <div class="glm-item-container">
+            <p><center><span class="glm-error">WARNING:</span></center></p>
+            <p>
+                <span class="glm-warning">Clicking the "Delete this Account" button above will
+                delete all of the data and images associated with this contact.
+                </span>
+            </p>
+            <p>
+                <span class="glm-error">Once deleted, this information will no longer be available and cannot be retrieved!</span>
+            </p>
+        </div>
+    </div>
+    <h2>Edit Account
+-->    
+  {else}
+    {$req = $cart.request}
+  
+    <table class="glm-admin-table">
+        <tr>
+            <td>
+                <table class="glm-admin-table glm-account-table glm-admin-table-close-spaced">
+                    <tr><th>Request ID: </th><td>{$req.id}</td></tr>
+                    <tr><th>Date Submitted: </th><td>{$req.date_submitted.datetime}</td></tr>
+                    <tr><th>Status: </th><td>{$req.status.name}</td></tr>
+                </table>
+            </td>
+            <td>
+                <table id="glm-table-account" class="glm-admin-table glm-account-table glm-admin-table-border glm-admin-table-close-spaced">
+                    <tr><th><center>Billing Information</center></th></tr>
+                    <tr>
+                        <td>
+                            <table>
+                                <tr><th>Name: </th><td>{$req.bill_fname} {$req.bill_lname}{if $req.bill_title}, {$req.bill_title}{/if}</td></tr>
+                {if $req.bill_org}
+                                <tr><th>Organization: </th><td>{$req.bill_org}</td></tr>
+                {/if}
+                                <tr><th>Address: </th><td>{$req.bill_addr1}</td></tr>
+                {if $req.bill_addr2}
+                                <tr><th></th><td>{$req.bill_addr2}</td></tr>
+                {/if}
+                                <tr><th></th><td>{$req.bill_city}, {$req.bill_state} {$req.bill_zip} {$req.bill_country}</td></tr>
+                                <tr><th>Payment Method: </th><td>{$req.pay_method.name}</td></tr>
+                {if $req.status == 'CC_PAID'}
+                                <tr><th>Card Type: </th><td>{$req.cc_type.value}</td></tr>
+                                <tr><th>Card Number: </th><td>{$req.cc_numb}</td></tr>
+                                <tr><th>Confirmation: </th><td>{$req.cc_conf}</td></tr>
+                {/if}                    
+                            </table>
+                        </td>
+                    </tr>
+                </table>
+            </td>
+    {if $req.notes}
+            <td>
+                <table class="glm-admin-table glm-account-table glm-admin-table-border glm-admin-table-close-spaced">
+                    <tr><th><center>Notes</center></th></tr>
+                    <tr><td>{$req.notes}</td></tr>
+                </table>            
+            </td>
+    {/if}            
+        </tr>
+    <table class="glm-admin-table glm-account-table glm-admin-table-border glm-admin-table-close-spaced">
+        <tr><th><center>Registrations Selected</center></th></tr>
+        <tr>
+            <td>
+                <table>
+                    <tr><th>Event</th><th>Start Date/Time</th><th>Class</th><th>Rate</th><th>Credits<th>Registrants</th><th>Charge</th></tr>
+    {foreach $cart.events as $event}
+                    <tr>
+                        <td>{$event.event_name}</td><td>{$event.event_datetime.datetime}</td>
+                    </tr>
+        {foreach $event.classes as $class}
+                    <tr>
+                        <td colspan="2">&nbsp;</td><td>{$class.class_name}</td>
+                    </tr>
+            {foreach $class.rates as $rate}
+                    <tr>
+                        <td colspan="3">&nbsp;</td><td>{$rate.rate_name}</td><td>{$rate.registrant_credits}</td><td>&nbsp;</td><td align="right">{$rate.base_rate}</td>
+                    </tr>
+                {foreach $rate.registrants as $registrant}
+                    <tr>
+                        <td colspan="5">&nbsp;</td><td>{$registrant.fname} {$registrant.lname}</td><td align="right">{$rate.per_registrant}</td>
+                    </tr>
+                {/foreach}
+            {/foreach}
+        {/foreach}
+                    </tr>
+    {/foreach}                                
+                </table>
+            </td>
+        </tr>
+    </table>            
     
-{include file='admin/footer.html'}
+  {/if}
 
-<pre>{$cart_r}</pre>
+{include file='admin/footer.html'}
index 5e3a229..b2931a0 100644 (file)
     {if $haveRequests}
         {foreach $requests as $r}
                 <tr>
-                    <td><a href="{$thisUrl}?page=glm-members-admin-menu-registrations-requests&option=edit&requestID={$r.id}">{$r.id}</a></td>
-                    <td>{$r.bill_fname}</td>
-                    <td>{$r.bill_lname}</td>
-                    <td>{$r.bill_org}</td>
+                    <td>{$r.id}</a></td>
+                    <td><a href="{$thisUrl}?page=glm-members-admin-menu-registrations-requests&option=edit&requestID={$r.id}">{$r.bill_fname}</td>
+                    <td><a href="{$thisUrl}?page=glm-members-admin-menu-registrations-requests&option=edit&requestID={$r.id}">{$r.bill_lname}</td>
+                    <td><a href="{$thisUrl}?page=glm-members-admin-menu-registrations-requests&option=edit&requestID={$r.id}">{$r.bill_org}</td>
                     <td>{$r.bill_city}</td>
                     <td>{$r.bill_state}</td>
                 </tr>