<?php
if (!defined("root")) {
	define("root", $_SERVER['DOCUMENT_ROOT']);
}
ob_start();
require(root."/___simple_config.php");
session_start();
require(root."/_common.php");
require(root."/_lib/db.php");
require(root."/_lib/main.php");
require(root."/_lib/bootstraps.php");
$a = cekpost(cleanQuery($_GET["a"]), "");
if ($a=="loadmore") {
	$limit = cekpost(cleanQuery($_GET["limit"]), "");
	if ($limit!="") {
		$limit_pecah = explode(",", $limit);
		$limit_op = trim($limit_pecah[0]);
		$limit_ed = trim($limit_pecah[1]);
		$next_limit_op = $limit_op + 8;
		$next_limit_ed = 8;
		$next_limit = "$next_limit_op, $next_limit_ed";
		$rs=array(); $q="SELECT * FROM hasil WHERE isactive=1 AND kdpasar = 1 ORDER BY tanggal DESC LIMIT $next_limit";
		#$rs = callRS($q);
		callRS($rs, $q);
		cout('<div class="row">');
			#cout('<div class="col-xs-1"></div>');
			for ($i=0;$i<count($rs);$i++) {
				/*
				if (($i) == 5) {
					cout('<div class="col-xs-1"></div>');
					cout('</div><!-- /.row -->');
					cout('<div class="row">');
					cout('<div class="col-xs-1"></div>');
				}
				*/
				cout('<div class="col-xs-3 col-md-3 text-center">');
					cout('<div style="border:1px white solid;margin:5px;padding:5px;">');
						cout('<div>'.date('l', $rs[$i]["tanggal"]).'</div>');
						cout('<div>'.date('d M Y', $rs[$i]["tanggal"]).'</div>');
						cout('<div style="font-size:200%;">'.$rs[$i]["nomor"].'</div>');
					cout('</div>');
				cout('</div>');
			}
			#cout('<div class="col-xs-1"></div>');
		cout('</div><!-- /.row -->');
		echo "$$";
		echo $next_limit;
	}
}
?>