Updated database to include validated and validation_code fields to account table.
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 29 Aug 2017 17:46:26 +0000 (13:46 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 29 Aug 2017 17:46:26 +0000 (13:46 -0400)
Removed tabs from top of registrations admin pages.
Added tabs to top of event registration edit page to permit separate tabs of things that will be updated.

12 files changed:
index.php
models/admin/registrations/event.php
setup/databaseScripts/create_database_V0.0.10.sql [deleted file]
setup/databaseScripts/create_database_V0.0.11.sql [new file with mode: 0644]
setup/databaseScripts/dbVersions.php
setup/databaseScripts/drop_database_V0.0.10.sql [deleted file]
setup/databaseScripts/drop_database_V0.0.11.sql [new file with mode: 0644]
setup/databaseScripts/update_database_V0.0.11.sql [new file with mode: 0644]
views/admin/registrations/eventEdit.html
views/admin/registrations/eventEditLevels.html [new file with mode: 0644]
views/admin/registrations/eventEditSettings.html [new file with mode: 0644]
views/admin/registrations/header.html

index 859ace9..c8eac2e 100644 (file)
--- a/index.php
+++ b/index.php
@@ -44,7 +44,7 @@ if (!defined('ABSPATH')) {
  *  version from this plugin.
  */
 define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_VERSION', '0.0.1');
-define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_VERSION', '0.0.10');
+define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_VERSION', '0.0.11');
 
 // 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 94e8b49..8f06f93 100644 (file)
@@ -153,7 +153,8 @@ class GlmMembersAdmin_registrations_event extends GlmDataRegistrationsRegEvent
             
             case 'add':
             case 'edit':
-
+   
+                // If we're adding a new reg event
                 if ($option == 'add') {
 
                     // Verify that event is not already listed
@@ -350,7 +351,7 @@ class GlmMembersAdmin_registrations_event extends GlmDataRegistrationsRegEvent
         if ($haveRegEvent) {
             update_option('glmMembersDatabaseLastUsedRegEventID', $regEventID);
         }
-                
+              
         // Compile template data
         $templateData = array(
             'option'                => $option,
diff --git a/setup/databaseScripts/create_database_V0.0.10.sql b/setup/databaseScripts/create_database_V0.0.10.sql
deleted file mode 100644 (file)
index 85d0af4..0000000
+++ /dev/null
@@ -1,834 +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_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 an event is selected to offer registrations
-CREATE TABLE {prefix}reg_event (
-    id INT NOT NULL AUTO_INCREMENT,
-    event INT NULL,                                             -- Pointer to event in Events add-on - False if event record in Events add-on no longer exists
-    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 logged in Admin user for this event and this is true then admin user may enter registrations even if active is off.
-    active BOOLEAN NULL,                                        -- Active flag to indicate that this event is available for registrations
-    time_specific BOOLEAN NULL,                                                                        -- Registration for this event is not date/time specific. Can attend any date/time of event.
-    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)
--- A pseudo entry is created if registration is not date/time sensitive for this event. The pseudo entry does not point to an event time. 
--- 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,                                        -- ID of events times table entry in Events add-on - If false (0), then this is a pseudo entry to use for all registrations (non-date/time specific)
-    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 checked out and attendees slots held)  
-    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),
-    INDEX (event_time),
-    INDEX (start_datetime)
-);
-
-----
-
--- Pending Attendees - In carts but not checked out
--- Attendee counts may be held for a particular reg_time entry for carts that have not been checked out 
--- These are held for reg_event reg_hold_minutes, afterwhich they are timed out and removed from this table
--- Cart entries are given the ID's for these entries when a hold is requested, if the entry is gone, the hold has expired
-CREATE TABLE {prefix}reg_time_pending (
-    id INT NOT NULL AUTO_INCREMENT,
-    reg_event INT NULL,                                         -- Pointer to reg_event table
-    reg_time INT NULL,                                          -- ID of time record
-    expire_time DATETIME NULL,                                                                 -- Time at which this hold expires
-    PRIMARY KEY (id),
-    INDEX (reg_event),
-    INDEX (event_time)
-);
-
-----
-
--- 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. If false then guest request (prior to checkout)
-    validated BOOLEAN NULL,                                     -- Flag that indicates if request passed last validation with checkRegistrationRequest()
-    validation_message TEXT NULL,                               -- Reasons that request did not pass validation with checkRegistrationRequest() - Serialized array
-    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
-    reg_event INT NULL,                                         -- Pointer to reg_event
-    event_name TINYTEXT NULL,                                   -- Name of Event so it will always be in the cart data
-    reg_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 (reg_event),
-    INDEX (reg_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)
-    reg_event INT NULL,                                         -- Pointer to reg_event entry
-    event_name TINYTEXT NULL,                                   -- Name of Event so it will always be in the cart data
-    reg_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
-    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 - False (0) if registration class no longer exits
-    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 (reg_event),
-    INDEX (reg_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)
-    reg_event INT NULL,                                         -- Pointer to reg_event entry
-    event_name TINYTEXT NULL,                                   -- Name of Event so it will always be in the cart data
-    reg_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
-    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 - False (0) if registration rate no longer exists
-    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 (reg_event),
-    INDEX (reg_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
-    reg_event INT NULL,                                         -- Pointer to reg_event entry
-    event_name TINYTEXT NULL,                                   -- Name of Event so it will always be in the cart data
-    reg_time INT NULL,                                          -- Pointer reg_time entry
-    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) - False (0) if account no longer exists or registrant account not needed
-    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 
-    reg_request_hold_not_available BOOLEAN NULL,                -- No registrant slot available for this registrant - Unable to get hold
-    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 (reg_event),
-    INDEX (reg_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.11.sql b/setup/databaseScripts/create_database_V0.0.11.sql
new file mode 100644 (file)
index 0000000..015fa04
--- /dev/null
@@ -0,0 +1,836 @@
+-- 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 an event is selected to offer registrations
+CREATE TABLE {prefix}reg_event (
+    id INT NOT NULL AUTO_INCREMENT,
+    event INT NULL,                                             -- Pointer to event in Events add-on - False if event record in Events add-on no longer exists
+    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 logged in Admin user for this event and this is true then admin user may enter registrations even if active is off.
+    active BOOLEAN NULL,                                        -- Active flag to indicate that this event is available for registrations
+    time_specific BOOLEAN NULL,                                                                        -- Registration for this event is not date/time specific. Can attend any date/time of event.
+    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)
+-- A pseudo entry is created if registration is not date/time sensitive for this event. The pseudo entry does not point to an event time. 
+-- 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,                                        -- ID of events times table entry in Events add-on - If false (0), then this is a pseudo entry to use for all registrations (non-date/time specific)
+    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 checked out and attendees slots held)  
+    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),
+    INDEX (event_time),
+    INDEX (start_datetime)
+);
+
+----
+
+-- Pending Attendees - In carts but not checked out
+-- Attendee counts may be held for a particular reg_time entry for carts that have not been checked out 
+-- These are held for reg_event reg_hold_minutes, afterwhich they are timed out and removed from this table
+-- Cart entries are given the ID's for these entries when a hold is requested, if the entry is gone, the hold has expired
+CREATE TABLE {prefix}reg_time_pending (
+    id INT NOT NULL AUTO_INCREMENT,
+    reg_event INT NULL,                                         -- Pointer to reg_event table
+    reg_time INT NULL,                                          -- ID of time record
+    expire_time DATETIME NULL,                                                                 -- Time at which this hold expires
+    PRIMARY KEY (id),
+    INDEX (reg_event),
+    INDEX (event_time)
+);
+
+----
+
+-- 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
+    validated BOOLEAN NULL,                                     -- Flag indicating that the account has been validated - Set to false when recovering password
+    validation_code TINYTEXT NULL,                              -- Validation code and timestamp ("{validation code}-{timestamp}) - Clear this after validation
+    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. If false then guest request (prior to checkout)
+    validated BOOLEAN NULL,                                     -- Flag that indicates if request passed last validation with checkRegistrationRequest()
+    validation_message TEXT NULL,                               -- Reasons that request did not pass validation with checkRegistrationRequest() - Serialized array
+    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
+    reg_event INT NULL,                                         -- Pointer to reg_event
+    event_name TINYTEXT NULL,                                   -- Name of Event so it will always be in the cart data
+    reg_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 (reg_event),
+    INDEX (reg_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)
+    reg_event INT NULL,                                         -- Pointer to reg_event entry
+    event_name TINYTEXT NULL,                                   -- Name of Event so it will always be in the cart data
+    reg_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
+    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 - False (0) if registration class no longer exits
+    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 (reg_event),
+    INDEX (reg_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)
+    reg_event INT NULL,                                         -- Pointer to reg_event entry
+    event_name TINYTEXT NULL,                                   -- Name of Event so it will always be in the cart data
+    reg_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
+    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 - False (0) if registration rate no longer exists
+    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 (reg_event),
+    INDEX (reg_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
+    reg_event INT NULL,                                         -- Pointer to reg_event entry
+    event_name TINYTEXT NULL,                                   -- Name of Event so it will always be in the cart data
+    reg_time INT NULL,                                          -- Pointer reg_time entry
+    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) - False (0) if account no longer exists or registrant account not needed
+    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 
+    reg_request_hold_not_available BOOLEAN NULL,                -- No registrant slot available for this registrant - Unable to get hold
+    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 (reg_event),
+    INDEX (reg_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 7ad380a..7efff20 100644 (file)
@@ -23,7 +23,8 @@ $glmMembersRegistrationsDbVersions = array(
     '0.0.7' => array('version' => '0.0.7', 'tables' => 19, 'date' => '04/07/2017'),
     '0.0.8' => array('version' => '0.0.8', 'tables' => 19, 'date' => '04/18/2017'),
     '0.0.9' => array('version' => '0.0.9', 'tables' => 19, 'date' => '04/24/2017'),
-    '0.0.10' => array('version' => '0.0.10', 'tables' => 20, 'date' => '04/25/2017')
+    '0.0.10' => array('version' => '0.0.10', 'tables' => 20, 'date' => '04/25/2017'),
+    '0.0.11' => array('version' => '0.0.11', 'tables' => 20, 'date' => '04/29/2017')
 );
 
 
diff --git a/setup/databaseScripts/drop_database_V0.0.10.sql b/setup/databaseScripts/drop_database_V0.0.10.sql
deleted file mode 100644 (file)
index ef68960..0000000
+++ /dev/null
@@ -1,28 +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_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/drop_database_V0.0.11.sql b/setup/databaseScripts/drop_database_V0.0.11.sql
new file mode 100644 (file)
index 0000000..92113cd
--- /dev/null
@@ -0,0 +1,29 @@
+-- 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_time_pending,
+    {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.11.sql b/setup/databaseScripts/update_database_V0.0.11.sql
new file mode 100644 (file)
index 0000000..6d88580
--- /dev/null
@@ -0,0 +1,14 @@
+-- Gaslight Media Members Database  - Registratiuons Add-On
+-- File Created: 08/24/17 09:47:15
+-- Database Version: 0.0.11
+-- 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
+
+ALTER TABLE {prefix}account ADD COLUMN validated BOOLEAN;
+
+----
+
+ALTER TABLE {prefix}account ADD COLUMN validation_code TINYTEXT;
+
index bd9bab0..40860fa 100644 (file)
        <p class="glm-error">{$reason}</p>
 {else}
 
+    <h2 class="nav-tab-wrapper" style="margin-bottom: 1em;">
+        <a id="glm-registrations-settings" data-show-table="glm-table-settings" class="glm-registrations-tab nav-tab">Event Registration Settings</a>
+        <a id="glm-registrations-levels" data-show-table="glm-table-levels" class="glm-registrations-tab nav-tab">Registration Levels & Charges</a>
+    </h2>
+
 
        <a href="{$thisUrl}?page={$thisPage}&option=dashboard&regEventID={$regEventID}"
        class="button button-secondary glm-button glm-right">Return to Dashboard</a>
            <input type="hidden" name="option" value="update">
            <input type="hidden" name="regEventID" value="{$regEventID}">
 
-        <table id="glm-table-account" class="glm-admin-table">
-
-        <tr>
-            <th {if $regEvent.fieldRequired.event_name}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Event Name</th>
-            <td {if $regEvent.fieldFail.event_name}class="glm-form-bad-input" data-tabid="glm-event_name"{/if}>
-                <input type="text" name="event_name" value="{$regEvent.fieldData.event_name}" class="glm-form-text-input-medium">
-            {if $regEvent.fieldFail.event_name}<p>{$regEvent.fieldFail.event_name}</p>{/if}<br>
-            </td>
-        </tr>
-        <tr>
-            <th {if $regEvent.fieldRequired.event_code}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Event Registration Code</th>
-            <td {if $regEvent.fieldFail.event_code}class="glm-form-bad-input" data-tabid="glm-event_code"{/if}>
-                <input type="text" name="event_code" value="{$regEvent.fieldData.event_code}" class="glm-form-text-input-medium">
-            {if $regEvent.fieldFail.event_code}<p>{$regEvent.fieldFail.event_code}</p>{/if}<br>
-            </td>
-        </tr>
-        <tr>
-            <th {if $regEvent.fieldRequired.notify_email}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Notify E-Mail Address</th>
-            <td {if $regEvent.fieldFail.notify_email}class="glm-form-bad-input" data-tabid="glm-notify_email"{/if}>
-                <input type="text" name="notify_email" value="{$regEvent.fieldData.notify_email}" class="glm-form-text-input-medium">
-            {if $regEvent.fieldFail.notify_email}<p>{$regEvent.fieldFail.notify_email}</p>{/if}<br>
-            </td>
-        </tr>
-        <tr>
-            <th {if $regEvent.fieldRequired.admin_active}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Admin Active</th>
-            <td {if $regEvent.fieldFail.admin_active}class="glm-form-bad-input" data-tabid="glm-admin_active"{/if}>
-                <input type="checkbox" name="active" {if $regEvent.fieldData.admin_active.value} checked{/if}>
-            {if $regEvent.fieldFail.admin_active}<p>{$regEvent.fieldFail.admin_active}</p>{/if}<br>
-            </td>
-        </tr>
-        <tr>
-            <th {if $regEvent.fieldRequired.time_specific}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Date/Time Specific Registrations</th>
-            <td {if $regEvent.fieldFail.time_specific}class="glm-form-bad-input" data-tabid="glm-time_specific"{/if}>
-               <input type="checkbox" name="time_specific" {if $regEvent.fieldData.time_specific.value} checked{/if}>
-               Check this box for events where registrations are for specific dates and times.
-            {if $regEvent.fieldFail.time_specific}<p>{$regEvent.fieldFail.time_specific}</p>{/if}<br>
-            </td>
-        </tr>
-        <tr>
-            <th {if $regEvent.fieldRequired.active}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Registrations Active</th>
-            <td {if $regEvent.fieldFail.active}class="glm-form-bad-input" data-tabid="glm-active"{/if}>
-                <input type="checkbox" name="active" {if $regEvent.fieldData.active.value} checked{/if}>
-            {if $regEvent.fieldFail.active}<p>{$regEvent.fieldFail.active}</p>{/if}<br>
-            </td>
-        </tr>
-        <tr>
-            <th {if $regEvent.fieldRequired.attendees}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Multiple Attendees per Submission</th>
-            <td {if $regEvent.fieldFail.attendees}class="glm-form-bad-input" data-tabid="glm-attendees"{/if}>
-                <input type="checkbox" name="active" {if $regEvent.fieldData.attendees.value} checked{/if}>
-            {if $regEvent.fieldFail.attendees}<p>{$regEvent.fieldFail.attendees}</p>{/if}<br>
-            </td>
-        </tr>
-        <tr>
-            <th {if $regEvent.fieldRequired.attendee_max}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Maximum # of Attendees</th>
-            <td {if $regEvent.fieldFail.attendee_max}class="glm-form-bad-input" data-tabid="glm-attendee_max"{/if}>
-               Set to 0 to permit an unlimited number of attendees for this event.<br>
-                <input type="text" name="attendee_max" value="{$regEvent.fieldData.attendee_max}" class="glm-form-text-input-medium">
-            {if $regEvent.fieldFail.attendee_max}<p>{$regEvent.fieldFail.attendee_max}</p>{/if}<br>
-            </td>
-        </tr>
-        <tr>
-            <th {if $regEvent.fieldRequired.attendee_max_per_reg}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Maximum # of Attendees Per Submission</th>
-            <td {if $regEvent.fieldFail.attendee_max_per_reg}class="glm-form-bad-input" data-tabid="glm-attendee_max_per_reg"{/if}>
-               Set to 0 for to permit a user to register an unlimited number of attendees for this event at one time.<br>
-                <input type="text" name="attendee_max_per_reg" value="{$regEvent.fieldData.attendee_max_per_reg}" class="glm-form-text-input-medium">
-            {if $regEvent.fieldFail.attendee_max_per_reg}<p>{$regEvent.fieldFail.attendee_max_per_reg}</p>{/if}<br>
-            </td>
-        </tr>
-        <tr>
-            <th {if $regEvent.fieldRequired.reg_hold_minutes}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Attendees Hold Time (minutes)</th>
-            <td {if $regEvent.fieldFail.reg_hold_minutes}class="glm-form-bad-input" data-tabid="glm-reg_hold_minutes"{/if}>
-               When an attendee is added to a registration request, the system will hold that attendee "slot" for this number of minutes
-               before releasing it for others to register. After the attendee slot is released, the slot will be requested again each 
-               time the selection, cart, or checkout pages are loaded. If there is a slot available at that time, it will again be held
-               for this amount of time.<br>
-                <input type="text" name="reg_hold_minutes" value="{$regEvent.fieldData.reg_hold_minutes}" class="glm-form-text-input-medium">
-            {if $regEvent.fieldFail.reg_hold_minutes}<p>{$regEvent.fieldFail.reg_hold_minutes}</p>{/if}<br>
-            </td>
-        </tr>
-        <tr>
-            <th {if $regEvent.fieldRequired.cart_hold_days}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Cart Hold (days)</th>
-            <td {if $regEvent.fieldFail.cart_hold_days}class="glm-form-bad-input" data-tabid="glm-cart_hold_days"{/if}>
-               If the user has registrations entered but has not yet checked out, their "cart" will be maintained for this number of days.
-               After that time, the card will be deleted. If a user has established a registrations account (entered registrations or
-               have been registered before, the user will be able log in and continue with the cart up to this number of days.<br> 
-                <input type="text" name="cart_hold_days" value="{$regEvent.fieldData.cart_hold_days}" class="glm-form-text-input-medium">
-            {if $regEvent.fieldFail.cart_hold_days}<p>{$regEvent.fieldFail.cart_hold_days}</p>{/if}<br>
-            </td>
-        </tr>
-        <tr>
-            <th {if $regEvent.fieldRequired.registration_account_options}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Account Options</th>
-            <td {if $regEvent.fieldFail.registration_account_options}class="glm-form-bad-input" data-tabid="glm-registration_account_options"{/if}>
-    {foreach from=$regEvent.fieldData.registration_account_options.bitmap item=v}
-                    <input type="checkbox" name="registration_account_options[{$v.value}]" value="{$v.value}"{if $v.default} checked{/if}> {$v.name}<br>
-    {/foreach}
-            {if $regEvent.fieldFail.registration_account_options}<p>{$regEvent.fieldFail.registration_account_options}</p>{/if}<br>
-            </td>
-        </tr>
-        <tr>
-            <th {if $regEvent.fieldRequired.payment_methods}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Payment Methods</th>
-            <td {if $regEvent.fieldFail.payment_methods}class="glm-form-bad-input" data-tabid="glm-payment_methods"{/if}>
-               Checking a payment method makes it available for use by regular users at checkout.<br>
-    {foreach from=$regEvent.fieldData.payment_methods.bitmap item=v}
-                    <input type="checkbox" name="payment_methods[{$v.value}]" value="{$v.value}"{if $v.default} checked{/if}> {$v.name}<br>
-    {/foreach}
-            {if $regEvent.fieldFail.payment_methods}<p>{$regEvent.fieldFail.payment_methods}</p>{/if}<br>
-            </td>
-        </tr>
-        <tr>
-            <th {if $regEvent.fieldRequired.restricted_payment_methods}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Restricted Payment Methods</th>
-            <td {if $regEvent.fieldFail.restricted_payment_methods}class="glm-form-bad-input" data-tabid="glm-restricted_payment_methods"{/if}>
-               Restricted payment methods are those only available to logged in administrative users. For example, selecting "No Charge" here
-               will allow administrative users to check out without having to provide any payment information.<br>
-    {foreach from=$regEvent.fieldData.restricted_payment_methods.bitmap item=v}
-                    <input type="checkbox" name="restricted_payment_methods[{$v.value}]" value="{$v.value}"{if $v.default} checked{/if}> {$v.name}<br>
-    {/foreach}
-            {if $regEvent.fieldFail.restricted_payment_methods}<p>{$regEvent.fieldFail.restricted_payment_methods}</p>{/if}<br>
-            </td>
-        </tr>
-        <tr>
-            <th {if $regEvent.fieldRequired.terms}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Terms and Conditions for Registration</th>
-            <td {if $regEvent.fieldFail.terms}class="glm-form-bad-input" data-tabid="glm-terms"{/if}>
-                   <textarea name="terms" class="glm-form-textarea">{$regEvent.fieldData.terms}</textarea>
-            {if $regEvent.fieldFail.terms}
-                <p>{$regEvent.fieldFail.terms}</p>
-            {/if}<br>
-            </td>
-        </tr>
-        <tr>
-            <th {if $regEvent.fieldRequired.reg_file}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>File</th>
-            <td {if $regEvent.fieldFail.reg_file}class="glm-form-bad-input"{/if}>
-    {if $regEvent.fieldData.reg_file}
-                <span class="glm-right">Replace this file:</b> <input type="file" name="reg_file_new"></span>
-                <a href="{$glmPluginMediaUrl}/files/{$regEvent.fieldData.reg_file}" target="event_file">{$regEvent.fieldData.reg_file}</a>&nbsp;&nbsp;&nbsp;
-                <input type="checkbox" name="reg_file_delete"> Delete File<br>
-    {else}
-                New file:</b> <input type="file" name="reg_file_new">
-    {/if}
-            </td>
-        </tr>
-        <tr>
-            <th {if $regEvent.fieldRequired.reg_file_title}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>File Title</th>
-            <td {if $regEvent.fieldFail.reg_file_title}class="glm-form-bad-input" data-tabid="glm-reg_file_title"{/if}>
-                <input type="text" name="reg_file_title" value="{$regEvent.fieldData.reg_file_title}" class="glm-form-text-input-medium">
-            {if $regEvent.fieldFail.reg_file_title}<p>{$regEvent.fieldFail.reg_file_title}</p>{/if}<br>
-            </td>
-        </tr>
-        <tr>
-            <th {if $regEvent.fieldRequired.notes}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Notes</th>
-            <td {if $regEvent.fieldFail.notes}class="glm-form-bad-input" data-tabid="glm-notes"{/if}>
-                   <textarea name="notes" class="glm-form-textarea">{$regEvent.fieldData.notes}</textarea>
-            {if $regEvent.fieldFail.notes}
-                <p>{$regEvent.fieldFail.notes}</p>
-            {/if}<br>
-            </td>
-        </tr>
-        </table>
+NEED TO ADD TESTS FOR CHANGES IN INPUT<br>
+
+        {**** General Settings for Event ****}
+        {include file='admin/registrations/eventEditSettings.html'}
         
-        <input id="updateRegEvent" type="submit" value="Update Registrations for this event">
+        {**** Registration Levels and Charges for Event ****}
+        {include file='admin/registrations/eventEditLevels.html'}
+        
+        <p><input id="updateRegEvent" type="submit" value="Update Registrations for this event"></p>
         
     </form>
 
        <script type="text/javascript">
                jQuery(document).ready(function($) {
            
+            /*
+             * Edit area tabs
+             */
+            $('.glm-registrations-tab').click( function() {
+                glmSetupAreaTab($(this));
+            });
+
+            // Do inital setup on load for first tab
+            glmSetupAreaTab($('#glm-registrations-settings'));
+
+            // Setup edit area selected
+            function glmSetupAreaTab(t) {
+
+                // Clear table highlights and hide all tables
+                $('.glm-registrations-tab').removeClass('nav-tab-active');
+                $('.glm-registrations-table').addClass('glm-hidden');
+
+                // Highlight selected tab
+                t.addClass('nav-tab-active');
+
+                // Show selected table
+                var table = t.attr('data-show-table');
+                $('#' + table).removeClass('glm-hidden');
+
+
+                if ({$settings.memb_info_location}) {
+
+                    if (table == 'glm-table-profile') {
+                        initMap();
+                    }
+
+                }
+
+            }
+
                        // Flash certain elements for a short time after display
             $(".glm-flash-updated").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500);
                        
diff --git a/views/admin/registrations/eventEditLevels.html b/views/admin/registrations/eventEditLevels.html
new file mode 100644 (file)
index 0000000..e91dad4
--- /dev/null
@@ -0,0 +1,58 @@
+
+{**** Registration Levels and Charges for Event ****}
+
+        <table id="glm-table-levels" class="glm-registrations-table">
+
+{* Event Registration App - Backbone.js *}
+<div id="eventapp"></div>
+{* Underscore Templates for the Event Registration App *}
+{literal}
+<script type="text/template" id="regEvent-template">
+    <h2><%= event_name %></h2>
+    <div class="glm-reg-compcode-entry">
+        <input type="text" placeholder="Enter Comp Code Here" />
+    </div>
+    <p> - event description - </p>
+    <div class="glm-reg-entryforms clearfix">
+        <div class="glm-reg-dates">
+            <h4>Pick your registration dates</h4>
+            <input type="date" placeholder="Enter Date" />
+            <input type="text" placeholder="Enter Time" />
+        </div>
+        <div class="glm-reg-submit">
+            <input type="submit" value="Continue to Cart" />
+        </div>
+    </div>
+</script>
+<script type="text/template" id="regClass-template">
+    <h3><%= name %></h3>
+    <p><%= descr %></p>
+    <div class="registrant-add clearfix">
+        <input type="text" class="addName" placeholder="Enter Name">
+        <input type="text" class="addEmail" placeholder="Enter Email Address">
+        <input type="submit" class="addRegistrant" value="Add">
+    </div>
+</script>
+{/literal}
+<div class="glm-reg-event-list" id="regApp">
+    <div class="glm-reg-account">
+        <a class="glm-reg-account-login" id="appLogin">Login</a>
+    </div>
+</div>
+{* Bootstrap the models needed on page load *}
+{* Need to have RegEvent model created *}
+{* And create the RegClasses collection *}
+<script>
+var app = {
+    Models: {},
+    Collections: {},
+    Views: {}
+};
+jQuery(function($){
+//    app.Models.regEvent = new app.Models.RegEvent;
+//    app.Models.regEvent.set( {$regEventJSON} );
+//    app.Models.regEvent.setClasses( {$regClassesJSON} );
+//    new app.Views.App();
+});
+</script>
+
diff --git a/views/admin/registrations/eventEditSettings.html b/views/admin/registrations/eventEditSettings.html
new file mode 100644 (file)
index 0000000..fef7ce4
--- /dev/null
@@ -0,0 +1,160 @@
+
+{**** General Settings for Event ****}
+
+        <table id="glm-table-settings" class="glm-registrations-table">
+    
+            <tr>
+                <th {if $regEvent.fieldRequired.event_name}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Event Name</th>
+                <td {if $regEvent.fieldFail.event_name}class="glm-form-bad-input" data-tabid="glm-event_name"{/if}>
+                    <input type="text" name="event_name" value="{$regEvent.fieldData.event_name}" class="glm-form-text-input-medium">
+                {if $regEvent.fieldFail.event_name}<p>{$regEvent.fieldFail.event_name}</p>{/if}<br>
+                </td>
+            </tr>
+            <tr>
+                <th {if $regEvent.fieldRequired.event_code}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Event Registration Code</th>
+                <td {if $regEvent.fieldFail.event_code}class="glm-form-bad-input" data-tabid="glm-event_code"{/if}>
+                    <input type="text" name="event_code" value="{$regEvent.fieldData.event_code}" class="glm-form-text-input-medium">
+                {if $regEvent.fieldFail.event_code}<p>{$regEvent.fieldFail.event_code}</p>{/if}<br>
+                </td>
+            </tr>
+            <tr>
+                <th {if $regEvent.fieldRequired.notify_email}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Notify E-Mail Address</th>
+                <td {if $regEvent.fieldFail.notify_email}class="glm-form-bad-input" data-tabid="glm-notify_email"{/if}>
+                    <input type="text" name="notify_email" value="{$regEvent.fieldData.notify_email}" class="glm-form-text-input-medium">
+                {if $regEvent.fieldFail.notify_email}<p>{$regEvent.fieldFail.notify_email}</p>{/if}<br>
+                </td>
+            </tr>
+            <tr>
+                <th {if $regEvent.fieldRequired.admin_active}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Admin Active</th>
+                <td {if $regEvent.fieldFail.admin_active}class="glm-form-bad-input" data-tabid="glm-admin_active"{/if}>
+                    <input type="checkbox" name="active" {if $regEvent.fieldData.admin_active.value} checked{/if}>
+                {if $regEvent.fieldFail.admin_active}<p>{$regEvent.fieldFail.admin_active}</p>{/if}<br>
+                </td>
+            </tr>
+            <tr>
+                <th {if $regEvent.fieldRequired.time_specific}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Date/Time Specific Registrations</th>
+                <td {if $regEvent.fieldFail.time_specific}class="glm-form-bad-input" data-tabid="glm-time_specific"{/if}>
+                       <input type="checkbox" name="time_specific" {if $regEvent.fieldData.time_specific.value} checked{/if}>
+                       Check this box for events where registrations are for specific dates and times.
+                {if $regEvent.fieldFail.time_specific}<p>{$regEvent.fieldFail.time_specific}</p>{/if}<br>
+                </td>
+            </tr>
+            <tr>
+                <th {if $regEvent.fieldRequired.active}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Registrations Active</th>
+                <td {if $regEvent.fieldFail.active}class="glm-form-bad-input" data-tabid="glm-active"{/if}>
+                    <input type="checkbox" name="active" {if $regEvent.fieldData.active.value} checked{/if}>
+                {if $regEvent.fieldFail.active}<p>{$regEvent.fieldFail.active}</p>{/if}<br>
+                </td>
+            </tr>
+            <tr>
+                <th {if $regEvent.fieldRequired.attendees}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Multiple Attendees per Submission</th>
+                <td {if $regEvent.fieldFail.attendees}class="glm-form-bad-input" data-tabid="glm-attendees"{/if}>
+                    <input type="checkbox" name="active" {if $regEvent.fieldData.attendees.value} checked{/if}>
+                {if $regEvent.fieldFail.attendees}<p>{$regEvent.fieldFail.attendees}</p>{/if}<br>
+                </td>
+            </tr>
+            <tr>
+                <th {if $regEvent.fieldRequired.attendee_max}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Maximum # of Attendees</th>
+                <td {if $regEvent.fieldFail.attendee_max}class="glm-form-bad-input" data-tabid="glm-attendee_max"{/if}>
+                       Set to 0 to permit an unlimited number of attendees for this event.<br>
+                    <input type="text" name="attendee_max" value="{$regEvent.fieldData.attendee_max}" class="glm-form-text-input-medium">
+                {if $regEvent.fieldFail.attendee_max}<p>{$regEvent.fieldFail.attendee_max}</p>{/if}<br>
+                </td>
+            </tr>
+            <tr>
+                <th {if $regEvent.fieldRequired.attendee_max_per_reg}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Maximum # of Attendees Per Submission</th>
+                <td {if $regEvent.fieldFail.attendee_max_per_reg}class="glm-form-bad-input" data-tabid="glm-attendee_max_per_reg"{/if}>
+                       Set to 0 for to permit a user to register an unlimited number of attendees for this event at one time.<br>
+                    <input type="text" name="attendee_max_per_reg" value="{$regEvent.fieldData.attendee_max_per_reg}" class="glm-form-text-input-medium">
+                {if $regEvent.fieldFail.attendee_max_per_reg}<p>{$regEvent.fieldFail.attendee_max_per_reg}</p>{/if}<br>
+                </td>
+            </tr>
+            <tr>
+                <th {if $regEvent.fieldRequired.reg_hold_minutes}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Attendees Hold Time (minutes)</th>
+                <td {if $regEvent.fieldFail.reg_hold_minutes}class="glm-form-bad-input" data-tabid="glm-reg_hold_minutes"{/if}>
+                       When an attendee is added to a registration request, the system will hold that attendee "slot" for this number of minutes
+                       before releasing it for others to register. After the attendee slot is released, the slot will be requested again each 
+                       time the selection, cart, or checkout pages are loaded. If there is a slot available at that time, it will again be held
+                       for this amount of time.<br>
+                    <input type="text" name="reg_hold_minutes" value="{$regEvent.fieldData.reg_hold_minutes}" class="glm-form-text-input-medium">
+                {if $regEvent.fieldFail.reg_hold_minutes}<p>{$regEvent.fieldFail.reg_hold_minutes}</p>{/if}<br>
+                </td>
+            </tr>
+            <tr>
+                <th {if $regEvent.fieldRequired.cart_hold_days}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Cart Hold (days)</th>
+                <td {if $regEvent.fieldFail.cart_hold_days}class="glm-form-bad-input" data-tabid="glm-cart_hold_days"{/if}>
+                       If the user has registrations entered but has not yet checked out, their "cart" will be maintained for this number of days.
+                       After that time, the card will be deleted. If a user has established a registrations account (entered registrations or
+                       have been registered before, the user will be able log in and continue with the cart up to this number of days.<br> 
+                    <input type="text" name="cart_hold_days" value="{$regEvent.fieldData.cart_hold_days}" class="glm-form-text-input-medium">
+                {if $regEvent.fieldFail.cart_hold_days}<p>{$regEvent.fieldFail.cart_hold_days}</p>{/if}<br>
+                </td>
+            </tr>
+            <tr>
+                <th {if $regEvent.fieldRequired.registration_account_options}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Account Options</th>
+                <td {if $regEvent.fieldFail.registration_account_options}class="glm-form-bad-input" data-tabid="glm-registration_account_options"{/if}>
+        {foreach from=$regEvent.fieldData.registration_account_options.bitmap item=v}
+                        <input type="checkbox" name="registration_account_options[{$v.value}]" value="{$v.value}"{if $v.default} checked{/if}> {$v.name}<br>
+        {/foreach}
+                {if $regEvent.fieldFail.registration_account_options}<p>{$regEvent.fieldFail.registration_account_options}</p>{/if}<br>
+                </td>
+            </tr>
+            <tr>
+                <th {if $regEvent.fieldRequired.payment_methods}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Payment Methods</th>
+                <td {if $regEvent.fieldFail.payment_methods}class="glm-form-bad-input" data-tabid="glm-payment_methods"{/if}>
+                       Checking a payment method makes it available for use by regular users at checkout.<br>
+        {foreach from=$regEvent.fieldData.payment_methods.bitmap item=v}
+                        <input type="checkbox" name="payment_methods[{$v.value}]" value="{$v.value}"{if $v.default} checked{/if}> {$v.name}<br>
+        {/foreach}
+                {if $regEvent.fieldFail.payment_methods}<p>{$regEvent.fieldFail.payment_methods}</p>{/if}<br>
+                </td>
+            </tr>
+            <tr>
+                <th {if $regEvent.fieldRequired.restricted_payment_methods}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Restricted Payment Methods</th>
+                <td {if $regEvent.fieldFail.restricted_payment_methods}class="glm-form-bad-input" data-tabid="glm-restricted_payment_methods"{/if}>
+                       Restricted payment methods are those only available to logged in administrative users. For example, selecting "No Charge" here
+                       will allow administrative users to check out without having to provide any payment information.<br>
+        {foreach from=$regEvent.fieldData.restricted_payment_methods.bitmap item=v}
+                        <input type="checkbox" name="restricted_payment_methods[{$v.value}]" value="{$v.value}"{if $v.default} checked{/if}> {$v.name}<br>
+        {/foreach}
+                {if $regEvent.fieldFail.restricted_payment_methods}<p>{$regEvent.fieldFail.restricted_payment_methods}</p>{/if}<br>
+                </td>
+            </tr>
+            <tr>
+                <th {if $regEvent.fieldRequired.terms}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Terms and Conditions for Registration</th>
+                <td {if $regEvent.fieldFail.terms}class="glm-form-bad-input" data-tabid="glm-terms"{/if}>
+                   <textarea name="terms" class="glm-form-textarea">{$regEvent.fieldData.terms}</textarea>
+                {if $regEvent.fieldFail.terms}
+                    <p>{$regEvent.fieldFail.terms}</p>
+                {/if}<br>
+                </td>
+            </tr>
+            <tr>
+                <th {if $regEvent.fieldRequired.reg_file}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>File</th>
+                <td {if $regEvent.fieldFail.reg_file}class="glm-form-bad-input"{/if}>
+        {if $regEvent.fieldData.reg_file}
+                    <span class="glm-right">Replace this file:</b> <input type="file" name="reg_file_new"></span>
+                    <a href="{$glmPluginMediaUrl}/files/{$regEvent.fieldData.reg_file}" target="event_file">{$regEvent.fieldData.reg_file}</a>&nbsp;&nbsp;&nbsp;
+                    <input type="checkbox" name="reg_file_delete"> Delete File<br>
+        {else}
+                    New file:</b> <input type="file" name="reg_file_new">
+        {/if}
+                </td>
+            </tr>
+            <tr>
+                <th {if $regEvent.fieldRequired.reg_file_title}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>File Title</th>
+                <td {if $regEvent.fieldFail.reg_file_title}class="glm-form-bad-input" data-tabid="glm-reg_file_title"{/if}>
+                    <input type="text" name="reg_file_title" value="{$regEvent.fieldData.reg_file_title}" class="glm-form-text-input-medium">
+                {if $regEvent.fieldFail.reg_file_title}<p>{$regEvent.fieldFail.reg_file_title}</p>{/if}<br>
+                </td>
+            </tr>
+            <tr>
+                <th {if $regEvent.fieldRequired.notes}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Notes</th>
+                <td {if $regEvent.fieldFail.notes}class="glm-form-bad-input" data-tabid="glm-notes"{/if}>
+                   <textarea name="notes" class="glm-form-textarea">{$regEvent.fieldData.notes}</textarea>
+                {if $regEvent.fieldFail.notes}
+                    <p>{$regEvent.fieldFail.notes}</p>
+                {/if}<br>
+                </td>
+            </tr>
+        </table>
index 3cc1773..11f6006 100644 (file)
@@ -1,12 +1,5 @@
 <div class="wrap">
     <h2>Event Registrations</h2>
-    <h2 class="nav-tab-wrapper">
-        <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-index" class="nav-tab{if $thisAction==index} nav-tab-active{/if}">Registrations Dashboard</a>
-        <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-list" class="nav-tab{if $thisAction==list} nav-tab-active{/if}">Registration Events List</a>
-        <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-event" class="nav-tab{if $thisAction==event} nav-tab-active{/if}">Selected Event Dashboard</a>
-        <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-requests" class="nav-tab{if $thisAction==requests} nav-tab-active{/if}">Registration Requests</a>
-        <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-accounts" class="nav-tab{if $thisPage=='glm-members-admin-menu-registrations-accounts'} nav-tab-active{/if}">Account List</a>
-    </h2>
     <div id="glm-admin-content-container">