reg_count: 0,
loggedIn: false,
selectedTime: 0,
+ startingTime: '',
},
initialize: function(){
var timeContainer = this.$('.reg-class-times');
timeContainer.append( view );
- // Need to see if this class has attendees and render them
- // 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);
-
if ( loginAccount === '' ) {
this.$('.glm-add-account').hide();
}
- // if ( loginAccount != '' && this.model.hasMe() ) {
- // this.$('.glm-add-account').hide();
- // }
if ( !app.timeSpecific ) {
console.log('Should be showing the add attendee part now');
// this.$('.glm-add-new-account').show();
setCalendar: function(){
var times = this.model.get( 'times' );
+ var startTime = this.model.get('startingTime');
$('#eventCalendar-' + this.model.get('id')).fullCalendar({
events: function(start, end, timezone, callback) {
var events = [];
reg_count: 0,
loggedIn: false,
selectedTime: 0,
+ startingTime: '',
},
initialize: function(){
var timeContainer = this.$('.reg-class-times');
timeContainer.append( view );
- // Need to see if this class has attendees and render them
- // 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);
-
if ( loginAccount === '' ) {
this.$('.glm-add-account').hide();
}
- // if ( loginAccount != '' && this.model.hasMe() ) {
- // this.$('.glm-add-account').hide();
- // }
if ( !app.timeSpecific ) {
console.log('Should be showing the add attendee part now');
// this.$('.glm-add-new-account').show();
setCalendar: function(){
var times = this.model.get( 'times' );
+ var startTime = this.model.get('startingTime');
$('#eventCalendar-' + this.model.get('id')).fullCalendar({
events: function(start, end, timezone, callback) {
var events = [];
// Call to add registrant
$registrant = $this->addUpdateRegistrantToCart( $modelData, 'add' );
+ $registrant['name'] = $registrant['fname'] . ' ' . $registrant['lname'];
echo json_encode( $registrant, JSON_NUMERIC_CHECK );
wp_die();
case 'update':
$registrant = $this->addUpdateRegistrantToCart( $modelData, 'update' );
+ $registrant['name'] = $registrant['fname'] . ' ' . $registrant['lname'];
echo json_encode( $registrant, JSON_NUMERIC_CHECK );
wp_die();
// times array. If it doesn't then there's no current registration
// allowed for that event.
foreach ( $regEvent['reg_class'] as $key => $rClass ) {
+ $classStartingTime = '';
+ // echo '<pre>$rClass: ' . print_r( $rClass, true ) . '</pre>';
// Pull the rate data
if ( isset( $rClass['times'] ) && is_array( $rClass['times'] ) && count( $rClass['times'] ) > 0 ) {
// echo '<pre>$rClass[times]: ' . print_r( $rClass['times'], true ) . '</pre>';
foreach ( $rClass['times'] as &$time ) {
+ if ( $classStartingTime == '' || $time['start_datetime']['timestamp'] < $classStartingTime['start_datetime']['timestamp'] ) {
+ $classStartingTime = $time;
+ }
$rClass['loggedIn'] = ( isset($_SESSION['LoginAccount']) ) ? true : false;
$rClass['reg_event'] = $regEventId;
$rClass['reg_rate_id'] = $time['id'];
$regTimes[] = json_encode( $time, JSON_NUMERIC_CHECK );
}
}
+ $rClass['startingTime'] = $classStartingTime['start_datetime']['datetime'];
$jsonClasses[] = json_encode( $rClass, JSON_NUMERIC_CHECK );
} else if ( !isset( $rClass['times'] ) || empty( $rClass['times'] ) ) {
unset( $regEvent['reg_class'][$key] );
}
// Setup the registrant for this level.
+ $registrant['name'] = $accountData['fname'] . ' ' . $accountData['lname'];
$registrant['class_id'] = $classId;
$registrant['reg_class'] = $classId;
$registrant['email'] = $email;
{* Template for regClass *}{literal}
<script type="text/template" id="regClass-template">
<div class="glm-row">
- <div class="glm-columns glm-small-12">
+ <div class="glm-columns glm-small-12 glm-large-6">
<div class="glm-row">
<span class="glm-reg-level-title"><%= name %></span>
<div class="glm-columns glm-small-12">
<%- descr %>
</div>
- <div class="glm-columns glm-small-12 glm-large-12"> <%= reg_rate_name %> </div>
- <div class="glm-columns glm-small-12 glm-large-12"> Base Rate: $<%= reg_rate_base_price %> </div>
- <div class="glm-columns glm-small-12 glm-large-12"> Per Registrant: $<%= reg_rate_per_reg %> </div>
- <div class="glm-columns glm-small-12 glm-large-12"> Registrant Credits: <%= registrant_credits %> </div>
- <div class="glm-columns glm-small-12 glm-large-12 glm-hidden">
+ <div class="glm-columns glm-small-12"> <%= reg_rate_name %> </div>
+ <div class="glm-columns glm-small-12"> Base Rate: $<%= reg_rate_base_price %> </div>
+ <div class="glm-columns glm-small-12"> Per Registrant: $<%= reg_rate_per_reg %> </div>
+ <div class="glm-columns glm-small-12"> Registrant Credits: <%= registrant_credits %> </div>
+ <div class="glm-columns glm-small-12 glm-hidden">
<% if ( app.timeSpecific ) { %>
<input class="timeSelection" type="hidden" name="timeOption">
<% } else { %>
<% } %>
</div>
</div>
- </div>
- <div class="glm-columns glm-small-12 glm-large-6">
<div class="reg-class-detail">
<div class="reg-class-times"> </div>
var regEvent = '';
var cart = '';
var loginAccount = '';
-var startTime = '{$regEvent.firstTime.start_time.datetime}';
jQuery(function($){
{if $isNewCart}
location.reload( true );