$modelData['reg_request']
)
);
+ // At this point we need to get the class data
+ $regClass = $this->wpdb->get_row(
+ $this->wpdb->prepare(
+ "SELECT *
+ FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_class
+ WHERE id = %d",
+ $modelData['reg_class']
+ ),
+ ARRAY_A
+ );
$data = array(
'reg_event' => $modelData['reg_event'],
'event_datetime' => $modelData['event_datetime'],
'reg_request' => $modelData['reg_request'],
'reg_request_event' => $regRequestEventId,
'class' => $modelData['reg_class'],
+ 'class_name' => $regClass['name'],
);
$dataFormat = array(
'%d', // reg_event
'%d', // reg_request
'%d', // reg_request_event
'%d', // class
+ '%s', // class_name
);
if ( !$regRequestClassId ) {
$this->wpdb->insert(
'%d', // reg_request_event
'%d', // reg_request_class
'%d', // rate
- '%d', // rate_name
+ '%s', // rate_name
'%f', // base_rate
'%f', // per_registrant
'%d', // registrant_credits
)
);
- /*
- * Check for availability - If available then place a hold by creating a reg_time_pending entry
- */
- //
-
- // Get availability from reg_time entry
-/*
- * *** NEED TO REVISIT THIS ***
- * The reg_time table entry data should be passed to the front-end attendee selection and the ID of the
- * selected reg_time entry is what should be used to get the current availability.
- * The availability is sent to the registration page now so we can check against that before sending.
- * This will also be cheked again in the cart anyway.
- *
- $regRequestRegistrantAvailble = $this->wpdb->get_var(
+ $regTime = $this->wpdb->get_row(
$this->wpdb->prepare(
- "SELECT attendees_available
- FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_time
- WHERE reg_event = %d
- AND account = %d
- AND reg_request_event = %d
- AND reg_request_class = %d",
- $modelData['reg_request'],
- $accountId,
- $regRequestEventId,
- $regRequestClassId
- )
- );
-*/
-
+ "SELECT *
+ FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_time
+ WHERE id = %d",
+ $modelData['reg_time']
+ ),
+ ARRAY_A
+ );
$data = array(
'account' => $accountId,
'reg_event' => $modelData['reg_event'],
'reg_time' => $modelData['reg_time'],
- // 'event_datetime' => $modelData['event_datetime'],
+ 'event_datetime' => $regTime['start_datetime'],
'reg_request' => $modelData['reg_request'],
'reg_request_event' => $regRequestEventId,
'reg_request_class' => $regRequestClassId,
'%d', // account
'%d', // reg_event
'%s', // reg_time
- // '%s', // event_datetime
+ '%s', // event_datetime
'%d', // reg_request
'%d', // reg_request_event
'%d', // reg_request_class
}
if ( $regRequestRegistrantId = filter_var( $modelData['id'], FILTER_VALIDATE_INT ) ) {
+ $regTime = $this->wpdb->get_row(
+ $this->wpdb->prepare(
+ "SELECT *
+ FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_time
+ WHERE id = %d",
+ $modelData['reg_time']
+ ),
+ ARRAY_A
+ );
// Check the account to see what's changed
// Check for a new reg_time
$data = array(
'account' => $modelData['account'],
'reg_event' => $modelData['reg_event'],
- 'event_name' => $modelData['event_name'],
'reg_time' => $modelData['reg_time'],
- // 'event_datetime' => $modelData['event_datetime'],
+ 'event_datetime' => $regTime['start_datetime'],
'reg_request' => $modelData['reg_request'],
'reg_request_event' => $modelData['reg_request_event'],
'reg_request_class' => $modelData['reg_request_class'],
$dataFormat = array(
'%d', // account
'%d', // reg_event
- '%s', // event_name
'%s', // reg_time
- // '%s', // event_datetime
+ '%s', // event_datetime
'%d', // reg_request
'%d', // reg_request_event
'%d', // reg_request_class
}
// Setup the registrant for this level.
- $registrant['class_id'] = $classId;
- $registrant['reg_class'] = $classId;
- $registrant['email'] = $email;
- $registrant['validated'] = $accountData['validated'];
- $registrant['addr1'] = $accountData['addr1'];
- $registrant['addr2'] = $accountData['addr2'];
- $registrant['city'] = $accountData['city'];
- $registrant['state'] = $accountData['state'];
- $registrant['zip'] = $accountData['zip'];
- $registrant['country'] = $accountData['country'];
- $registrants[] = $registrant;
+ $registrant['class_id'] = $classId;
+ $registrant['reg_class'] = $classId;
+ $registrant['email'] = $email;
+ $registrant['validated'] = $accountData['validated'];
+ $registrant['addr1'] = $accountData['addr1'];
+ $registrant['addr2'] = $accountData['addr2'];
+ $registrant['city'] = $accountData['city'];
+ $registrant['state'] = $accountData['state'];
+ $registrant['zip'] = $accountData['zip'];
+ $registrant['country'] = $accountData['country'];
+ $registrant['reg_request'] = $rEvent['reg_request'];
+ $registrants[] = $registrant;
} // - End loop through for registrants array.
}