<?php
defined('_VALID') or die('Restricted Access!');

Auth::checkAdmin();
require $config['BASE_DIR']. '/classes/pagination.class.php';

$sql            = "SELECT COUNT(image_id) AS total_images FROM notice_images";
$rs             = $conn->execute($sql);
$images_total   = $rs->fields['total_images'];
$pagination     = new Pagination(20);
$limit          = $pagination->getLimit($images_total);
$paging         = $pagination->getAdminPagination();
$sql            = "SELECT * FROM notice_images ORDER BY addtime DESC LIMIT " .$limit;
$rs             = $conn->execute($sql);
$images         = $rs->getrows();

$smarty->assign('images', $images);
$smarty->assign('images_total', $images_total);
$smarty->assign('paging', $paging);
?>