<?php
if($detect->isMobile()){
	require(root."/_tpl/body_close.m.php");
} else {
	cout('<div class="container-fluid for-footer">');
		cout('<div class="container text-center">');
			cout('Copyright ');
			cout('<span class="copycopy">&copy;</span> ');
			cout(''.date('Y').' ');
			cout('<span itemprop="author" itemscope itemtype="http://schema.org/Person">');
				cout('<text itemprop="name" class="text-warning"><strong>Bolabom</strong></text>');
			cout('</span> ');
			cout('All Rights Reserved');
		cout('</div><!--/.container-->');
	cout('</div><!--/.container-fluid-->');
	
	cout('<script>');
		cout('function doScrollDP(parCST) {');
			cout('var nST = parCST + 336;');
			cout('if (nST>1008) { nST = 0; }');
			cout('setTimeout(function(){');
				cout('$(".forscrolldp").animate({ scrollTop: nST }, 3000, function(){');
					cout('doScrollDP(nST);');
				cout('});');
			cout('}, 4000);');
		cout('}');
		cout('function doScrollWD(parCST) {');
			cout('var nST = parCST + 336;');
			cout('if (nST>1008) { nST = 0; }');
			cout('setTimeout(function(){');
				cout('$(".forscrollwd").animate({ scrollTop: nST }, 3000, function(){');
					cout('doScrollWD(nST);');
				cout('});');
			cout('}, 4000);');
		cout('}');
		cout('function loadMarquee() {');
			# basic version is: $("div.demo marquee").marquee() - but we\'re doing some sexy extras
			cout('$(".running-text marquee").marquee("pointer").mouseover(function () {');
				cout('$(this).trigger("stop");');
			cout('}).mouseout(function () {');
				cout('$(this).trigger("start");');
			cout('}).mousemove(function (event) {');
				cout('if ($(this).data("drag") == true) {');
					cout('this.scrollLeft = $(this).data("scrollX") + ($(this).data("x") - event.clientX);');
				cout('}');
			cout('}).mousedown(function (event) {');
				cout('$(this).data("drag", true).data("x", event.clientX).data("scrollX", this.scrollLeft);');
			cout('}).mouseup(function () {');
				cout('$(this).data("drag", false);');
			cout('});');
		cout('}');
		
		cout('$(window).load(function(){');
			#cout('$(".streaming-video-container").css({ width:$(".streaming-video-container div:first-child").width()+"px", "margin":"0 auto", "border":"1px red solid" });');
			$rsa=array();$qa="SELECT * FROM s_announcements WHERE isactive=1 ORDER BY tanggal DESC LIMIT 0,1";
			$rsa = callRS($qa);
			if (count($rsa)!=0) {
				cout('$(".pending-load-running-text").html("<marquee behavior=\"scroll\" scrollamount=\"1\" direction=\"left\"><a href=\"'.absDom.'/announcements/'.$rsa[0]["url"].'\">'.$rsa[0]["judul"].'</a></marquee>");');
				cout('loadMarquee();');
			}
			cout('setTimeout(function(){');
				cout('doScrollDP(0);');
				cout('doScrollWD(0);');
			cout('}, 100);');
		cout('});');
	cout('</script>');


	$waktuKuisMulai = '22-Oct-2016 08:45:00';
	if (($page_id=="index" || $page_id=="promo") && (time() >= strtotime($waktuKuisMulai))) {
		#cout('<!-- Modal -->
		#<div class="modal fade" id="modalPop" tabindex="-1" role="dialog" aria-labelledby="modalPopLabel" aria-hidden="true">
		#	<div class="modal-dialog popKuisBox">
		#		<div class="modal-content">
		#			<!--<div class="modal-header">
		#				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
		#				<div class="modal-title" style="font-size:18px;font-weight:500;">Modal title</div>
		#			</div>-->
		#			<div class="modal-body row" style="background:rgba(100,100,100,0.6);padding:5px;margin:0;"><div class="te modal-body-x">
		#				<div class="text-center" style="border:0px red solid;background:rgba(255,255,255,1);position:absolute;top:0;right:-35px;width:30px;height:30px;padding:0;margin:0;border-radius:15px;">
		#					<span class="close" data-dismiss="modal" aria-hidden="true" style="position:absolute;left:50%;margin-left:-15px;width:30px;display:block;font-size:40px;line-height:30px;text-shadow:none;"><span class="text-danger">&times;</span></span>
		#				</div>
		#				<div class="popKuisContent">
		#					<img src="'.absDom.'/img/popupkuistebakskor-2.jpg" alt="Bolabom Kuis Tebak Score FB Valencia vs Barcelona" class="center-block img-responsive" />
		#					<a class="bandPop text-" href="//www.facebook.com/bom.bolabom" target="_blank"></a>
		#				</div>
		#			</div></div>
		#			<!--<div class="modal-footer">
		#				<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
		#				
		#			</div>-->
		#		</div><!-- /.modal-content -->
		#	</div><!-- /.modal-dialog -->
		#</div><!-- /.modal -->');
	}
	$popUtkSenin = date('N', time());
	$justDate = date('d-M-Y', time());
	$justTime = date('H:i:s', time());
	$justTimeStart = date('H:i:s', strtotime($justDate.' 11:00:00'));
	$justTimeEnd = date('H:i:s', strtotime($justDate.' 13:30:00'));
	$timeStart = strtotime($justDate.' '.$justTimeStart);
	$timeEnd = strtotime($justDate.' '.$justTimeEnd);
	$timeUtkSenin = "";
	#cout('<!-- '.$popUtkSenin.' - '.$justDate.' '.$justTimeStart.' '.$justTimeEnd.' - '.$timeStart.' < '.time().' > '.$timeEnd.' -->');
	#cout('<!-- '.$popUtkSenin.' - '.$timeStart.' '.time().' '.$timeEnd.' -->');
	#cout('<!-- '.$popUtkSenin.' - '.$justDate.' '.$justTimeStart.' '.date('d-M-Y H:i:s', time()).' '.$justDate.' '.$justTimeEnd.' -->');
	#if ($timeStart <= time()) { cout('<!-- a1 -->'); }
	#if (time() <= $timeEnd) { cout('<!-- a2 -->'); }
	if ($page_id=="index" && $popUtkSenin=="1" && $timeStart <= time() && time() <= $timeEnd) {
		cout('<!-- Modal -->');
		cout('<div class="modal fade" id="modalPopSenin" tabindex="-1" role="dialog" aria-labelledby="modalPopLabel" aria-hidden="true">');
			cout('<div class="modal-dialog popTOBox">');
				cout('<div class="modal-content">');
					cout('<!--<div class="modal-header">');
						cout('<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>');
						cout('<div class="modal-title" style="font-size:18px;font-weight:500;">Modal title</div>');
					cout('</div>-->');
					cout('<div class="modal-body row" style="background:rgba(100,100,100,0.6);padding:5px;margin:0;"><div class="te modal-body-x">');
						cout('<div class="text-center" style="border:0px red solid;background:rgba(255,255,255,1);position:absolute;top:0;right:-35px;width:30px;height:30px;padding:0;margin:0;border-radius:15px;">');
							cout('<span class="close" data-dismiss="modal" aria-hidden="true" style="position:absolute;left:50%;margin-left:-15px;width:30px;display:block;font-size:40px;line-height:30px;text-shadow:none;"><span class="text-danger">&times;</span></span>');
						cout('</div>');
						cout('<div class="popTOWait">');
							cout('<img src="'.absDom.'/img/tunggu.jpg" alt="Bolabom Bonus CB dan Rollingan" class="center-block img-responsive" />');
						cout('</div>');
					cout('</div></div>');
					cout('<!--<div class="modal-footer">');
						cout('<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>');
					cout('</div>-->');
				cout('</div><!-- /.modal-content -->');
			cout('</div><!-- /.modal-dialog -->');
		cout('</div><!-- /.modal -->');
	}
	if ($page_id=="index") {
		
		#cout('<!-- Modal -->');
		#cout('<div class="modal fade" id="modalPopBank" tabindex="-1" role="dialog" aria-labelledby="modalPopBankLabel" aria-hidden="true">');
		#	cout('<div class="modal-dialog popBankBox">');
		#		cout('<div class="modal-content">');
		#			cout('<div class="modal-header">');
		#				cout('<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>');
		#				cout('<div class="modal-title" style="font-size:18px;font-weight:500;"><div class="text-center text-danger">PERHATIAN <strong>!!</strong></div></div>');
		#			cout('</div>');
		#			cout('<div class="modal-body row" style="background:rgba(100,100,100,0.6);padding:5px;margin:0;"><div class="te modal-body-x">');
		#				cout('<div class="popBankWait">');
		#					cout('<img src="'.absDom.'/img/pop-bca.jpg" alt="Bolabom BCA" class="center-block img-responsive" />');
		#				cout('</div>');
		#			cout('</div></div>');
		#			cout('<!--<div class="modal-footer">');
		#				cout('<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>	');
		#			cout('</div>-->');
		#		cout('</div><!-- /.modal-content -->');
		#	cout('</div><!-- /.modal-dialog -->');
		#cout('</div><!-- /.modal -->');
	}
	#cout('<div class="hidden-xs hidden-sm">');
	#	cout('<div style="height:100px;"></div>');
	#cout('</div><!-- /.hidden-xs hidden-sm -->');

	#cout('<div class="hidden-md hidden-lg hidden-xl">');
	#	cout('<div style="height:50px;"></div>');
	#cout('</div><!-- /.hidden-md hidden-lg hidden-xl -->');
	if ($page_id=="index") {
		cout('<div class="modal fade" id="modalPopPoker" tabindex="-1" role="dialog" aria-labelledby="modalPopBankLabel" aria-hidden="true">');
			cout('<div class="modal-dialog popBankBox">');
				cout('<div class="modal-content">');
					cout('<div class="modal-header">');
						
						#cout('<div class="modal-title" style="font-size:18px;font-weight:500;"><div class="text-center text-danger">PokerTAN.com</div></div>');
					cout('</div>');
					cout('<div class="modal-body row" style="padding:5px;margin:0;"><div class="te modal-body-x">');
						cout('<div class="modal-close-button-custom">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true" >&times;</button>
						</div>');
						#cout('<button type="button" class="close" data-dismiss="modal" aria-hidden="true" 
						#	style="background:#fff;border-radius:15px;display:block;width:30px;height:30px;position:absolute;opacity:1;right:-35px;top:0;line-height:30px;font-size:45px;">&times;</button>');
						cout('<div class="popBankWait">');
							cout('<img src="'.absDom.'/img/popup-pokertan.v2.jpg" alt="Bandar Poker TAN" class="center-block img-responsive" />');
						cout('</div>');
					cout('</div></div>');
					cout('<!--<div class="modal-footer">');
						cout('<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>	');
					cout('</div>-->');
				cout('</div><!-- /.modal-content -->');
			cout('</div><!-- /.modal-dialog -->');
		cout('</div><!-- /.modal -->');
	}
	if ($page_id=="index" && $popUtkSenin=="1" && $timeStart <= time() && time() <= $timeEnd) {
	} else {
		#cout('<!-- Modal -->');
		/*
		cout('<div class="modal fade" id="modalPopImlek" tabindex="-1" role="dialog" aria-labelledby="modalPopBankLabel" aria-hidden="true">');
			cout('<div class="modal-dialog popBankBox">');
				cout('<div class="modal-content">');
					cout('<div class="modal-header">');
						cout('<button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="margin:5px 5px 0 0;">&times;</button>');
						cout('<div class="modal-title" style="font-size:18px;font-weight:500;"><div class="text-center text-danger">Promo Angpao <strong>!!</strong></div></div>');
					cout('</div>');
					cout('<div class="modal-body row" style="background:rgba(100,100,100,0.6);padding:5px;margin:0;"><div class="te modal-body-x">');
						cout('<div class="popBankWait">');
							cout('<img src="'.absDom.'/img/angpao/popup-imlek.png" alt="Promo Angpao Imlek 2018" class="center-block img-responsive" />');
						cout('</div>');
					cout('</div></div>');
					cout('<!--<div class="modal-footer">');
						cout('<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>	');
					cout('</div>-->');
				cout('</div><!-- /.modal-content -->');
			cout('</div><!-- /.modal-dialog -->');
		cout('</div><!-- /.modal -->');
		*/
		
	}
	cout('<script>');
		if (($page_id=="index" || $page_id=="promo") && (time() >= strtotime($waktuKuisMulai))) {
			#cout('
			#$(window).load(function(){
			#	$(".popKuisBox").css({ width:"515px" });
			#	$(".popKuisContent").css({ width:"500px", position:"relative", overflow:"hidden", margin:"auto" });
			#	$(".bandPop").css({ display:"block", overflow:"hidden", position:"absolute", left:"5px", "top":"320px", padding:"5px 10px", width:"490px", height:"35px", "line-height":"25px", background:"rgba(0,255,0,0.1)"  });
			#	$(".bandPop").bind("mouseenter", function(){
			#		$(".bandPop").css({ "text-decoration":"none" });
			#	});
			#	blinkBlink("0");
			#	$(".popKuisContent").bind("mouseenter", function(){
			#		//$(".bandPop").stop().animate({ "right":"0" });
			#	});
			#	$(".popKuisContent").bind("mouseleave", function(){
			#		//$(".bandPop").stop().animate({ "right":"-200px" });
			#	});
			#	$("#modalPop").modal("show");
			#});
			#function blinkBlink(parTipe) {
			#	var opacityNya = (parTipe=="0")?"1":"0";
			#	$(".bandPop").stop().animate({ "opacity":opacityNya }, function(){
			#		blinkBlink(opacityNya);
			#	});
			#}
			#');
		}
		if ($page_id=="index" && $popUtkSenin=="1" && $timeStart <= time() && time() <= $timeEnd) {
			
			cout('$(window).load(function(){');
				cout('$(".popTOBox").css({ width:"515px" });');
				cout('$(".popTOWait").css({ width:"500px", position:"relative", overflow:"hidden", margin:"auto" });');
				cout('$("#modalPopSenin").modal("show");');
			cout('});');
			
		} else {
			
			#cout('$(window).load(function(){');
			#	cout('$("#modalPopBank").modal("show");');
			#cout('});');
			
			#cout('$(window).load(function(){');
			#	cout('$("#modalPopImlek").modal("show");');
			#cout('});');
			
			
		}
		if ($page_id=="index") {
			cout('$(window).load(function(){');
				cout('$("#modalPopPoker").modal("show");');
			cout('});');
		}
		if ($page_id=="index"  && $popUtkSenin!="1") {
			
			#cout('$(window).load(function(){');
			#	cout('$("#modalPopBank").modal("show");');
			#cout('});');
			
		}
		
		cout('function loadMarquee() {');
			# basic version is: $("div.demo marquee").marquee() - but we\'re doing some sexy extras
			cout('$(".running-text marquee").marquee("pointer").mouseover(function () {');
				cout('$(this).trigger("stop");');
			cout('}).mouseout(function () {');
				cout('$(this).trigger("start");');
			cout('}).mousemove(function (event) {');
				cout('if ($(this).data("drag") == true) {');
					cout('this.scrollLeft = $(this).data("scrollX") + ($(this).data("x") - event.clientX);');
				cout('}');
			cout('}).mousedown(function (event) {');
				cout('$(this).data("drag", true).data("x", event.clientX).data("scrollX", this.scrollLeft);');
			cout('}).mouseup(function () {');
				cout('$(this).data("drag", false);');
			cout('});');
		cout('}');
		
		cout('function switchChannel(parObj) {');
			cout('var objClass = parObj.attr("class");');
			cout('objClass = objClass.replace("each-channel", "");');
			cout('objClass = objClass.trim();');
			cout('var xxxVideo = $("."+ objClass +" .content-ch").html();');
			cout('xxxVideo = xxxVideo.replace(/&gt;/g, ">");');
			cout('xxxVideo = xxxVideo.replace(/bolabom/g, "<");');
			#cout('alert(xxxVideo);');
			#cout('alert("."+ objClass +" .content-ch");');
			cout('$(".streaming-main-video").html(xxxVideo);');
		cout('}');
		
		
			cout('function showPop(parJenis, parKD) {');
				cout('$("#myModal").modal("show");');
				cout('$.ajax({');
					cout('type: "GET",');
					cout('url: "/_ajax/ajax_index.php",');
					cout('data: "a=getdetailgames&id="+ parKD +"",');
					cout('success: function(resp){');
						cout('var tsp1 = resp.split("$$$");');
						cout('var tsp2 = new Array();');
						cout('for (var i=0;i<tsp1.length;i++) {');
							cout('tsp2 = tsp1[i].split("$$");');
							cout('$("."+tsp2[0]).html(tsp2[1]);');
						cout('}');
					cout('}');
				cout('});');
			cout('}');
		/*
		cout('function showPop(parJenis, parKD) {');
			cout('$("#myModal").modal("show");');
			cout('$.ajax({');
				cout('type: "GET",');
				cout('url: "/_ajax/ajax_index.php",');
				cout('data: "a=getdetailgames&id="+ parKD +"",');
				cout('success: function(resp){');
					cout('var tsp1 = resp.split("$$$");');
					cout('var tsp2 = new Array();');
					cout('for (var i=0;i<tsp1.length;i++) {');
						cout('tsp2 = tsp1[i].split("$$");');
						cout('$("."+tsp2[0]).html(tsp2[1]);');
					cout('}');
				cout('}');
			cout('});');
		cout('}');
		*/
	cout('</script>');
	if (!islocal()) {
		
		#cout('<!-- Start of LiveChat (www.livechatinc.com) code -->');
		cout('<script type="text/javascript">');
			cout('window.__lc = window.__lc || {};');
			cout('window.__lc.license = 7391591;');
			cout('window.__lc.ga_version = "ga";');
			cout('(function() {');
				cout('var lc = document.createElement("script"); lc.type = "text/javascript"; lc.async = true;');
				cout('lc.src = ("https:" == document.location.protocol ? "https://" : "http://") + "cdn.livechatinc.com/tracking.js";');
				cout('var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(lc, s);');
			cout('})();');
		cout('</script>');
		#cout('<!-- End of LiveChat code -->');
	}
}

cout('</Body>');
cout('</html>');
### LOG VISITOR ######################################################
######################################################################
	$http_referer = $_SERVER["HTTP_REFERER"];
	$request_time_float = $_SERVER["REQUEST_TIME_FLOAT"];
	$request_time_float_s = date('l, d M Y, H:i:s', $_SERVER["REQUEST_TIME_FLOAT"]);
	$request_time = $_SERVER["REQUEST_TIME"];
	$request_time_s = date('l, d M Y, H:i:s', $_SERVER["REQUEST_TIME"]);
	$client_ip = get_client_ip();
	$client_ip2 = get_client_ip2();
	$client_ip3 = get_client_ip3();
	$session_id = session_id();
	$http_user_agent = $_SERVER["HTTP_USER_AGENT"];
	$server_name = $_SERVER["SERVER_NAME"];
	$http_host = $_SERVER["HTTP_HOST"];
	$http_host = 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' . $_SERVER["HTTP_HOST"] ."". $_SERVER["REQUEST_URI"];
	$last_clicked = time();
	$browser_info = $visitor_browser;
	$qi = "INSERT INTO _visitors (http_referer, request_time_float, request_time_float_s, request_time, request_time_s, client_ip, client_ip2, client_ip3, session_id, http_user_agent, server_name, http_host, browser_info, last_clicked) VALUES
		('$http_referer', '$request_time_float', '$request_time_float_s', '$request_time', '$request_time_s', '$client_ip', '$client_ip2', '$client_ip3', '$session_id', '$http_user_agent', '$server_name', '$http_host', '$browser_info', '$last_clicked')";
	#execRSL($qi);
	$qi = "INSERT INTO _visitors (http_referer, request_time_float, request_time_float_s, request_time, request_time_s, client_ip, client_ip2, client_ip3, session_id, http_user_agent, server_name, http_host, browser_info, last_clicked) VALUES
		('?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?')";
	callRSL($qi, array($http_referer, $request_time_float, $request_time_float_s, $request_time, $request_time_s, $client_ip, $client_ip2, $client_ip3, $session_id, $http_user_agent, $server_name, $http_host, $browser_info, $last_clicked));
######################################################################
?>