<?php 

$dir = '../';

require_once $dir.'includes/main.php';

$offset = (int)$_POST['offset'];

$sql = "SELECT * FROM listings WHERE status = 'active' AND points > 0 ORDER BY points DESC, id ASC LIMIT $offset, {$per['listings']}";

$offset = $offset + 1;

fetch_elements($sql, 'elements/listings/main.php', 'x', $offset);

?>