This will be for a new account to be registered.
setClassRegistrants: function( registrants ){
for ( var i = 0; i < registrants.length; i++ ) {
var foundClass = this.classes.findWhere({ id: registrants[i].class_id });
- foundClass.registrants.create( registrants[i] );
+ if ( foundClass != undefined ) {
+ foundClass.registrants.create( registrants[i] );
+ }
}
},
'click #glm-reg-cart-continue': 'continue',
'click #accountLogin': 'loginToAccount',
'click #accountLogout': 'logout',
+ 'click #register': 'register',
+ },
+
+ register: function(){
+ // Have to create new view and model for the register
},
continue: function(){
setClassRegistrants: function( registrants ){
for ( var i = 0; i < registrants.length; i++ ) {
var foundClass = this.classes.findWhere({ id: registrants[i].class_id });
- foundClass.registrants.create( registrants[i] );
+ if ( foundClass != undefined ) {
+ foundClass.registrants.create( registrants[i] );
+ }
}
},
'click #glm-reg-cart-continue': 'continue',
'click #accountLogin': 'loginToAccount',
'click #accountLogout': 'logout',
+ 'click #register': 'register',
+ },
+
+ register: function(){
+ // Have to create new view and model for the register
},
continue: function(){
$this->wpdb->insert(
GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'account',
array(
- 'fname' => $modelData['fname'],
- 'lname' => $modelData['lname'],
- 'email' => $modelData['email']
+ 'fname' => $modelData['fname'],
+ 'lname' => $modelData['lname'],
+ 'email' => $modelData['email'],
+ 'date_created' => date('Y-m-d'),
),
'%s'
);
{* Underscore Templates for the Event Registration App *}
{* Template for Account Login *}{literal}
<script type="text/template" id="eventReg-account-login">
+ <a class="glm-reg-account-login" id="loginCancel">Close</a>
<h4>Login</h4>
<% if ( message ) { %>
<span style="color: red;"><%= message %></span>
<% } %>
- <a class="glm-reg-account-login" id="loginCancel">Close</a>
- <a id="forgotLogin">Forgot Password</a>
<input class="login" placeholder="Email Address" type="email">
<input class="password" placeholder="Password" type="password">
<input type="submit" id="accountLogin" value="Login">
+ <a id="register">Register</a>
+ <a id="forgotLogin">Forgot Password</a>
</script>
{/literal}
{* Template for Logged in Account *}{literal}
<script type="text/template" id="account-template">
- <span>Logged in as <%= email %></span>
- <span id="accountLogout">Logout</span>
+ <span>Logged in as <%= fname %><%= lname %></span>
+ <a id="accountLogout">Logout</a>
+</script>
+{/literal}
+{* Template for Register New Account *}{literal}
+<script type="text/template" id="register-new-account">
+<h1>New Account</h1>
</script>
{/literal}
{* Template for the regEvent *}{literal}