// Only return information records that are active
$whereParts = array();
+
// Filter for complete if given
- 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']})";
-
- $whereParts[] = " T.not_attending <> true ";
+ if ( isset($_REQUEST['status']) && is_array($_REQUEST['status']) && count($_REQUEST['status']) > 0 ) {
+
+ // Collect all checked status values
+ $statusSelected = array();
+ foreach ($_REQUEST['status'] as $statusValue => $statusName) {
+ $statusSelected[] = $statusValue;
+ }
+ $statusList = implode(',', $statusSelected);
+
$whereParts[] = "
(
SELECT count(id)
FROM " . GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request
WHERE id = T.reg_request
- AND status NOT IN
- (
- {$this->config['submission_status_numb']['CART']},
- {$this->config['submission_status_numb']['FAILED']},
- {$this->config['submission_status_numb']['CANCELED']}
- )
+ AND status IN ($statusList)
) > 0
";
+ } else {
+ die('ERROR: No status selected');
}
+ $whereParts[] = "T.not_attending <> true";
+
// Check for a text search
if (isset($_REQUEST['text_search']) && trim($_REQUEST['text_search'] != '')) {
$textSearch = trim($_REQUEST['text_search']);
<input type="hidden" name="glm_action" value="registrantsListExport">
<input type="hidden" name="regEventID" value="{$regEvent.id}">
<table class="glm-admin-table">
- <tr><td colspan="2"><label><input type="checkbox" name="complete" value="1" checked>Don't show attendees in pending or invalid carts</label></td></tr>
+
<tr>
<th>Name Search:</th>
<td><input type="text" name="text_search" value=""></td>
</tr>
+ <tr>
+ <th>Request Status:</th>
+ <td>
+ <table padding="3">
+ <tr>
+ <td class="exportFieldsTd">
+ <a id="selectAllStatusFields" class="button button-secondary button-small">Check All</a> <a class="button button-secondary button-small" id="unselectAllStatusFields">Uncheck All</a> Please select at least one.<br>
+ {foreach from=$submitStatus key=status_id item=status_name}
+ <input class="statusCheckbox" type="checkbox" name="status[{$status_id}]"> {$status_name}<br>
+ {/foreach}
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
<tr>
<th>Fields to export:</th>
<td>
<table padding="3">
<tr>
- <td colspan="2"><a id="selectAllExportFields">Check All</a> / <a id="unselectAllExportFields">Uncheck All</a></td>
+ <td colspan="2"><a id="selectAllExportFields" class="button button-secondary button-small">Check All</a> <a class="button button-secondary button-small" id="unselectAllExportFields">Uncheck All</a></td>
</tr>
<tr>
<td class="exportFieldsTd">
- <input class="" type="checkbox" name="exportId"> {$terms.reg_term_attendee_cap} ID<br>
- <input type="checkbox" name="exportRegistrant" checked> {$terms.reg_term_attendee_cap} Name<br>
- <input type="checkbox" name="exportAddr1" checked> Address Line #1<br>
- <input type="checkbox" name="exportAddr2" checked> Address Line #2<br>
- <input type="checkbox" name="exportCity" checked> City<br>
- <input type="checkbox" name="exportState" checked> State<br>
- <input type="checkbox" name="exportZip" checked> ZIP/Postal Code<br>
+ <input class="exportField" type="checkbox" name="exportId"> {$terms.reg_term_attendee_cap} ID<br>
+ <input class="exportField" type="checkbox" name="exportRegistrant" checked> {$terms.reg_term_attendee_cap} Name<br>
+ <input class="exportField" type="checkbox" name="exportAddr1" checked> Address Line #1<br>
+ <input class="exportField" type="checkbox" name="exportAddr2" checked> Address Line #2<br>
+ <input class="exportField" type="checkbox" name="exportCity" checked> City<br>
+ <input class="exportField" type="checkbox" name="exportState" checked> State<br>
+ <input class="exportField" type="checkbox" name="exportZip" checked> ZIP/Postal Code<br>
</td>
<td class="exportFieldsTd">
- <input type="checkbox" name="exportEmail" checked> Email <br>
- <input type="checkbox" name="exportPhone" checked> Phone <br>
- <input type="checkbox" name="exportCounty" checked> County <br>
- <input type="checkbox" name="exportLevel" checked> Level <br>
- <input type="checkbox" name="exportTime" checked> Date/Time <br>
- <input type="checkbox" name="exportRate" checked> Rate <br>
- <input type="checkbox" name="exportStatus" checked> Status <br>
+ <input class="exportField" type="checkbox" name="exportEmail" checked> Email <br>
+ <input class="exportField" type="checkbox" name="exportPhone" checked> Phone <br>
+ <input class="exportField" type="checkbox" name="exportCounty" checked> County <br>
+ <input class="exportField" type="checkbox" name="exportLevel" checked> Level <br>
+ <input class="exportField" type="checkbox" name="exportTime" checked> Date/Time <br>
+ <input class="exportField" type="checkbox" name="exportRate" checked> Rate <br>
+ <input class="exportField" type="checkbox" name="exportStatus" checked> Status <br>
{if apply_filters('glm-members-customfields-plugin-active', false)}
- <input type="checkbox" name="exportCustom" checked> Custom Fields <br>
+ <input class="exportField" type="checkbox" name="exportCustom" checked> Custom Fields <br>
{/if}
</td>
</tr>
</tr>
</table>
<a id="exportRegistrantsCancel" class="button button-secondary glm-right">Cancel</a>
- <input type="submit" value="Export" class="button button-primary">
+ <input id="exportSubmitButton" type="submit" value="Export" class="button button-primary">
</form>
</div>
<script>
jQuery(document).ready(function($){
+ // Export Submit Action to check for at least one status selected
+ $('#exportSubmitButton').click(function(){
+ if (!$('.statusCheckbox').is(":checked")) {
+ alert('Please select at least one request status.');
+ return false;
+ }
+ });
+
// Setup the Export Registrant Dialog
var dialog = $('#exportRegistrantsDialog').dialog({
autoOpen: false,
- minWidth: 500,
+ minWidth: 600,
dialogClass: 'glm-dialog-no-close',
});
$('#exportRegistrantsDialog').dialog('close');
});
+ // Setup the Status select and unselect all
+ $('#selectAllStatusFields').click(function(){
+ $('.statusCheckbox').each(function(){
+ $(this).prop('checked', true);
+ });
+ });
+ $('#unselectAllStatusFields').click(function(){
+ $('.statusCheckbox').each(function(){
+ $(this).prop('checked', false);
+ });
+ });
+
// Setup the Export select and unselect all
$('#selectAllExportFields').click(function(){
- $('.exportFieldsTd input[type="checkbox"]').each(function(){
+ $('.exportField').each(function(){
$(this).prop('checked', true);
});
});
$('#unselectAllExportFields').click(function(){
- $('.exportFieldsTd input[type="checkbox"]').each(function(){
+ $('.exportField').each(function(){
$(this).prop('checked', false);
});
});