$entry = false;
$hasSearch = false;
$tab = 0;
+ $params = false;
// Get any provided option
if ( isset( $_REQUEST['option'] ) ) {
}
$order = "T.lname, T.fname";
}
+ // 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;
+ }
+ }
+ // $entry = $this->getList( $where );
+ $orderBy = 'T.company ASC,T.lname ASC,T.fname ASC,T.updated DESC';
+ $entryResults = $this->getList( $where, $orderBy, true, 'id', $start, $limit );
+
+ // Get paging results
+ $numbDisplayed = $entryResults['returned'];
+ $leadCount = $numbDisplayed;
+ $lastDisplayed = $entryResults['last'];
+ if ( $start == 1 ) {
+ $prevStart = false;
+ } else {
+ $prevStart = $start - $limit;
+ if ( $start < 1 ) {
+ $start = 1;
+ }
+ }
+ if ( $entryResults['returned'] == $limit ) {
+ $nextStart = $start + $limit;
+ }
+ $entry = $entryResults['list'];
+ if ( count( $entry ) > 0 ) {
+ $haveLeads = true;
+ }
- $entry = $this->getList( $where );
+ $leadCount = count( $entry );
$view = 'index.html';
// Common things to place into the $templateData array
$templateData = array(
'hasSearch' => $hasSearch,
+ 'params' => $params,
'lead' => $entry,
'haveLeads' => $haveLeads,
'leadCount' => $leadCount,
{include file='admin/travel/searchForm.html'}
{if $lead}
+ <form action="{$thisUrl}">
+ <input type="hidden" name="page" value="{$thisPage}" />
+ <input type="hidden" name="glm_action" value="index" />
+ <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="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>
<tr>
</thead>
<tbody>
{foreach $lead as $e}
- <tr class="{if $c@iteration is div by 2}even{else}odd{/if}">
- <td> <a class="company_link" href="{$thisUrl}?page={$thisPage}&glm_action=index&option=edit&id={$e.id}">Edit</a></td>
+ <tr class="{if $e@iteration is div by 2}even{else}odd{/if}">
+ <td> <a class="company_link" href="{$thisUrl}?page={$thisPage}&glm_action=index&option=edit&id={$e.id}&{$params}">Edit</a></td>
<td> {$e.company} </td>
<td> {$e.fname} </td>
<td> {$e.lname} </td>
{/foreach}
</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}
No search results!
{/if}