$haveInvoices = false;
$filterAccounts = '';
$totalInvoices = false;
+ $filterPending = false;
+ $filterOverdue = false;
// For lockedToMember
$lockedToMember = false;
$where_params[] = "T.account = $filterAccounts";
}
+ if ( isset( $_REQUEST['filterPending'] ) ) {
+ $filterPending = filter_var( $_REQUEST['filterPending'], FILTER_VALIDATE_BOOLEAN );
+ }
+ if ( isset( $_REQUEST['filterOverdue'] ) ) {
+ $filterOverdue = filter_var( $_REQUEST['filterOverdue'], FILTER_VALIDATE_BOOLEAN );
+ }
+
// Build the $where from $where_params array.
// By imploding them with AND between each array element.
$where = implode( ' AND ', $where_params );
'accounts' => $accounts,
'filterAccounts' => $filterAccounts,
'totalInvoices' => $totalInvoices,
+ 'filterPending' => $filterPending,
+ 'filterOverdue' => $filterOverdue,
);
// echo '<pre>$templateData: ' . print_r( $templateData, true ) . '</pre>';
$fromMemberMenu = false;
$filterAccounts = '';
$totalInvoices = false;
+ $filterPending = false;
+ $filterOverdue = false;
// Get any provided option
if (isset($_REQUEST['option'])) {
$where_params[] = "T.account = $filterAccounts";
}
+ if ( isset( $_REQUEST['filterPending'] ) ) {
+ $filterPending = filter_var( $_REQUEST['filterPending'], FILTER_VALIDATE_BOOLEAN );
+ $where_params[] = "T.paid <> true";
+ $where_params[] = "T.due_date > now()";
+ }
+ if ( isset( $_REQUEST['filterOverdue'] ) ) {
+ $filterOverdue = filter_var( $_REQUEST['filterOverdue'], FILTER_VALIDATE_BOOLEAN );
+ // $where_params[] = "T.due_date <= '" . date( 'Y-m-d' ) . "'";
+ $where_params[] = "T.paid <> true";
+ $where_params[] = "T.due_date < now()";
+ }
+
// Build the $where from $where_params array.
// By imploding them with AND between each array element.
$where = implode( ' AND ', $where_params );
'fromMemberMenu' => $fromMemberMenu,
'filterAccounts' => $filterAccounts,
'totalInvoices' => $totalInvoices,
+ 'filterPending' => $filterPending,
+ 'filterOverdue' => $filterOverdue,
);
// Return status, any suggested view, and any data to controller
<input id="member-account" type="hidden" name="filterAccounts" value="{$filterAccounts}">
<input id="account_name" name="searchName" value="" />
</span>
+ <br>
+ <span class="glm-nowrap">
+ <input id="filterPending" name="filterPending" value="1" {if $filterPending}checked{/if} type="checkbox" /> Show Pending Only
+ <input id="filterOverdue" name="filterOverdue" value="1" {if $filterOverdue}checked{/if} type="checkbox" /> Show Overdue Only
+ </span>
+ <br>
<span class="glm-nowrap">
<input type="submit" value="Submit">
</span>
+
<p>
</div>
<br clear="all">