Pagination added for admin area logs

This commit is contained in:
Saqib Razzaq 2016-03-28 15:13:00 +05:00
parent b40f5d10ef
commit 3054f34f88
2 changed files with 10 additions and 2 deletions

View file

@ -24,7 +24,11 @@ if (isset($_GET['type'])) {
$type = $_GET['type'];
$result_array['type'] = $type;
}
$result_array['limit'] = 20;
if (isset($_GET['limit'])) {
$result_array['limit'] = $_GET['limit'];
} else {
$result_array['limit'] = 20;
}
if(!$array['order'])
$result_array['order'] = " DESC ";

View file

@ -76,9 +76,13 @@
</table>
{$type = $smarty.get.type}
{$nextPage = $smarty.get.page + 1}
{if $smarty.get.limit}
{$limit = $smarty.get.limit}
{/if}
{if $type != ''}
<a href="{$baseurl}/admin_area/action_logs.php?type={$type}&page={$nextPage}"><button class="col-md-5 btn btn-primary" id="fetch_more_logs" loadHit="1" loadType="{$type}" {if $total_logs < 1}disabled="disabled"{/if}>{if $total_logs < 1}End of results{else}Load More{/if}</button></a>
{else}
<a href="{$baseurl}/admin_area/action_logs.php?page={$nextPage}{if $limit > 1}&limit={$limit}{/if}"><button class="col-md-5 btn btn-primary" id="fetch_more_logs" loadHit="1" loadType="{$type}" {if $total_logs < 1}disabled="disabled"{/if}>{if $total_logs < 1}End of results{else}Load More{/if}</button></a>
{/if}
<style type="text/css">