if (!User::is_logged_in() || User::get_id() != 1) {
    header('Location: index.php');
    exit;
}
if (isset($_GET['d'])) {
    $d = (int) $_GET['d'];
    AdReview::delete($d);
}
$tct = AdReview::count();
//total count
$rpp = 10;
//row per page
$pager_options = array('mode' => 'Sliding', 'perPage' => $rpp, 'delta' => 2, 'totalItems' => $tct, 'excludeVars' => array('o', 'r', 'd', 't', 'e'));
$pager = @Pager::factory($pager_options);
list($from, $to) = $pager->getOffsetByPageId();
$reviews = AdReview::get_all(array(), '', $from - 1 . ", {$rpp}");
include "page-header.php";
?>

<div id="wrapper">
	
	<?php 
include "page-left.php";
?>

	<div id="content">

		<?php 
if ($tct > $rpp) {
    echo $pager->links . '<br /><br />';
}
Beispiel #2
0
<?php

/**
 * Classified-ads-script
 * 
 * @copyright  Copyright (c) Szilard Szabo
 * @license    GPL v3
 * @package    Frontend
 */
include "./admin/include/common.php";
include "Pager/Pager.php";
$g_id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
$exists = Ad::exists($g_id, array("active  " => 1));
if ($exists) {
    $ad = Ad::get_one($g_id);
    $is_favourite = Favourite::exists(User::get_id(), $ad['id']);
    $reviews = AdReview::get_all(array('ad_id' => $g_id));
}
include "./templates/ad.php";