$search_id = false;
$numbDisplayed = false;
$lastDisplayed = false;
- $paging = false;
+ $paging = true;
$prevStart = false;
$nextStart = false;
- $start = '';//1;
- $limit = '';//20; // Set to the number of listings per page
+ $start = 1;
+ $limit = 20; // Set to the number of listings per page
$haveLeads = false;
$leadCount = 0;
$addingLead = false;
}
// $entry = $this->getList( $where );
- $orderBy = 'T.company ASC,T.lname ASC,T.fname ASC,T.updated DESC';
- $entryResults = $this->getList( $where, $orderBy );
+ $orderBy = 'T.company ASC,T.lname ASC,T.fname ASC,T.updated DESC';
+ $entryResults = $this->getList( $where, $orderBy, true, 'id', $start, $limit );
+ $stats = $this->getStats( $where );
+ // echo '<pre>$entryResults: ' . print_r( $entryResults, true ) . '</pre>';
+ echo '<pre>$stats: ' . print_r( $stats, true ) . '</pre>';
+
+ // 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;
+ }
+ }
// Get paging results
$params = '';
$numbDisplayed = $entryResults['returned'];
- $leadCount = $numbDisplayed;
+ // $leadCount = $numbDisplayed;
$lastDisplayed = $entryResults['last'];
if ( $start == 1 ) {
$prevStart = false;
if ( $entryResults['returned'] == $limit ) {
$nextStart = $start + $limit;
}
- $entry = $entryResults;//$entryResults['list'];
+ $entry = $entryResults['list'];
if ( count( $entry ) > 0 ) {
$haveLeads = true;
}
- $leadCount = count( $entry );
+ $leadCount = $stats;
$view = 'members.html';
<input type="submit" value="Download all in CSV file">
</form>
+ <form action="{$thisUrl}">
+ <input type="hidden" name="page" value="{$thisPage}" />
+ <input type="hidden" name="search" value="1" />
+ <input type="hidden" name="glm_action" value="members" />
+ <input type="hidden" name="prevStart" value="{$prevStart}">
+ <input type="hidden" name="nextStart" value="{$nextStart}">
+ <input type="hidden" name="limit" value="{$limit}">
+ <br clear="all">
<p><b>Total found:</b> {$leadCount} </p>
+ {if $paging}
+ <input type="hidden" name="search" value="1">
+ {if isset($smarty.request.company)}<input type="hidden" name="company" value="{$smarty.request.company}">{/if}
+ {if isset($smarty.request.contact)}<input type="hidden" name="contact" value="{$smarty.request.contact}">{/if}
+ {if isset($smarty.request.from_date)}<input type="hidden" name="from_date" value="{$smarty.request.from_date}">{/if}
+ {if isset($smarty.request.to_date)}<input type="hidden" name="to_date" value="{$smarty.request.to_date}">{/if}
+ {if isset($smarty.request.state)}
+ {foreach $smarty.request.state as $rState}
+ <input type="hidden" name="state[]" value="{$rState}" />
+ {/foreach}
+ {/if}
+ <input type="Submit" name="pageSelect" value="Previous {$limit} Leads" class="button button-secondary glm-button"{if !$prevStart} disabled{/if}>
+ <input type="Submit" name="pageSelect" value="Next {$limit} Leads" class="button button-secondary glm-button"{if !$nextStart} disabled{/if}>
+ {/if}
<table id="dataGrid" class="dataGrid">
<thead>
</tbody>
</table>
+ {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}
+ </form>
{else}
<table>
<tr>