From: Steve Sutton Date: Thu, 21 Sep 2017 17:07:05 +0000 (-0400) Subject: Working on the reg_request X-Git-Tag: v1.0.0^2~398 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=b091c073568128f56e656293dc244a97090fd7be;p=WP-Plugins%2Fglm-member-db-registrations.git Working on the reg_request Creating a reg_request so I can add the registrant. Adding now model and view for the registrant. --- diff --git a/css/front.css b/css/front.css index 8e62919..2b742cf 100644 --- a/css/front.css +++ b/css/front.css @@ -141,3 +141,11 @@ div.glm-reg-login h4 { .reg-class-accounts { padding: 5px; } +.new-reg { + background-color: white; + border: 1px solid black; + padding: 30px; + position: absolute; + left: 10px; + top: 50px; +} diff --git a/js/collections/front/accounts.js b/js/collections/front/accounts.js index f52c837..f24f5bd 100644 --- a/js/collections/front/accounts.js +++ b/js/collections/front/accounts.js @@ -4,9 +4,9 @@ app.Collections.Front.Accounts = Backbone.Collection.extend({ model: app.Models.Front.Account, - initialize: function( parent ){ - this.parent = parent; - }, + // initialize: function( parent ){ + // this.parent = parent; + // }, url: ajaxUrl+'&glm_action=regFront&collection=accounts', @@ -17,30 +17,30 @@ app.Collections.Front.Accounts = Backbone.Collection.extend({ // //this.add( model ); // }, - remove: function( model ){ - localStorage.removeItem( localStorage.key('Account-' + model.parent + '-'+ model.id ) ); - //console.log( 'Delete called in collection ' ); - }, + // remove: function( model ){ + // //localStorage.removeItem( localStorage.key('Account-' + model.parent + '-'+ model.id ) ); + // //console.log( 'Delete called in collection ' ); + // }, - read: function(){ - console.log( 'Read called' ); - }, + // read: function(){ + // console.log( 'Read called' ); + // }, // save: function(){ // console.log('Update Called'); // }, - fetch: function(){ - var newModels = []; - for ( var i = 0; i < localStorage.length; i++ ) { - var curItem = JSON.parse( localStorage.getItem( localStorage.key( i ) ) ); - if ( curItem.parent === this.parent ) { - // now add it to this collection - newModels.push( new app.Models.Front.Account( curItem ) ); - } - } - this.reset( newModels ); - }, + // fetch: function(){ + // var newModels = []; + // for ( var i = 0; i < localStorage.length; i++ ) { + // var curItem = JSON.parse( localStorage.getItem( localStorage.key( i ) ) ); + // if ( curItem.parent === this.parent ) { + // // now add it to this collection + // newModels.push( new app.Models.Front.Account( curItem ) ); + // } + // } + // this.reset( newModels ); + // }, }); diff --git a/js/collections/front/regRequestRegistrants.js b/js/collections/front/regRequestRegistrants.js new file mode 100644 index 0000000..2e4e218 --- /dev/null +++ b/js/collections/front/regRequestRegistrants.js @@ -0,0 +1,6 @@ +app.Collections.Front.RegRequestRegistrants = Backbone.Collection.extend({ + model: app.Models.Front.RegRequestRegistrant, + + url: ajaxUrl+'&glm_action=regFront&collection=registrant=', + +}); diff --git a/js/frontRegApp.js b/js/frontRegApp.js index c136931..6b36e35 100644 --- a/js/frontRegApp.js +++ b/js/frontRegApp.js @@ -72,6 +72,8 @@ app.Models.Front.AccountDetail = app.Models.Front.Account.extend({ app.Models.Front.Cart = Backbone.Model.extend({ defaults: { + id: 0, + name: 'cart', status: null, errorMsg: '', notes: [], @@ -127,10 +129,12 @@ app.Models.Front.RegClass = Backbone.Model.extend({ // Defaults defaults: { + name: 'regClass', id: 0, reg_event: 0, name: '', descr: '', + reg_rate_id: 0, reg_rate_name: '', reg_rate_base_price: '', reg_rate_per_reg: '', @@ -138,8 +142,7 @@ app.Models.Front.RegClass = Backbone.Model.extend({ }, initialize: function(){ - this.accounts = new app.Collections.Front.Accounts( this.id ); - //this.accounts.fetch(); + this.registrants = new app.Collections.Front.RegRequestRegistrants( [] ); }, }); @@ -198,8 +201,33 @@ app.Models.Front.regRate = Backbone.Model.extend({ }); +app.Models.Front.RegRequestRegistrant = Backbone.Model.extend({ + defaults: { + name: 'registrant', + id: 0, + account: 0, + reg_event: 0, + reg_class: 0, + event_name: '', + reg_time: 0, + event_datetime: '', + reg_request: 0, + reg_request_event: 0, + reg_request_class: 0, + reg_request_rate: 0, + reg_request_hold: false, + reg_request_hold_not_available: false, + email: '', + fname: '', + lname: '', + }, + + url: ajaxUrl+'&glm_action=regFront&collection=registrant' +}); + app.Models.Front.Request = Backbone.Model.extend({ defaults: { + name: 'request', id: null, account: null, validated: false, @@ -241,9 +269,9 @@ app.Models.Front.Request = Backbone.Model.extend({ app.Collections.Front.Accounts = Backbone.Collection.extend({ model: app.Models.Front.Account, - initialize: function( parent ){ - this.parent = parent; - }, + // initialize: function( parent ){ + // this.parent = parent; + // }, url: ajaxUrl+'&glm_action=regFront&collection=accounts', @@ -254,30 +282,30 @@ app.Collections.Front.Accounts = Backbone.Collection.extend({ // //this.add( model ); // }, - remove: function( model ){ - localStorage.removeItem( localStorage.key('Account-' + model.parent + '-'+ model.id ) ); - //console.log( 'Delete called in collection ' ); - }, + // remove: function( model ){ + // //localStorage.removeItem( localStorage.key('Account-' + model.parent + '-'+ model.id ) ); + // //console.log( 'Delete called in collection ' ); + // }, - read: function(){ - console.log( 'Read called' ); - }, + // read: function(){ + // console.log( 'Read called' ); + // }, // save: function(){ // console.log('Update Called'); // }, - fetch: function(){ - var newModels = []; - for ( var i = 0; i < localStorage.length; i++ ) { - var curItem = JSON.parse( localStorage.getItem( localStorage.key( i ) ) ); - if ( curItem.parent === this.parent ) { - // now add it to this collection - newModels.push( new app.Models.Front.Account( curItem ) ); - } - } - this.reset( newModels ); - }, + // fetch: function(){ + // var newModels = []; + // for ( var i = 0; i < localStorage.length; i++ ) { + // var curItem = JSON.parse( localStorage.getItem( localStorage.key( i ) ) ); + // if ( curItem.parent === this.parent ) { + // // now add it to this collection + // newModels.push( new app.Models.Front.Account( curItem ) ); + // } + // } + // this.reset( newModels ); + // }, }); @@ -324,6 +352,13 @@ app.Collections.Front.RegRates = Backbone.Collection.extend({ // localStorage }); +app.Collections.Front.RegRequestRegistrants = Backbone.Collection.extend({ + model: app.Models.Front.RegRequestRegistrant, + + url: ajaxUrl+'&glm_action=regFront&collection=registrant=', + +}); + // js/views/account.js // Event Registrant View @@ -460,6 +495,48 @@ app.Views.Front.Login = Backbone.View.extend({ }); +app.Views.Front.NewRegistrant = Backbone.View.extend({ + tagName: 'div', + + className: 'new-reg', + + template: _.template( jQuery('#eventReg-registrant-add').html() ), + + events: { + 'click .add-new-registrant': 'addNew', + }, + + initialize: function(){ + return this; + }, + + addNew: function(){ + console.log( 'called addNew in newReg view' ); + var fname = this.$('.reg_fname').val().trim(); + var lname = this.$('.reg_lname').val().trim(); + var email = this.$('.reg_email').val().trim(); + console.log( 'email: ' + email + ' fname: ' + fname + ' lname: ' + lname ); + + // Create a account + // this.model.set({ + // fname: this.$('.reg_fname').val().trim(), + // lname: this.$('.reg_lname').val().trim(), + // email: this.$('.reg_email').val().trim(), + // }); + + + // Destroy the model and view + this.model.destroy(); + this.remove(); + }, + + render: function(){ + this.$el.html( this.template( this.model.toJSON() ) ); + return this; + }, + +}); + // js/views/regClass.js var newId = 0; app.Views.Front.RegClass = Backbone.View.extend({ @@ -470,23 +547,21 @@ app.Views.Front.RegClass = Backbone.View.extend({ template: _.template( jQuery('#regClass-template').html() ), initialize: function(){ - this.model.accounts.fetch(); - this.listenTo( this.model.accounts, 'add', this.addOne ); - this.listenTo( this.model.accounts, 'create', this.addOne ); - //this.listenTo( this.model.accounts, 'reset', this.addAll ); - //this.listenTo( this.model.accounts, 'all', this.render ); + this.listenTo( this.model.registrants, 'add', this.addOne ); + this.listenTo( this.model.registrants, 'create', this.addOne ); + this.listenTo( this.model.registrants, 'remove', this.deleteOne ); this.listenTo( this.model, 'change', this.render ); return this; }, render: function(){ - this.model.set({ reg_count: this.model.accounts.length }); + this.model.set({ reg_count: this.model.registrants.length }); this.$el.html( this.template( this.model.toJSON() ) ); // Need to see if this class has attendees and render them - var view = this.model.accounts.map(function(item){ - return (new app.Views.Front.Account({ model: item })).render().el; + var view = this.model.registrants.map(function(item){ + return (new app.Views.Front.RegRequestRegistrant({ model: item })).render().el; }); var accountContainer = this.$('.reg-class-accounts'); accountContainer.append(view); @@ -494,9 +569,6 @@ app.Views.Front.RegClass = Backbone.View.extend({ }, deleteOne: function( item ){ - console.log( item ); - console.log( 'Delete called in view' ); - console.log( this.model.accounts.length ); this.render(); }, @@ -535,30 +607,29 @@ app.Views.Front.RegClass = Backbone.View.extend({ data: 'email=' + this.$newEmail.val().trim() }) .done(function(account){ - //console.log(account); + console.log(account); // Check for id and email if ( account.validEmail !== true ) { // If not found then nothing was found for that email. alert('Must be a valid email address!'); - } else if ( account.valid !== true ) { - alert( 'No account matched that email address!' ); - } else if ( account.id !== undefined && account.email !== undefined ) { - this.model.accounts.create({ - id: account.id, + } else if ( account.id !== undefined && account.email !== undefined ) { + console.log( cart.get( 'request' ) ); + var regRequest = cart.get( 'request' ); + this.model.registrants.create({ + account: account.id, + reg_request: regRequest.id, + reg_event: this.model.get( 'reg_event' ), + reg_class: this.model.get( 'id' ), + reg_request_rate: this.model.get('reg_rate_id'), email: account.email, - parent: this.model.id }); - //this.model.trigger('change'); this.$newEmail.val(''); } else if ( account.email !== undefined ) { - // use the dummy id - newId++; - this.model.accounts.create({ - id: 'new_' + newId, - email: account.email, - parent: this.model.id - }); - //this.model.trigger('change'); + // Here we need to create a popup form for a new entry. + // Create the new Registrant View + var nModel = new app.Models.Front.RegRequestRegistrant({email: account.email}); + var nrView = new app.Views.Front.NewRegistrant({model: nModel}); + this.$el.append( nrView.render().el ); this.$newEmail.val(''); } }) @@ -613,3 +684,33 @@ app.Views.Front.RegEvent = Backbone.View.extend({ }, }); + +app.Views.Front.RegRequestRegistrant = Backbone.View.extend({ + tagName: 'div', + + className: 'glm-reg-level-registrant clearfix', + + template: _.template( jQuery('#registrant-template').html() ), + + initialize: function(){ + this.listenTo( this.model, 'change', this.render ); + return this; + }, + + events: { + 'click .glm-reg-level-registrant-delete': 'deleteOne', + }, + + render: function(){ + this.$el.html( this.template( this.model.toJSON() ) ); + this.$emailInput = this.$('.editEmail'); + return this; + }, + + deleteOne: function(){ + //console.log( this.model ); + this.model.destroy(); + this.remove(); + }, + +}); diff --git a/js/models/front/cart.js b/js/models/front/cart.js index b792caa..f4f7b07 100644 --- a/js/models/front/cart.js +++ b/js/models/front/cart.js @@ -1,5 +1,7 @@ app.Models.Front.Cart = Backbone.Model.extend({ defaults: { + id: 0, + name: 'cart', status: null, errorMsg: '', notes: [], diff --git a/js/models/front/regClass.js b/js/models/front/regClass.js index f846fec..8b69693 100644 --- a/js/models/front/regClass.js +++ b/js/models/front/regClass.js @@ -5,10 +5,12 @@ app.Models.Front.RegClass = Backbone.Model.extend({ // Defaults defaults: { + name: 'regClass', id: 0, reg_event: 0, name: '', descr: '', + reg_rate_id: 0, reg_rate_name: '', reg_rate_base_price: '', reg_rate_per_reg: '', @@ -16,8 +18,7 @@ app.Models.Front.RegClass = Backbone.Model.extend({ }, initialize: function(){ - this.accounts = new app.Collections.Front.Accounts( this.id ); - //this.accounts.fetch(); + this.registrants = new app.Collections.Front.RegRequestRegistrants( [] ); }, }); diff --git a/js/models/front/regRequestRegistrant.js b/js/models/front/regRequestRegistrant.js new file mode 100644 index 0000000..8adaf67 --- /dev/null +++ b/js/models/front/regRequestRegistrant.js @@ -0,0 +1,23 @@ +app.Models.Front.RegRequestRegistrant = Backbone.Model.extend({ + defaults: { + name: 'registrant', + id: 0, + account: 0, + reg_event: 0, + reg_class: 0, + event_name: '', + reg_time: 0, + event_datetime: '', + reg_request: 0, + reg_request_event: 0, + reg_request_class: 0, + reg_request_rate: 0, + reg_request_hold: false, + reg_request_hold_not_available: false, + email: '', + fname: '', + lname: '', + }, + + url: ajaxUrl+'&glm_action=regFront&collection=registrant' +}); diff --git a/js/models/front/request.js b/js/models/front/request.js index d437c53..2bf8929 100644 --- a/js/models/front/request.js +++ b/js/models/front/request.js @@ -1,5 +1,6 @@ app.Models.Front.Request = Backbone.Model.extend({ defaults: { + name: 'request', id: null, account: null, validated: false, diff --git a/js/views/front/newRegistrant.js b/js/views/front/newRegistrant.js new file mode 100644 index 0000000..41aab89 --- /dev/null +++ b/js/views/front/newRegistrant.js @@ -0,0 +1,41 @@ +app.Views.Front.NewRegistrant = Backbone.View.extend({ + tagName: 'div', + + className: 'new-reg', + + template: _.template( jQuery('#eventReg-registrant-add').html() ), + + events: { + 'click .add-new-registrant': 'addNew', + }, + + initialize: function(){ + return this; + }, + + addNew: function(){ + console.log( 'called addNew in newReg view' ); + var fname = this.$('.reg_fname').val().trim(); + var lname = this.$('.reg_lname').val().trim(); + var email = this.$('.reg_email').val().trim(); + console.log( 'email: ' + email + ' fname: ' + fname + ' lname: ' + lname ); + + // Create a account + // this.model.set({ + // fname: this.$('.reg_fname').val().trim(), + // lname: this.$('.reg_lname').val().trim(), + // email: this.$('.reg_email').val().trim(), + // }); + + + // Destroy the model and view + this.model.destroy(); + this.remove(); + }, + + render: function(){ + this.$el.html( this.template( this.model.toJSON() ) ); + return this; + }, + +}); diff --git a/js/views/front/regClass.js b/js/views/front/regClass.js index f829e1f..783d003 100644 --- a/js/views/front/regClass.js +++ b/js/views/front/regClass.js @@ -8,23 +8,21 @@ app.Views.Front.RegClass = Backbone.View.extend({ template: _.template( jQuery('#regClass-template').html() ), initialize: function(){ - this.model.accounts.fetch(); - this.listenTo( this.model.accounts, 'add', this.addOne ); - this.listenTo( this.model.accounts, 'create', this.addOne ); - //this.listenTo( this.model.accounts, 'reset', this.addAll ); - //this.listenTo( this.model.accounts, 'all', this.render ); + this.listenTo( this.model.registrants, 'add', this.addOne ); + this.listenTo( this.model.registrants, 'create', this.addOne ); + this.listenTo( this.model.registrants, 'remove', this.deleteOne ); this.listenTo( this.model, 'change', this.render ); return this; }, render: function(){ - this.model.set({ reg_count: this.model.accounts.length }); + this.model.set({ reg_count: this.model.registrants.length }); this.$el.html( this.template( this.model.toJSON() ) ); // Need to see if this class has attendees and render them - var view = this.model.accounts.map(function(item){ - return (new app.Views.Front.Account({ model: item })).render().el; + var view = this.model.registrants.map(function(item){ + return (new app.Views.Front.RegRequestRegistrant({ model: item })).render().el; }); var accountContainer = this.$('.reg-class-accounts'); accountContainer.append(view); @@ -32,9 +30,6 @@ app.Views.Front.RegClass = Backbone.View.extend({ }, deleteOne: function( item ){ - console.log( item ); - console.log( 'Delete called in view' ); - console.log( this.model.accounts.length ); this.render(); }, @@ -73,30 +68,29 @@ app.Views.Front.RegClass = Backbone.View.extend({ data: 'email=' + this.$newEmail.val().trim() }) .done(function(account){ - //console.log(account); + console.log(account); // Check for id and email if ( account.validEmail !== true ) { // If not found then nothing was found for that email. alert('Must be a valid email address!'); - } else if ( account.valid !== true ) { - alert( 'No account matched that email address!' ); - } else if ( account.id !== undefined && account.email !== undefined ) { - this.model.accounts.create({ - id: account.id, + } else if ( account.id !== undefined && account.email !== undefined ) { + console.log( cart.get( 'request' ) ); + var regRequest = cart.get( 'request' ); + this.model.registrants.create({ + account: account.id, + reg_request: regRequest.id, + reg_event: this.model.get( 'reg_event' ), + reg_class: this.model.get( 'id' ), + reg_request_rate: this.model.get('reg_rate_id'), email: account.email, - parent: this.model.id }); - //this.model.trigger('change'); this.$newEmail.val(''); } else if ( account.email !== undefined ) { - // use the dummy id - newId++; - this.model.accounts.create({ - id: 'new_' + newId, - email: account.email, - parent: this.model.id - }); - //this.model.trigger('change'); + // Here we need to create a popup form for a new entry. + // Create the new Registrant View + var nModel = new app.Models.Front.RegRequestRegistrant({email: account.email}); + var nrView = new app.Views.Front.NewRegistrant({model: nModel}); + this.$el.append( nrView.render().el ); this.$newEmail.val(''); } }) diff --git a/js/views/front/regRequestRegistrant.js b/js/views/front/regRequestRegistrant.js new file mode 100644 index 0000000..279eeb7 --- /dev/null +++ b/js/views/front/regRequestRegistrant.js @@ -0,0 +1,29 @@ +app.Views.Front.RegRequestRegistrant = Backbone.View.extend({ + tagName: 'div', + + className: 'glm-reg-level-registrant clearfix', + + template: _.template( jQuery('#registrant-template').html() ), + + initialize: function(){ + this.listenTo( this.model, 'change', this.render ); + return this; + }, + + events: { + 'click .glm-reg-level-registrant-delete': 'deleteOne', + }, + + render: function(){ + this.$el.html( this.template( this.model.toJSON() ) ); + this.$emailInput = this.$('.editEmail'); + return this; + }, + + deleteOne: function(){ + //console.log( this.model ); + this.model.destroy(); + this.remove(); + }, + +}); diff --git a/models/admin/ajax/account.php b/models/admin/ajax/account.php index 11fa076..ed07b62 100644 --- a/models/admin/ajax/account.php +++ b/models/admin/ajax/account.php @@ -135,8 +135,7 @@ class GlmMembersAdmin_ajax_account extends GLMDataRegistrationsAccount ); } else { $return = array( - //'valid' => false, - 'valid' => true, + 'valid' => false, 'validEmail' => true, 'email' => $email, ); diff --git a/models/admin/ajax/regFront.php b/models/admin/ajax/regFront.php index 82721ae..d1ed0c3 100644 --- a/models/admin/ajax/regFront.php +++ b/models/admin/ajax/regFront.php @@ -75,7 +75,7 @@ class GlmMembersAdmin_ajax_regFront $collection = filter_var( $_REQUEST['collection'], FILTER_SANITIZE_STRING ); // If not a valid collection, die quietly - if (!in_array($collection, array('regClasses', 'request', 'account'))) { + if (!in_array($collection, array('regClasses', 'request', 'account', 'registrant'))) { wp_die(); } diff --git a/models/admin/ajax/regFront/registrant.php b/models/admin/ajax/regFront/registrant.php new file mode 100644 index 0000000..ffd1b98 --- /dev/null +++ b/models/admin/ajax/regFront/registrant.php @@ -0,0 +1,187 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @release regRequestEvent.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ + * @link http://dev.gaslightmedia.com/ + */ + +// Load Registrations data abstract +require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequest.php'; + +class GlmMembersAdmin_registrations_ajax_registrant // extends GlmDataRegistrationsRegRequest +{ + + /** + * WordPress Database Object + * + * @var $wpdb + * @access public + */ + public $wpdb; + /** + * Plugin Configuration Data + * + * @var $config + * @access public + */ + public $config; + + /** + * Constructor + * + * This contructor performs the work for this model. This model returns + * an array containing the following. + * + * 'status' + * + * True if successfull and false if there was a fatal failure. + * + * 'view' + * + * A suggested view name that the contoller should use instead of the + * default view for this model or false to indicate that the default view + * should be used. + * + * 'data' + * + * Data that the model is returning for use in merging with the view to + * produce output. + * + * @wpdb object WordPress database object + * + * @return array Array containing status, suggested view, and any data + */ + public function __construct ($wpdb, $config) + { + + // Save WordPress Database object + $this->wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + + /* + * Run constructor for the REgistrations data class + * + * Note, the third parameter is a flag that indicates to the Contacts + * data class that it should flag a group of fields as 'view_only'. + */ + //parent::__construct(false, false, true); + + } + + public function modelAction($modelData) + { + + trigger_error(print_r($modelData,1)); + dei(); + + if ( !isset( $modelData['option'] ) ) { + $option = null; + } else { + $option = $modelData['option']; + } + + if ( $modelData['id'] == 0 ) { + $option = 'add'; + } + + // Perform specified action + switch ( $option ) { + + case 'add': + // Check for or create reg_request_event + if ( $modelData['reg_event'] ) { + return false; + } + $regRegquestEventId = $this->wpdb->get_var( + $this->wpdb->prepare( + "SELECT id + FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request_event + WHERE reg_event = %d", + $modelData['reg_event'] + ) + ); + if ( !$regRegquestEventId ) { + $this->wpdb->insert( + GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request_event', + array( + 'account' => 0, + 'reg_request' => $modelData['reg_request'], + 'reg_event' => $modelData['reg_event'], + 'event_name' => $modelData['event_name'], + 'reg_time' => $modelData['reg_time'], + 'event_datetime' => $modelData['event_datetime'], + ), + array( + '%d', + '%d', + '%d', + '%s', + '%d', + '%s', + ) + ); + $regRequestEvent = $this->wpdb->insert_id; + } + // Check for or create reg_request_class + $regRequestClassId = $this->wpdb->get_var( + $this->wpdb->prepare( + "SELECT id + FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request_class + WHERE reg_request_event = %d + AND class = %d", + $regRegquestEventId, + $modelData['reg_class'] + ) + ); + $this->wpdb->insert( + GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request_registrant', + array( + 'account' => $modelData['account'], + 'reg_event' => $modelData['reg_event'], + 'reg_request_event' => $modelData['reg_request_event'], + ), + array() + ); + break; + + case 'get': + break; + + case 'update': + break; + + case 'delete': + break; + + default: + // If the model has an id then add it to the registrant table + // Check to see if the registrant is there if not create one + // $registrantId = $this->wpdb->get_var( + // $this->wpdb->prepare( + // "SELECT id + // FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request_registrant" + // ) + // ); + die(); // should never get here + break; + + } + + wp_die(); + + + + } + + +} diff --git a/models/front/registrations/registration.php b/models/front/registrations/registration.php index 8354dc8..eacb090 100644 --- a/models/front/registrations/registration.php +++ b/models/front/registrations/registration.php @@ -131,6 +131,7 @@ $rates = $RegRate->getList( "T.reg_class = " . $rClass['id'] ); //echo '
$rates: ' . print_r( $rates, true ) . '
'; foreach ( $rates as $rate ) { + $rClass['reg_rate_id'] = $rate['id']; $rClass['reg_rate_name'] = $rate['name']; $rClass['reg_rate_base_price'] = $rate['base_rate']; $rClass['reg_rate_per_reg'] = $rate['per_registrant']; diff --git a/views/front/registrations/registration.html b/views/front/registrations/registration.html index 79198f2..3b67f9a 100644 --- a/views/front/registrations/registration.html +++ b/views/front/registrations/registration.html @@ -26,6 +26,13 @@ + + + + {/literal}