<?php
$jenisperkara = $this->tanggalhelper->getIDJenisPerkara($idperkara);
if(($alur_perkara==1)||($alur_perkara==5)||($alur_perkara==7)||($alur_perkara==8)
	||($alur_perkara==9)||($alur_perkara==10)||($alur_perkara==11)||($alur_perkara==12)||($alur_perkara==13)||($alur_perkara==14)||($alur_perkara==15 && $jenisperkara!=346)||$alur_perkara==16){
	$form1 = "Penggugat";
	$form2 = "Tergugat";
} else if(($alur_perkara==111)||($alur_perkara==112)||($alur_perkara==113)
				||($alur_perkara==114)||($alur_perkara==115)||($alur_perkara==116)
				||($alur_perkara==117)||($alur_perkara==118)||($alur_perkara==122)) {
	$form1 = "Penuntut Umum";
	$form2 = "Terdakwa";
} else if(($alur_perkara==3)||($alur_perkara==4)||($alur_perkara==6)||($alur_perkara==119)||($alur_perkara==123)||($alur_perkara==15 && $jenisperkara==346)) {
	$form1 = "Pemohon";
	$form2 = "Termohon";
} else if($alur_perkara==2) {
	$form1 = "Pemohon";
	$form2 = "&nbsp;";
} else if ($alur_perkara==120 || $alur_perkara==121){
	$form1 = "Oditur";
	$form2 = "Terdakwa";	
}

if(!empty($ruangan)){
	$ruang_sidang = $ruangan;
} else {
	$ruang_sidang = "<div style='color:red;'>Ditentukan Kemudian</div>";
}


?>
<div class="centering" style="border: 1px solid #ffffff;width:800px;top: 50%;">
<div id='pihak_pilih' style="background:none;padding:3px">
	<div class="detil" style="padding: 14px;background-color: white;">
		<table id="infoPerkara" style="font-size:14px;">
			<col width="20%">
			<col width="80%">
			<tbody>
				<tr>
					<td colspan="2" style="background:white;border:0px;font-size: 20px;color: #648C03;" align="center"><?php echo $page_title;?></td>
				</tr>
				<tr>
					<td id="first-child">Tanggal</td>
					<td style="padding:0px;padding-left:5px;"><?php echo $tanggal_sidang; ?></td>
				</tr>
				<tr>
					<td id="first-child">Mulai Jam</td>
					<td style="padding:0px;padding-left:5px;"><?php echo $jam_sidang; ?></td>
				</tr>
				<tr>
					<td id="first-child">Agenda</td>
					<td style="padding:0px;padding-left:5px;"><?php echo $agenda; ?></td>
				</tr>
				<tr>
					<td id="first-child">Ruangan</td>
					<td style="padding:0px;padding-left:5px;"><?php echo $ruang_sidang; ?></td>
				</tr>
				<tr>
					<td id="first-child">Nomor Perkara</td>
					<td style="padding:0px;padding-left:5px;"><?php echo $nomor_perkara; ?></td>
				</tr>
				<tr>
					<td id="first-child"><?php echo $form1; ?></td>
					<td style="padding:0px;padding-left:5px;"><?php echo $pihak1; ?></td>
				</tr>
				<?php if($alur_perkara!==2){ ?>
				<tr>
					<td id="first-child"><?php echo $form2; ?></td>
					<td style="padding:0px;padding-left:5px;"><?php echo $pihak2; ?></td>
				</tr>
				<?php } ?>
				<tr>
					<td id="first-child">Majelis Hakim</td>
					<td style="padding:0px;padding-left:5px;"><?php echo $majelis_hakim; ?></td>
				</tr>
				<tr>
					<td id="first-child">Panitera Pengganti</td>
					<td style="padding:0px;padding-left:5px;"><?php echo str_replace("Panitera Pengganti:", '',$panitera_pengganti); ?></td>
				</tr>
				<?php
				if($idalurperkara>100){
					if($data_penahanan!=''){
						if($data_penahanan->num_rows()>0){
							echo "<tr>";
								echo "<td id='first-child'>Data Penahanan</td>";
								echo "<td>";
									echo '<div class="cssTable">';
										echo '<table id="tableinfo" style="margin:0px;padding:0px;">';
											echo '<col width="20%">';
											echo '<col width="30%">';
											echo '<col width="25%">';
											echo '<col width="25%">';
											echo '<tbody>';
												echo '<tr>';
													echo '<td>Nama</td>';
													echo '<td>Status</td>';
													echo '<td>Mulai</td>';
													echo '<td>Berakhir</td>';
												echo '</tr>';
													foreach ($data_penahanan->result() as $row) {
														echo '<tr>';
															echo '<td>'.$row->nama.'</td>';
															echo '<td>';
																echo $row->status_penahanan_nama.' Oleh '.$row->jenis_penahanan_nama;
																echo ($row->jenis_tahanan_id!=0)? ' Di '.$row->jenis_tahanan_nama:'';
															echo '</td>';
															echo '<td>'.$this->tanggalhelper->convertDayDate($row->mulai).'</td>';
															echo '<td>'.$this->tanggalhelper->convertDayDate($row->sampai).'</td>';
														echo '</tr>';
													}
											echo "</tbody>";
										echo "</table>";
									echo "</div>";
								echo "</td>";
							echo "</tr>";
						}
					}
				}
				?>
				<tr>
					<td id="first-child"><?php echo ($idalurperkara<100)?'Petitum':'Dakwaan'; ?> </td>
					<td style="padding:0px;padding-left:5px;"><?php echo $petitum_dakwaan; ?></td>
				</tr>
				<tr>
					<td id="first-child">Keterangan</td>
					<td style="padding:0px;padding-left:5px;"><?php echo $keterangan; ?></td>
				</tr>
				<tr>
					<td colspan="2" style="background:white;border:0px;" align="center">
						<input type="button" id='close_form_add_pihak' value="Kembali" class="btn">
						<input type="button" id='print' onClick ="window.print();" value="print" class="btn">
					</td>
				</tr>
				</tbody>
			</table>
	</div>
</div>
</div>
<script type="text/javascript">
$('#close_form_add_pihak').closingFormWin();
</script>