$annFromDate = '';
$annToDate = '';
$totalAccounts = false;
+ $allAccounts = false;
+ $filterAccounts = false;
// Get any provided option
if (isset($_REQUEST['option'])) {
case 'list':
default:
+ $allAccounts = $this->getSimpleAccountList();
+
$where_params = array( 'true' );
// Check for paging
$annTo_date = date( 'Y-m-d', strtotime( $annToDate ) );
$where_params[] = "T.anniversary_date <= '$annTo_date'";
}
+ if ( isset( $_REQUEST['filterAccounts'] )
+ && $filterAccounts = filter_var( $_REQUEST['filterAccounts'], FILTER_VALIDATE_INT )
+ ) {
+ $accounts[$filterAccounts]['selected'] = true;
+ $where_params[] = "T.id = $filterAccounts";
+ }
+
// Build the $where string from the $where_parts array.
// By implode with AND.
'annFromDate' => $annFromDate,
'annToDate' => $annToDate,
'totalAccounts' => $totalAccounts,
+ 'allAccounts' => $allAccounts,
+ 'filterAccounts' => $filterAccounts,
);
// Return status, any suggested view, and any data to controller
<b>To Date: </b><input type="text" name="annToDate" value="{$annToDate}" class="glm-form-text-input-short glm-date-input">
</span>
<br>
+ <span class="glm-nowrap">
+ <b>Member Account: </b>
+ <input id="member-account" type="hidden" name="filterAccounts" value="{$filterAccounts}">
+ <input id="account_name" name="searchName" value="" />
+ </span>
+ <br>
<span class="glm-nowrap">
<input type="submit" value="Submit">
</span>
dateFormat: 'mm/dd/yy'
});
+ var availableAccounts = [
+ {foreach $allAccounts as $m}
+ { label: "{$m.ref_name|unescape:'html'|replace:'"':''}", value: "{$m.ref_name|unescape:'html'|replace:'"':''}", id: '{$m.id}' },
+ {/foreach}
+ ]
+
+ $('#account_name').autocomplete({
+ source: availableAccounts,
+ select: function( event, ui ){
+ $('#member-account').val( ui.item.id );
+ },
+ });
+
+ {if $filterAccounts}
+ {$selected = 0}
+ {foreach $accounts as $m}
+ {if $m.id == $filterAccounts}
+ {$selected = $m.ref_name|unescape:'html'|replace:'"':''}
+ {/if}
+ {/foreach}
+ $('#account_name').autocomplete().val('{$selected}');
+ {/if}
+
});
</script>