Pull in the time text for the selected reg_time when editing registrant.
Trying to get the calendar also to show the selected time but not
finding a way to do this.
editRegistrant: function(){
this.$('.reg-edit-form').show();
if ( app.timeSpecific === true ) {
+ this.$('#reg-select-time').val( this.model.get( 'reg_time' ) );
app.initFullCalendar();
+ console.log( this.model.get( 'reg_time' ) );
}
},
editRegistrant: function(){
this.$('.reg-edit-form').show();
if ( app.timeSpecific === true ) {
+ this.$('#reg-select-time').val( this.model.get( 'reg_time' ) );
app.initFullCalendar();
+ console.log( this.model.get( 'reg_time' ) );
}
},
$registrant['account']
)
);
+ $this->wpdb->show_errors();
+ if ( $registrant['reg_time'] && filter_var( $registrant['reg_time'], FILTER_VALIDATE_INT ) ) {
+ $regTimeText = $this->wpdb->get_var(
+ $this->wpdb->prepare(
+ "SELECT DATE_FORMAT( start_datetime, '%%m/%%d/%%Y %%l:%%i %%p' )
+ FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_time
+ WHERE id = %d",
+ $registrant['reg_time']
+ )
+ );
+ var_dump( $regTimeText );
+ $registrant['reg_time_text'] = $regTimeText;
+ }
+ $this->wpdb->print_error();
$registrant['class_id'] = $classId;
$registrant['email'] = $email;
$registrant['validated'] = $accountData['validated'];
$registrant['state'] = $accountData['state'];
$registrant['zip'] = $accountData['zip'];
$registrant['country'] = $accountData['country'];
+ echo '<pre>$registrant: ' . print_r( $registrant, true ) . '</pre>';
$registrants[] = $registrant;
}
}
</div>
{/literal}{if $regEvent.time_specific.value}
<div>
- Selected Time: <span id="reg-select-time-display"></span>
+ Selected Time: <span id="reg-select-time-display">{literal}<%= reg_time_text %>{/literal}</span>
<input type="hidden" id="reg-select-time">
</div>
{/if}{literal}
{if $regEvent.time_specific.value}
initFullCalendar: function(){
if ({$regEvent.time_specific.value}) {
- $('#eventCalendar').fullCalendar({
+ app.FullCalendar = $('#eventCalendar').fullCalendar({
{if $regEvent}
events: [
{$sep = ''}
{/if}
start : '{$t.start_datetime.datetime}',
end : '{$t.end_datetime.datetime}',
- allday : {if $t.all_day.value}true{else}false{/if},
+ allday : {if $t.all_day.value}true{else}false{/if},
reg_time: {$t.id}
}
{$sep = ','}
timeFormat : 'h:mma',
fixedWeekCount : false,
eventClick: function(calEvent, jsEvent, view) {
+ $('.fc-event').css('background-color', '#3a67ad');
jQuery('#reg-select-time').val( calEvent.reg_time );
jQuery('#reg-select-time-display').html( calEvent.start.format('L LT') );
+ $(this).css('background-color', 'red');
}
{/if}
});