'field' => 'reg_request',
'as' => 'request_status',
'type' => 'pointer',
- 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request',
+ 'p_table' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_request R',
'p_field' => 'status',
'p_static' => true,
'required' => true,
* @return array List of registrants with optional additional data or false if none
*
*/
- public function getFullRegistrantsData($eventId = false)
+ public function getFullRegistrantsData($eventId = false, $where = '', $start = false, $limit = false)
{
// Check Event ID
return false;
}
+ $whereEvent = "T.reg_event = $eventId ";
+ if ( $where ) {
+ $whereEvent .= " AND $where";
+ }
+
// Get registrants for this event
- $registrants = $this->getList("T.reg_event = $eventId");
+ $listResult = $this->getList( $whereEvent, "T.lname, T.fname", true, 'id', $start, $limit );
+ $registrants = $listResult['list'];
+
+ $registrantCount = $this->getStats(str_replace('T.', '', $whereEvent));
// Make sure we received registrants
if (!is_array($registrants) || count($registrants) == 0) {
// Try to get any per
}
+ $listResult['list'] = $registrants;
+ $listResult['totalCount'] = $registrantCount;
- return $registrants;
+ return $listResult;
}
}
-?>
\ No newline at end of file
+?>
; Main Configuration File
; {descrName}
;
-; Place any static configuration parameters here.
+; Place any static configuration parameters here.
;
[common]
payment_method[2] = 'Comp Code'
payment_method[3] = 'Cash'
payment_method[4] = 'Check'
-payment_method[5] = 'Call from Merchant'
-payment_method[6] = 'Credit Card'
-payment_method[7] = 'PayPal'
+payment_method[5] = 'Call from Merchant'
+payment_method[6] = 'Credit Card'
+payment_method[7] = 'PayPal'
payment_method_numb['NoCharge'] = 1
payment_method_numb['CompCode'] = 2
reg_ref_type_numb['Registration Request'] = 10
reg_ref_type_numb['Event'] = 20
-reg_ref_type_numb['Registration CLass'] = 30
+reg_ref_type_numb['Registration Class'] = 30
reg_ref_type_numb['Registration Rate'] = 40
reg_ref_type_numb['Registrant'] = 50
billing_field[11] = 'Phone'
billing_field[12] = 'FAX'
-billing_field_numb['First Name'] = 1
-billing_field_numb['Last Name'] = 2
-billing_field_numb['Organization'] = 3
-billing_field_numb['Title/Department'] = 4
-billing_field_numb['Address Line 1'] = 5
-billing_field_numb['Address Line 2'] = 6
-billing_field_numb['City'] = 7
-billing_field_numb['State'] = 8
-billing_field_numb['ZIP/Postal Code'] = 9
+billing_field_numb['First Name'] = 1
+billing_field_numb['Last Name'] = 2
+billing_field_numb['Organization'] = 3
+billing_field_numb['Title/Department'] = 4
+billing_field_numb['Address Line 1'] = 5
+billing_field_numb['Address Line 2'] = 6
+billing_field_numb['City'] = 7
+billing_field_numb['State'] = 8
+billing_field_numb['ZIP/Postal Code'] = 9
billing_field_numb['Country'] = 10
billing_field_numb['Phone'] = 11
billing_field_numb['FAX'] = 12
added_info_field_type[40] = 'Registrant - Person who registers for events'
added_info_field_type[50] = 'Registration - Registration of a specific registrant to a specific event'
-added_info_field_type_numb['Request'] = 10
+added_info_field_type_numb['Request'] = 10
added_info_field_type_numb['Event'] = 20
added_info_field_type_numb['Account'] = 30
added_info_field_type_numb['Registrant'] = 40
$prevStart = false;
$nextStart = false;
$start = 1;
- $limit = 20; // Set to the number of listings per page
+ $limit = 5; // Set to the number of listings per page
+ $registrantCount = 0;
$textSearch = false;
$where = ' TRUE ';
$alphaList = false;
$classes = false;
$haveRegistrants = false;
$registrants = false;
+ $completed = false;
+ $errorMsg = false;
// Register the masked input script that we need for input controls
wp_dequeue_script('glm-members-admin-maskedinput');
case 'registrants':
+ $whereParts = array();
+
+ if (isset($_REQUEST['textSearch']) && trim($_REQUEST['textSearch'] != '')) {
+ $textSearch = trim($_REQUEST['textSearch']);
+ $whereParts[] = "concat( T.fname, ' ', T.lname) LIKE '%".$textSearch."%'";
+
+ // Clean up for use in redisplaying search value
+ $textSearch = stripslashes($textSearch);
+ }
+
require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequestRegistrant.php';
$Registrants = new GlmDataRegistrationsRequestRegistrant($this->wpdb, $this->config);
+ // Get the regEvent data
+ $regEvent = $this->getEntry($regEventID);
+ if ( isset( $_REQUEST['complete'] ) && filter_var( $_REQUEST['complete'], FILTER_VALIDATE_BOOLEAN) ) {
+ $completed = true;
+ $whereParts[] = "T.reg_request in (
+ SELECT id
+ FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request
+ WHERE status = {$this->config['submission_status_numb']['COMPLETE']})";
+ }
// Get list of all registrants for this event
- $registrants = $Registrants->getFullRegistrantsData($regEventID);
+ $where = implode( ' AND ', $whereParts );
+
+ // Check if we're doing paging
+ if ( isset( $_REQUEST['pageSelect'] ) ) {
+
+ // If request is for Next
+ if ( $_REQUEST['pageSelect'][0] == 'N' ) {
+ $newStart = $_REQUEST['nextStart'] - 0;
+
+ // Otherwise it must be Previous
+ } else {
+ $newStart = $_REQUEST['prevStart'] - 0;
+ }
+
+ if ($newStart > 0) {
+ $start = $newStart;
+ }
+ }
+
+ $listResult = $Registrants->getFullRegistrantsData($regEventID, $where, $start, $limit);
+
+ // Get count of registrants listed
+ $registrantCount = $listResult['totalCount'];;
+ echo '<pre>$registrantCount: ' . print_r( $registrantCount, true ) . '</pre>';
+
+ // If the number of registrants is less than a page, don't do paging
+ if ($registrantCount <= $limit) {
+ // $paging = false;
+ }
- if ($registrants) {
- $haveRegistrants = true;
+ // Get paging results
+ $numbDisplayed = $listResult['returned'];
+ $lastDisplayed = $listResult['last'];
+ if ($start == 1) {
+ $prevStart = false;
+ } else {
+ $prevStart = $start - $limit;
+ if ($start < 1) {
+ $start = 1;
+ }
}
+ if ($listResult['returned'] == $limit) {
+ $nextStart = $start + $limit;
+ }
+ $registrants = $listResult['list'];
+
+ $success = true;
+ $haveRegistrants = false;
+ if ($registrants !== false) {
+ $success = true;
+
+ // If we have any entries
+ if (count($registrants) > 0) {
+ $haveRegistrants = true;
+ }
+ }
// echo "<pre>".print_r($registrants,1)."</pre>";
$view = 'eventRegistrants';
'nextStart' => $nextStart,
'start' => $start,
'limit' => $limit,
+ 'registrantCount' => $registrantCount,
'namesList' => $namesList,
'textSearch' => $textSearch,
'regEventID' => $regEventID,
'regTimesJSON' => $regTimesJSON,
'classes' => $classes,
'haveRegistrants' => $haveRegistrants,
- 'registrants' => $registrants
+ 'registrants' => $registrants,
+ 'completed' => $completed,
+ 'errorMsg' => $errorMsg,
);
// echo "<pre>".print_r($templateData,1)."</pre>";
{include file='admin/registrations/eventHeader.html'}
{include file='admin/registrations/eventSubTabs.html'}
-
+
{if $errorMsg}
<h3 class="glm-error">{$errorMsg}</h3>
{/if}
-
<h1>Registrant List</h1>
-<div class="glm-admin-table-inner glm-admin-table">
+{* Search form for registrants *}
+<form method="post" action="{$thisUrl}?page={$thisPage}">
+ <input type="hidden" name="page" value="{$thisPage}">
+ <input type="hidden" name="option" value="registrants">
+ <input type="hidden" name="regEventID" value="{$regEvent.id}">
+ <input type="hidden" name="prevStart" value="{$prevStart}">
+ <input type="hidden" name="nextStart" value="{$nextStart}">
+ <input type="hidden" name="limit" value="{$limit}">
+ <div>
+ <p>
+ <span class="glm-nowrap">
+ <b>Show Completed Only:</b>
+ <input type="checkbox" name="complete" value="1"{if $completed} checked{/if}>
+ </span>
+ <span class="glm-nowrap">
+ <b>Text Search:</b>
+ <input type="text" name="textSearch" value="{if $textSearch}{$textSearch}{/if}">
+ </span>
+ <span clas="glm-nowrap">
+ <input type="submit" value="Submit">
+ </span>
+ </p>
+ </div>
+
+ <div class="glm-admin-table-inner glm-admin-table">
+
+ <p><b>Total found:</b> {$registrantCount} </p>
+
+ {if $paging}
+ <input type="Submit" name="pageSelect" value="Previous {$limit} {$terms.term_member_plur_cap}" class="button button-secondary glm-button"{if !$prevStart} disabled{/if}>
+ <input type="Submit" name="pageSelect" value="Next {$limit} {$terms.term_member_plur_cap}" class="button button-secondary glm-button"{if !$nextStart} disabled{/if}>
+ {/if}
<table class="wp-list-table striped glm-admin-table" style="width: 100%;">
<thead>
<tr>
- <th>First Name</th>
- <th>Last Name</th>
+ <th>Name</th>
<th>City</th>
<th>State</th>
<th>Phone</th>
{if $haveRegistrants}
{foreach $registrants as $r}
<tr>
- <td>{$r.fname}</td>
- <td>{$r.lname}</td>
+ <td><a href="{$thisUrl}?page=glm-members-admin-menu-registrations-accounts&glm_action=accounts&option=accountDashboard&accountID={$r.account.id}">{$r.fname} {$r.lname}</a></td>
<td>{$r.account.city}</td>
<td>{$r.account.state.value}</td>
<td>{$r.account.phone}</td>
</tbody>
</table>
-</div>
-
+
+ {if $paging}
+ <input type="Submit" name="pageSelect" value="Previous {$limit} {$terms.term_member_plur_cap}" class="button button-secondary glm-button"{if !$prevStart} disabled{/if}>
+ <input type="Submit" name="pageSelect" value="Next {$limit} {$terms.term_member_plur_cap}" class="button button-secondary glm-button"{if !$nextStart} disabled{/if}>
+ {/if}
+
+ </div>
+
+</form>
{include file='admin/footer.html'}