<?php
ob_start();
header('Refresh: 1800');
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: private, no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

	$cssKiri="kotak_kiri2";
	$cssKanan="kotak_kanan2";

function strposa($haystack, $needle, $offset=0) {
    if(!is_array($needle)) $needle = array($needle);
    foreach($needle as $query) {
        if(strpos(strtolower($haystack), strtolower($query), $offset) !== false) return true; // stop on first true result
    }
    return false;
}
$smarttv = array('AppleCoreMedia', 'AppleTV', 'CrKey', 'Roku', 'TV');
$ua = $_SERVER['HTTP_USER_AGENT'];
$isSmartTV = strposa($ua, $smarttv, 1)?true:false;
?>
<?php
date_default_timezone_set("Asia/Jakarta");
$tmp = $this->session->userdata('namaPN');
if(empty($tmp)){
$this->session->set_userdata('namaPN',$namaPN[0]->namaPN);
	}else{
	$namaPN = $this->session->userdata('namaPN');
}


?>
<html>
<head><title><?php echo $namaPN;?></title>
<style>
::-webkit-scrollbar{width:1px;}
hr.thick-line{width:100%;border:0;height:0;border-bottom:3px solid #5FB85C;}
*{font-family:Century Gothic, sans-serif;}
body{background-color:white;font-size:14px;background:url(<?php echo base_url();?>resources/img/dark_leather.png);color:#5b5b5b;margin:0;padding:0;font-family:Century Gothic,sans-serif;height:100%;width:100%;overflow: -moz-scrollbars-none;}
#atas{background:rgba(2, 2, 2, 1) url("<?php echo base_url();?>resources/img/top_repeat.jpg") repeat-x scroll right top;background-size:100% 100%;height:90px;width:100%;float:center;box-shadow:0px 0px 10px #5b5b5b;}
.logo a{margin-top:4px;padding-top:5px;height:30px;float:left;margin:0;padding-left:10px;width:70px;}
.front2{float:left;margin-top:3px;padding:2px;color:#fff;text-align:left;font-size:40px;}
.front{float:left;margin-top:13px;padding:2px;color:#fff;text-align:left;font-size:30px;}
.front span{color: #fff;float: left;font-size: 20px;left: 80px;margin-top: 10px;padding: 2px;position: absolute;text-align: left;top: 30px;}
#konten{width:100%;border:0px solid #dcdcdc;}
#cssmenu ul,
#cssmenu li,
#cssmenu span,
#cssmenu a{margin:0;padding:0;position:relative;}
#cssmenu{height:auto;border-bottom:1px solid #333;background:#444;color:#eee;width:auto;}
#cssmenu:after,
#cssmenu ul:after{content:'';display:block;clear:both;}
#cssmenu a{background:#F1F1F1;;color:#757575;display:inline-block;font-size:13px;line-height:25px;padding:0 15px;text-decoration:none;}
#cssmenu ul{list-style:none;color:#757575;}
#cssmenu > ul{float:left;}
#cssmenu > ul > li{float:left;}
#cssmenu > ul > li > a{color:#757575;font-size:13px;word-wrap:break-word;}
#cssmenu > ul > li:hover:after{content:'		';display:block;width:0;height:0;position:absolute;left:50%;bottom:0;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #069c10;margin-left:-10px;}
#cssmenu > ul > li:first-child > a{border-radius:0px 0 0 0;-moz-border-radius:0px 0 0 0;-webkit-border-radius:0px 0 0 0;}
#cssmenu > ul > li.active:after{content:'';display:block;width:0;height:0;position:absolute;left:50%;bottom:0;border-left:10px solid transparent;border-right:10px solid transparent;border-bottom:10px solid #069c10;margin-left:-10px;}
#cssmenu > ul > li.active > a{-moz-box-shadow:inset 0 0 2px rgba(0, 0, 0, 0.1);-webkit-box-shadow:inset 0 0 2px rgba(0, 0, 0, 0.1);box-shadow:inset 0 0 2px rgba(0, 0, 0, 0.1);background:#F1F1F1;}
#cssmenu > ul .active{background:#5fb85c;}
#cssmenu > ul > li:hover > a{background:#5fb85c;color:#fff;}
#cssmenu .has-sub{}
#cssmenu .has-sub:hover > ul{display:block;}
#cssmenu .has-sub ul{display:none;position:absolute;width:260px;top:100%;left:0;}
#cssmenu .has-sub ul li{margin-bottom:-1px;width:100%;}
#cssmenu .has-sub ul li a{filter:none;font-size:13px;display:block;line-height:120%;padding:6px;color:#757575;border:1px solid #fff;width:100%;background:#eeffdd;z-index:20;}
#cssmenu .has-sub ul li:hover a{background:#5fb85c;color:#fff;width:100%;}
#cssmenu .has-sub .has-sub:hover > ul{display:block;}
#cssmenu .has-sub .has-sub ul{display:none;position:absolute;left:100%;top:0;}
#cssmenu .has-sub .has-sub ul li a{background:#eeffdd;filter:none;font-size:13px;display:block;line-height:120%;padding:6px;margin-left:10px;color:#757575;border:1px solid #eee;z-index:21;}
#cssmenu .has-sub .has-sub .has-sub ul li a{margin-left:15px;z-index:22;}
#cssmenu .has-sub .has-sub ul li a:hover{background:#5fb85c;color:#fff;}
@media all and (max-width:600px), only screen and (max-width:600px), only screen and (max-width:600px), only screen and (max-width:600px), only screen and (max-width:600px), only screen and (min-resolution:192dpi) and (max-width:600px), only screen and (min-resolution:2dppx){.dl-menuwrapper{visibility:visible;}
}

h1.main,p.demos {
     -webkit-animation-delay: 18s;
     -moz-animation-delay: 18s;
     -ms-animation-delay: 18s;
     animation-delay: 18s;
}

.sp-container-header {
	 width: 100%;
     text-align: center;
     color: transparent;
     -webkit-animation: blurFadeInOut 10s ease-in backwards;
     -moz-animation: blurFadeInOut 10s ease-in backwards;
     -ms-animation: blurFadeInOut 10s ease-in backwards;
     animation: blurFadeInOut 10s ease-in backwards;
     animation-iteration-count: infinite;
}

.sp-container h2 {
     height: 30px;
     width: 100%;
     text-align: center;
     color: transparent;
     -webkit-animation: blurFadeInOut 10s ease-in backwards;
     -moz-animation: blurFadeInOut 10s ease-in backwards;
     -ms-animation: blurFadeInOut 10s ease-in backwards;
     animation: blurFadeInOut 10s ease-in backwards;
     animation-iteration-count: infinite;
}

.sp-container-header .frame-10 {
     font-size: 1em;
     -webkit-animation-delay: 0s;
     -moz-animation-delay: 0s;
     -ms-animation-delay: 0s;
     animation-delay: 0s;
}

.sp-container h2.frame-1 {
     font-size: 2.5em;
     -webkit-animation-delay: 0s;
     -moz-animation-delay: 0s;
     -ms-animation-delay: 0s;
     animation-delay: 0s;
}
.sp-container h2.frame-2 {
     font-size: 2.5em;
     -webkit-animation-delay: 3s;
     -moz-animation-delay: 3s;
     -ms-animation-delay: 3s;
     animation-delay: 3s;
}
.sp-container h2.frame-3 {
     -webkit-animation-delay: 6s;
     -moz-animation-delay: 6s;
     -ms-animation-delay: 6s;
     animation-delay: 6s;
}
.sp-container h2.frame-4 {
	font-size: 2.5em;
     -webkit-animation-delay: 9s;
     -moz-animation-delay: 9s;
     -ms-animation-delay: 9s;
     animation-delay: 9s;
}
.sp-container h2.frame-5 {
     font-size: 2.5em;
     -webkit-animation: none;
     -moz-animation: none;
     -ms-animation: none;
     animation: none;
     color: transparent;
     text-shadow: 0px 0px 1px #fff;
}


@-webkit-keyframes blurFadeInOut{
     0%{ opacity: 0; text-shadow: 0px 0px 40px #fff; -webkit-transform: scale(1.3); }
     20%,75%{ opacity: 1; text-shadow: 0px 0px 1px #fff; -webkit-transform: scale(1); }
     100%{ opacity: 0; text-shadow: 0px 0px 50px #fff; -webkit-transform: scale(0); }
}
@-webkit-keyframes blurFadeIn{
     0%{ opacity: 0; text-shadow: 0px 0px 40px #fff; -webkit-transform: scale(1.3); }
     50%{ opacity: 0.5; text-shadow: 0px 0px 10px #fff; -webkit-transform: scale(1.1); }
     100%{ opacity: 1; text-shadow: 0px 0px 1px #fff; -webkit-transform: scale(1); }
}
@-webkit-keyframes fadeInBack{
     0%{ opacity: 0; -webkit-transform: scale(0); }
     50%{ opacity: 0.4; -webkit-transform: scale(2); }
     100%{ opacity: 0.2; -webkit-transform: scale(5); }
}
@-webkit-keyframes fadeInRotate{
     0%{ opacity: 0; -webkit-transform: scale(0) rotate(360deg); }
     100%{ opacity: 1; -webkit-transform: scale(1) rotate(0deg); }
}
/**/
@-moz-keyframes blurFadeInOut{
     0%{ opacity: 0; text-shadow: 0px 0px 40px #fff; -moz-transform: scale(1.3); }
     20%,75%{ opacity: 1; text-shadow: 0px 0px 1px #fff; -moz-transform: scale(1); }
     100%{ opacity: 0; text-shadow: 0px 0px 50px #fff; -moz-transform: scale(0); }
}
@-moz-keyframes blurFadeIn{
     0%{ opacity: 0; text-shadow: 0px 0px 40px #fff; -moz-transform: scale(1.3); }
     100%{ opacity: 1; text-shadow: 0px 0px 1px #fff; -moz-transform: scale(1); }
}
@-moz-keyframes fadeInBack{
     0%{ opacity: 0; -moz-transform: scale(0); }
     50%{ opacity: 0.4; -moz-transform: scale(2); }
     100%{ opacity: 0.2; -moz-transform: scale(5); }
}
@-moz-keyframes fadeInRotate{
     0%{ opacity: 0; -moz-transform: scale(0) rotate(360deg); }
     100%{ opacity: 1; -moz-transform: scale(1) rotate(0deg); }
}

@keyframes blurFadeInOut{
     0%{ opacity: 0; text-shadow: 0px 0px 40px #fff; transform: scale(1.3); }
     20%,75%{ opacity: 1; text-shadow: 0px 0px 1px #fff; transform: scale(1); }
     100%{ opacity: 0; text-shadow: 0px 0px 50px #fff; transform: scale(0); }
}
@keyframes blurFadeIn{
     0%{ opacity: 0; text-shadow: 0px 0px 40px #fff; transform: scale(1.3); }
     50%{ opacity: 0.5; text-shadow: 0px 0px 10px #fff; transform: scale(1.1); }
     100%{ opacity: 1; text-shadow: 0px 0px 1px #fff; transform: scale(1); }
}
@keyframes fadeInBack{
     0%{ opacity: 0; transform: scale(0); }
     50%{ opacity: 0.4; transform: scale(2); }
     100%{ opacity: 0.2; transform: scale(5); }
}
@keyframes fadeInRotate{
     0%{ opacity: 0; transform: scale(0) rotate(360deg); }
     100%{ opacity: 1; transform: scale(1) rotate(0deg); }
}
</style>
</head>
<body>
	<div id="wrapper">
		<div id="atas">
			<div style="vertical-align:middle;">
			<?php if($jenisPengadilan==1){ ?>
				<div class="sp-container-header" >
            		<div class="frame-10">
	            		<div class="logo"><a><img src="<?php echo base_url();?>resources/img/logo.png"></a></div>
                         <div class="front"><b><?php echo $namaPN; ?></b><span>JADWAL SIDANG HARI <?php echo strtoupper($this->tanggalhelper->convertDayDate($tanggalSidang)); ?></span></div>
            		</div>
				</div>
			<?php } else { ?>
				<div class="logo"><a><img src="<?php echo base_url();?>resources/img/logo.png"></a></div>
            	<div class="front2"><b><?php echo $namaPN; ?></b></div>
			<?php } ?>
			</div>
		</div>
	</div>
<div id="cssmenu" style="height: 30px;">
		<div style="width:100%; float:right; font-size:1.5em;"><div align="center"><b>JADWAL SIDANG <?php echo strtoupper($this->tanggalhelper->convertDayDate($tanggalSidang)); ?></b></div></div>
</div>
<style>
*{font-family:Century Gothic, sans-serif;}
body{ }
#contain,#contain_pid  {
  height:100%;
  <?php 
	if(!$isSmartTV){
		echo 'overflow-y: hidden;';
	}
  ?>  
}
#table_scroll,#table_scroll_pid {
  width: 100%;
  margin-top: 10px;
  margin-bottom: 10px;
  border-collapse: collapse;
}

.th { font: bold 20px "Century Gothic", Century Gothic, Geneva, AppleGothic, sans-serif; color: white; font-weight: bold; color: #EEEEEE; border-right: 1px solid #C1DAD7; border-bottom: 1px solid #C1DAD7; border-top: 1px solid #C1DAD7; letter-spacing: 2px; text-transform: uppercase; text-align: center; padding: 5px 5px 5px 5px; background: green; }
.td { font: bold 18px "Century Gothic", Century Gothic, Geneva, AppleGothic, sans-serif; color: white; border-right: 0.1em solid #C1DAD7; border-bottom: 0.1em solid #C1DAD7; border-left: 0.1em solid #C1DAD7; border-top: 0.1em solid #C1DAD7; padding: 6px 6px 6px 6px; }
.kotak_kiri{
    float:left;
	width:48.5%;
    height:80%;
    border-right: 15px solid #444;
    padding: 10px;
	position:relative;
}

.kotak_kanan{
     float:right;
     width:47.5%;
     height:80%;
     padding-right: 10px;
	 position:relative;
}

.kotak_kiri2{
    float:left;
	width:39%;
    height:86%;
}

.kotak_kanan2{
	float:right;
    width:60%;
    height:86%;
    padding-right: 10px;
    position: relative;
}
.kotak_kiri3{
    float:left;
	width:60%;
    height:80%;
	position:relative;
}

.kotak_kanan3{
	float:right;
    width:39%;
    height:86%;
	padding-right: 10px;
    position: relative;
}

.footer span{
	position: absolute;
	float:right;
	right: 30px;
	background: #222;
	border:1px solid #111;
	padding:10px;
	top:-35px;
	text-shadow: 0 1px 0 #ccc, 0 1px 0 #c9c9c9;
	color: #fff;
	text-align: left;
	font-size: 30px;
	border-radius:3px;
	box-shadow: 2px 2px 3px #000;
}


</style>
<script type="text/javascript" src="<?php echo base_url();?>resources/js/jquery-1.7.1.min.js"></script>
<div style="width:100%;height:100%">
	<div class="<?php echo $cssKiri; ?>">
			<div class="sp-container" >
            	<div class="sp-content">
            			<br/>
                    	<div class="sp-globe"></div>
                        <h2 class="frame-1">SELAMAT DATANG DI</h2>
                        <h2 class="frame-2"><?php echo $this->session->userdata('namaPN'); ?></h2>
                        <div class="sp-globe"></div>
                        <br/><br/><br/><br/><br/><br/><br/><br/><br/>
                        <h2 class="frame-3">PELAYANAN PRIMA</h2>
                        <h2 class="frame-4">PUTUSAN BERKUALITAS</h2>
                </div>
            </div>
	</div>

	<div class="<?php echo $cssKanan; ?>">
		<?php 
				if($slidePerdata->num_rows==0){
					echo "<div id='contain' align='center' style='color:#fff;'><b><h1>TIDAK ADA JADWAL SIDANG</h1></b></div>";
				} else {					
					$b=0;
					if($isSmartTV){
						echo '<marquee direction="up" scrolldelay="150" height="100%">';
					}
					echo '<div id="contain">';
					
					foreach ($slidePerdata->result() as $rowPerdata) { $b++;
					
						$alurPerkara = $rowPerdata->IDAlurPerkara;
						if($alurPerkara=='2' || $alurPerkara=='10' || $alurPerkara=='12' || $alurPerkara=='13' || $alurPerkara=='14' || $alurPerkara=='16' || $alurPerkara=='622'){
						$judulPihak1nya="Pemohon";
						$judulPihak2nya="Termohon";
						} else {
						$judulPihak1nya="Penggugat";
						$judulPihak2nya="Tergugat";
						}
					
						echo "<table cellspacing='0' align='center' border='1px' id='table_scroll'>";
						echo "<tr style='border-bottom=1px solid #fff'>";
						echo "<td class='td' style='width:5%;' rowspan='5' align='center'>".$b."</td>";
						echo "<td class='td' style='width:25%;'>NO PERKARA</td>";
						echo "<td class='td' style='width:70%; color:yellow;'>".$rowPerdata->noPerkara."</td>";
						echo "</tr>";				
						/**
						echo "<tr>";
						echo "<td class='td' style='width:25%;'>PIHAK</td>";
						echo "<td class='td' style='width:70%;'>Penggugat : " .$rowPerdata->penggugat."<br /> Tergugat : ".$rowPerdata->tergugat."<br /> ".$rowPerdata->turut_tergugat."</td>";
						echo "</tr>";
						**/
						echo "<tr>";
						echo "<td class='td' style='width:25%;'>".$judulPihak1nya."</td>";
						echo "<td class='td' style='width:70%;'>".$rowPerdata->penggugat."</td>";
						echo "</tr>";
						echo "<tr>";
						echo "<td class='td' style='width:25%;'>".$judulPihak2nya."</td>";
						echo "<td class='td' style='width:70%;'>".$rowPerdata->tergugat."<br />".$rowPerdata->turut_tergugat."</td>";
						echo "</tr>";
						
						echo "<tr>";
						echo "<td class='td' style='width:25%;'>AGENDA SIDANG</td>";
						echo "<td class='td' style='width:70%;'>".$rowPerdata->agendaSidang."</td>";
						echo "</tr>";
						echo "<tr style='border-bottom=1px solid #fff'>";
						echo "<td class='td' style='width:25%;'>RUANG SIDANG</td>";
						echo "<td class='td' style='width:70%;'>".(!empty($rowPerdata->ruangSidang)?"$rowPerdata->ruangSidang":"Belum Ditentukan")."</td>";
						echo "</tr>";
						echo "</table>";
						echo "<br/>";
					}
					echo "<br/>";
					echo "<br/>";
					echo "<br/>";
					echo "<br/>";
					echo '</div>';
					if($isSmartTV){
						echo '</marquee>';
					}
				}			
			
?>

	</div>
</div>

<?php 
$tickerCaption="Berita MA RI";
$tickerTipe="mari";
$tickerCaption="Berita Badilag";
$tickerTipe="badilag";

if(!$isSmartTV){
?>
<script>
$(document).ready(function() {
  gulunginBro("contain",1,20);
});
</script>
<?php } ?>

<link rel="stylesheet" type="text/css" href="resources/slideshow/newsTicker/ticker.css">
<div class="footer" style="z-index:99;position: absolute;bottom:0px;width: 100%;height:30px;">
<div class="ticker-container">
  <div class="ticker-caption">
    <p><?php echo $tickerCaption; ?></p>
  </div>
<?php if($isSmartTV){?>
  <div id="zenews" style="font-size: 1.2em;"></div>
<?php }else{?>
	<ul id="zenews">
		<li>&nbsp;</li>
	</ul>
<?php }?>
</div>
<span class="clock"></span>
</div>
<script src="resources/slideshow/newsTicker/jquery.li-scroller.1.0.js"></script>
<script>
var myjson;
var jam;
$(document).ready(function(){
	loadingNews();
	clock();
});
<?php if(!$isSmartTV){?>
function gulunginBro(idGulungan, step=5, speed=150){
	if(document.getElementById(idGulungan) === false){return}
	var stripHeight = 0;
	var $pidContainer = $(document.getElementById(idGulungan));
	var containerTop = $pidContainer.position().top;
	var containerHeight = $pidContainer.parent().height();
	var containerBottom = containerTop + containerHeight;
	$pidContainer.find("table").each(function(i){
				stripHeight += $(this).outerHeight(true) +40;
				});
	/*			
	console.log("Strip Height : "+stripHeight);
	console.log("Container Top : "+containerTop);
	console.log("Container Height : "+containerHeight);
	console.log("Container Bottom : "+containerBottom);
	*/
	if(stripHeight < containerBottom){return}
	
	$pidContainer.css({"width":"95%","z-index":-2,"height":stripHeight,"position":"absolute", "top":containerBottom});
	setInterval(function(){
		var tail = $pidContainer.position().top + stripHeight;
		if(tail <= containerTop){
			$pidContainer.css({"z-index":-2,"position":"absolute", "top":containerBottom});
		}
		var top = parseFloat($pidContainer.position().top) - step;
		$pidContainer.css({"z-index":-2,"position":"absolute", "top":top+"px"});
		/*
		console.log("top : "+top);
		console.log("tail : "+tail);
		*/
	}, speed);
}

<?php }?>

function loadingNews(){
	var container = $('#zenews');
	var spinner = loadingProgress('Mengambil Berita ...');
	var datanews = '';
	/*
	$.ajax({
		type: "POST",
		url: "resources/slideshow/newsTicker/",
		data: "tipe=<?php echo $tickerTipe;?>",
		success: function( data ) {
			clearInterval(spinner);
			$('#zenews').html('');
			$.each(data.items, function(i, f) {
				var shortdesc = f.description_text.substr(0, 100);
				datanews = datanews+f.title+'</li>&nbsp;&#8212;&#8212;&nbsp;';
				<?php if(!$isSmartTV){?>
				container.append('<li>'+ f.title +'</li>&nbsp;&#8212;&#8212;&nbsp;');
				<?php }?>
			});
			<?php if($isSmartTV){?>
				container.append('<marquee direction="left" scrolldelay="100" width="100%">'+ datanews +'</marquee>');
			<?php }?>
			myjson = data.items;
			<?php if(!$isSmartTV){?>
			$("ul#zenews").liScroll();
			<?php }?>
		},
		error: function() {
			container.html('Gagal mengambil berita'); return;
		},
		dataType: "json",
		crossDomain: "true"
	});
	*/
	$.post('resources/slideshow/newsTicker/', {tipe:'<?php echo $tickerTipe;?>'})
	.done(function( data ) {
		clearInterval(spinner);
		$('#zenews').html('');
		$.each(data.items, function(i, f) {
			var shortdesc = f.description_text.substr(0, 100);
			datanews = datanews+f.title+'</li>&nbsp;&#8212;&#8212;&nbsp;';
			<?php if(!$isSmartTV){?>
			container.append('<li>'+ f.title +'</li>&nbsp;&#8212;&#8212;&nbsp;');
			<?php }?>
		});
		<?php if($isSmartTV){?>
			container.append('<marquee direction="left" scrolldelay="100" width="100%">'+ datanews +'</marquee>');
		<?php }?>
		myjson = data.items;
		<?php if(!$isSmartTV){?>
		$("ul#zenews").liScroll();
		<?php }?>
	})
	.fail(function() {
		container.html('Gagal mengambil berita'); return;
	});
	
}

function loadingProgress(msg){
	var i=0;
	var spinner = setInterval( function() {
	i++;
	var text = msg;
    if ( i==1 ){text = text +" /";
    }else if(i==2){text = text +" -";
	}else if(i==3){text = text +" \\";
	}else if(i==4){text = text +" |";
	}else if(i==5){text = text +" /";
	}else if(i==6){text = text +" -";
	}else if(i==7){text = text +" \\";
	}else if(i==8){text = text +" |";
	}else if(i>8){i=0;}
	$('#zenews').html('<li>'+text+'</li>');
	
    }, 200);
	return spinner;
}

function clock(){
	var now     = new Date();
	var hour    = now.getHours();
	var minutes = now.getMinutes();
	var second = now.getSeconds();
	hour = hour < 10 ? '0'+hour : hour;
	minutes = minutes < 10 ? '0'+minutes : minutes;
	second = second < 10 ? '0'+second : second;
	$(".clock").html(hour+":"+minutes+":"+second);
	jam=setTimeout('clock()', 1000);
	setInterval(function(){ window.location.reload(true); },60*60*1000);
}
</script>