$fromDate = date('m/d/Y', strtotime($_REQUEST['fromDate']));
$fromMYSQL = date('Y-m-d', strtotime($fromDate));
$dateWhere = " end_time >= '$fromMYSQL' ";
+ } else if ( !$filterArchived ) {
+ $fromDate = date('m/d/Y');
+ $fromMYSQL = date('Y-m-d', strtotime($fromDate));
+ $dateWhere = " end_time >= '$fromMYSQL' ";
}
// If we have a to Date
// Get the list of events and determine number of events in list
$saveFLT = $this->postFirstAndLastTimes;
$this->postFirstAndLastTimes = true;
- $eventsResult = $this->getList($where, 'name', true, 'id', $start, $limit);
+ $orderBy = 'name';
+ $orderBy = "(select min(start_time) FROM " . GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "times WHERE T.id = event),name";
+ $eventsResult = $this->getList($where, $orderBy, true, 'id', $start, $limit);
$this->postFirstAndLastTimes = $saveFLT;
// Get paging results
$("#filterArchived").on('click', function() {
$("#filterPending").attr('checked', false);
+ $('input[name=fromDate]').val('');
});
$("#filterPending").on('click', function() {