<head>
	<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>resources/css/style.css">
	<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>resources/css/table.css">
</head>
<style type="text/css">
.cssTable tr:first-child td, .cssTable tr:first-child th{
	 font-size:18px;
}

.cssTable tr:last-child td{
	font-size:24px;	
	color:#111;
}
.cssTable td, .cssTable th {
	font-size:24px;	
	color:#111;
}


</style>
<div class="cssTable" style="margin-top:0px">
	<?php
		$CI =& get_instance();
		$CI->load->library('table');
		
		if(count($list_antrian)>8){
			$arr_heading=array();
			$arr_antrian=array();
			$tmpl = array ( 'table_open'  => '<table id="table1" style="font-size:20px;">' );
			$CI->table->set_template($tmpl);
			for ($i=1;$i<=8;$i++){
				$ruang=strtolower($list_antrian[$i-1]->nama);
				$ruang=str_replace("ruang", "", $ruang);
				$ruang=str_replace("sidang", "", $ruang);
				$ruang=trim($ruang);
				$arr_heading[]="Ruang Sidang ".$this->templatehelper->ucname($ruang);
				$arr_antrian[]="Antrian No. ".$list_antrian[$i-1]->kode."-".($list_antrian[$i-1]->nomor_antrian==''?"0":$list_antrian[$i-1]->nomor_antrian);
			}
			$data=array($arr_heading,$arr_antrian);
			echo $CI->table->generate($data);
			$CI->table->clear();
			$arr_heading=array();
			$arr_antrian=array();
			$tmpl = array ( 'table_open'  => '<table hidden id="table2" style="font-size:20px;">' );
			$CI->table->set_template($tmpl);
			for ($i=9;$i<=count($list_antrian);$i++){
				$ruang=strtolower($list_antrian[$i-1]->nama);
				$ruang=str_replace("ruang", "", $ruang);
				$ruang=str_replace("sidang", "", $ruang);
				$ruang=trim($ruang);
				$arr_heading[]="Ruang Sidang ".$this->templatehelper->ucname($ruang);
				$arr_antrian[]="Antrian No. ".$list_antrian[$i-1]->kode."-".($list_antrian[$i-1]->nomor_antrian==''?"0":$list_antrian[$i-1]->nomor_antrian);
			}
			$data=array($arr_heading,$arr_antrian);
			echo $CI->table->generate($data);
		}else{
			$arr_heading=array();
			$tmpl = array ( 'table_open'  => '<table style="font-size:20px;">' );
			$CI->table->set_template($tmpl);
			for ($i=1;$i<=count($list_antrian);$i++){
				$ruang=strtolower($list_antrian[$i-1]->nama);
				$ruang=str_replace("ruang", "", $ruang);
				$ruang=str_replace("sidang", "", $ruang);
				$ruang=trim($ruang);
				$arr_heading[]="Ruang Sidang ".$this->templatehelper->ucname($ruang);
				$arr_antrian[]="Antrian No. ".$list_antrian[$i-1]->kode."-".($list_antrian[$i-1]->nomor_antrian==''?"0":$list_antrian[$i-1]->nomor_antrian);
			}
			$data=array($arr_heading,$arr_antrian);
			echo $CI->table->generate($data);
		}
		
	?>
</div>

<script type="text/javascript" src="<?php echo base_url();?>resources/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
	
<?php
if(count($list_antrian)>8){
	echo "setInterval(function(){";
	echo '$( "#table1" ).fadeToggle( "fast", "linear" );';
	echo '$( "#table2" ).fadeToggle( "fast", "linear" );';
	echo "},7000)";
}
?>
</script>