<?php
if (!defined("root")) {
	define("root", $_SERVER['DOCUMENT_ROOT']);
}
session_start();
require(root."/_common.php");
require(root."/_lib/db.php");
require(root."/_lib/main.php");
require(root."/mobileDetect/Mobile_Detect.php");
require(root."/_lib/bootstraps.php");
$page_title = "History Keluaran SGP";
$page_id = "history";
require(root."/_tpl/html_begin.php");
require(root."/_tpl/tag_head.php");
require(root."/_tpl/ie_style_exception.php");
/*
 * begin
 * additional style
 * */
cout('<style type="text/css">');
cout('');
cout('</style>');
/*
 * end
 * additional style
 * 
 * v
 * v
 * closing tag head
 * 
 * */
require(root."/_tpl/body_open.php");
cout('<div class="container-fluid main-body">');
	cout('<div class="decor-1"></div>');
	$rs=array(); $q="SELECT * FROM hasil WHERE isactive=1 AND kdpasar = 1 ORDER BY tanggal DESC LIMIT 0, 8";
	#$rs = callRS($q);
	callRS($rs, $q);
	cout('<input type="hidden" style="color:#000;" id="limit_keluaran" value="0,8" />');
	
	cout('<div class="container-fluid">');
		cout('<div class="container for-footer">');
			cout('<div class="decor decor-1"></div>');
			cout('<div class="decor decor-2"></div>');
			cout('<div class="decor decor-3"></div>');
			cout('<div class="special-box">');
				cout('<div class="decor decor-1"></div>');
				cout('<div class="decor decor-2"></div>');
				cout('<div class="content">');
					cout('<div class="decor decor-1"></div>');
					cout('<div class="decor decor-2"></div>');
					cout('<div class="title">');
						cout('<div class="page-title">History Keluaran Togel SGP</div>');
						cout('<div class="decor decor-1"></div>');
					cout('</div>');
					cout('<div class="real-content">');
						cout('<div class="free isi-keluaran" style="padding:10px;">');
							cout('<div class="row">');
								#cout('<div class="col-xs-1 col-md-1"></div>');
								for ($i=0;$i<count($rs);$i++) {
									/*
									if (($i) == 5) {
										cout('<div class="col-xs-1 col-md-1"></div>');
										cout('</div><!-- /.row -->');
										cout('<div class="row">');
										cout('<div class="col-xs-1 col-md-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 col-md-1"></div>');
							cout('</div><!-- /.row -->');
						cout('</div><!--/.free isi-keluaran-->');
						cout('<a href="#" style="display:block;border:1px white solid;margin:5px 15px;" class="text-center" onclick="loadKeluaran();return false;">Load More...</a>');
						cout('<script>
							function loadKeluaran() {
								var limit_keluaran = $("#limit_keluaran").val();
								$.ajax({
									type: "GET",
									url: "/_ajax/ajax_history.php",
									data: "a=loadmore&limit="+ limit_keluaran +"&time='.time().'",
									success: function(resp){
										var split_resp = resp.split("$$");
										$(".isi-keluaran").append(split_resp[0]);
										$("#limit_keluaran").val(split_resp[1]);
									}
								});
							}
						</script>');
					cout('</div>');
				cout('</div>');
			cout('</div><!--/.special-box-->');
			
		cout('</div><!--/.container for-footer-->');
	cout('</div><!--/.container-fluid-->');
	
	
/*
cout('<div class="container-fluid main-body">');
	cout('<div class="mb-top-layer1"></div><!--/.mb-top-layer1-->');
	cout('<div class="mb-top-layer2"></div><!--/.mb-top-layer2-->');
	cout('<div class="container isi-main-body">');
		cout('<div class="content-main-body">');
			cout('<div class="for-sub-section">');
				cout('<div class="title-sub-section text-center"><div class="title-sub-section2">HISTORY KELUARAN SGP 45</div><!--/.title-sub-section2--></div><!--/.title-sub-section text-center-->');
				
			cout('</div><!-- /.for-sub-section -->');
		cout('</div><!--/.content-main-body-->');
	cout('</div><!--/.container isi-main-body-->');
cout('</div><!--/.container-fluid main-body-->');
*/
require(root."/_tpl/body_close.php");
?>