'use' => 'lg'
),
+ // Pointer to reg_request table entry
+ 'reg_request' => array (
+ 'field' => 'reg_request',
+ 'type' => 'integer',
+ 'required' => true,
+ 'use' => 'lgneud'
+ ),
+
// Pointer to reg_request_event table entry
'reg_request_event' => array (
'field' => 'reg_request_event',
'use' => 'a'
),
+ // Additional quick data
+
+ // Class Name
+ 'class_name' => array (
+ 'field' => 'reg_request_class',
+ 'as' => 'class_name',
+ 'type' => 'pointer',
+ 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request_class',
+ 'p_field' => 'class_name',
+ 'p_static' => true,
+ 'required' => true,
+ 'use' => 'lg'
+ ),
+
+ // Rate Name
+ 'rate_name' => array (
+ 'field' => 'reg_request_rate',
+ 'as' => 'rate_name',
+ 'type' => 'pointer',
+ 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request_rate',
+ 'p_field' => 'rate_name',
+ 'p_static' => true,
+ 'required' => true,
+ 'use' => 'lg'
+ ),
+
+ // Request Status
+ 'request_status' => array (
+ 'field' => 'reg_request',
+ 'as' => 'request_status',
+ 'type' => 'pointer',
+ 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request',
+ 'p_field' => 'status',
+ 'p_static' => true,
+ 'required' => true,
+ 'use' => 'lg'
+ )
+
);
}
+ /**
+ * Entry Post Processing Call-Back Method
+ *
+ * Perform post-processing for all result entries.
+ *
+ * @param array $r Array of field result data for a single entry
+ * @param string $a Action being performed (l, i, g, ...)
+ *
+ * @return object Class object
+ *
+ */
+ public function entryPostProcessing( $r, $action )
+ {
+
+ // If doing the following actions
+ if (in_array($action, array('l','g'))) {
+
+ // Get the registration request status name
+ $r['request_status_name'] = $this->config['submission_status'][$r['request_status']];
+
+ // Add a reformatted date/time
+ $r['event_time_reformatted'] = '';
+ $t = strtotime($r['event_time']);
+ if ($t > 0) {
+ $r['event_time_reformatted'] = date('m/d/Y h:i A', strtotime($r['event_time']));
+ }
+
+ }
+
+ return $r;
+ }
+
+
+ /*
+ * Get full information on registrants for an event
+ *
+ * @param integer $eventId ID of the reg_event record
+ *
+ * @return array List of registrants with optional additional data or false if none
+ *
+ */
+ public function getFullRegistrantsData($eventId = false)
+ {
+
+ // Check Event ID
+ $eventId = ($eventId - 0);
+ if ($eventId <= 0) {
+ return false;
+ }
+
+ // Get registrants for this event
+ $registrants = $this->getList("T.reg_event = $eventId");
+
+ // Make sure we received registrants
+ if (!is_array($registrants) || count($registrants) == 0) {
+ return false;
+ }
+
+ // For each registrant
+ foreach ($registrants as $registrantKey=>$registrantVal) {
+
+ // Try to get account
+ $registrants[$registrantKey]['account'] = false;
+ if ($registrantVal['account']) {
+ require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataAccount.php';
+ $Accounts = new GlmDataRegistrationsAccount($this->wpdb, $this->config);
+ $registrants[$registrantKey]['account'] = $Accounts->getEntry($registrantVal['account']);
+ }
+
+ // Try to get any per Event custom field data
+
+ // Try to get any per
+ }
+
+ return $registrants;
+
+
+
+
+
+
+
+
+
+
+
+ }
}
?>
\ No newline at end of file
/*
* 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);
$regTimesJSON = false;
$regEventDeleted = false;
$classes = false;
+ $haveRegistrants = false;
+ $registrants = false;
// Register the masked input script that we need for input controls
wp_dequeue_script('glm-members-admin-maskedinput');
case 'registrants':
+ require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequestRegistrant.php';
+ $Registrants = new GlmDataRegistrationsRequestRegistrant($this->wpdb, $this->config);
+
+ // Get list of all registrants for this event
+ $registrants = $Registrants->getFullRegistrantsData($regEventID);
+
+ if ($registrants) {
+ $haveRegistrants = true;
+ }
+
+ // echo "<pre>".print_r($registrants,1)."</pre>";
+
$view = 'eventRegistrants';
break;
'regEventJSON' => $regEventJSON,
'regClassesJSON' => $regClassesJSON,
'regTimesJSON' => $regTimesJSON,
- 'classes' => $classes
+ 'classes' => $classes,
+ 'haveRegistrants' => $haveRegistrants,
+ 'registrants' => $registrants
);
// echo "<pre>".print_r($templateData,1)."</pre>";
{include file='admin/registrations/eventHeader.html'}
{include file='admin/registrations/eventSubTabs.html'}
-this is the registrants page.
\ No newline at end of file
+{if $errorMsg}
+ <h3 class="glm-error">{$errorMsg}</h3>
+{/if}
+
+<h1>Registrant List</h1>
+
+<div class="glm-admin-table-inner glm-admin-table">
+
+ <table class="wp-list-table striped glm-admin-table" style="width: 100%;">
+ <thead>
+ <tr>
+ <th>First Name</th>
+ <th>Last Name</th>
+ <th>City</th>
+ <th>State</th>
+ <th>Phone</th>
+ <th>Level</th>
+ <th>Date/Time</th>
+ <th>Rate</th>
+ <th>Status</th>
+ <th> </th>
+ </tr>
+ </thead>
+ <tbody>
+ {if $haveRegistrants}
+ {foreach $registrants as $r}
+ <tr>
+ <td>{$r.fname}</td>
+ <td>{$r.lname}</td>
+ <td>{$r.account.city}</td>
+ <td>{$r.account.state.value}</td>
+ <td>{$r.account.phone}</td>
+ <td>{$r.class_name}</td>
+ <td>{$r.event_time_reformatted}</td>
+ <td>{$r.rate_name}</td>
+ <td>{$r.request_status_name}</td>
+ <td><a href="{$thisUrl}?page=glm-members-admin-menu-registrations-requests&option=requestDashboard&requestID={$r.reg_request}">Request</a></td>
+ </tr>
+ {/foreach}
+ {else}
+ <tr class="alternate"><td colspan="2">(no registrants listed)</td></tr>
+ {/if}
+ </tbody>
+ </table>
+
+</div>
+
+{include file='admin/footer.html'}