<?php
$encdiversi=base64_encode($this->encrypt->encode($detail_diversi->id));
$caneditdiversi=$this->authorization->HasRuleAddEditDiversi($this->encrypt->decode(base64_decode($enc)));
$statususer='';
?>
<div style="font-size:14px;margin:0px;border:0px;width:98%;">
	<table id='infoPerkara' style="font-size:14px;">
		<col width="15%">
        <col width="40%">
        <col width="45%">
        <tbody>
			<tr>
				<td colspan="3" class="divider">Data Penetapan Musyawarah Diversi</td>
			</tr>
        	<tr>
        		<td id="first-child">Nomor Perkara</td>
        		<td>
        			<?php
        				echo $perkara->nomor_perkara;
        			?>
        		</td>
				<td style="text-align:right;">
				<?php
				if ($caneditdiversi){
					if($detail_diversi->kesepakatan_melaksanakan_diversi==0){
					?>
						[ <a href="#" onClick="popup_form('<?php echo base_url('edit_diversi/'.$enc.'/'.$encdiversi);?>')">Edit Data Penetapan Musyawarah Diversi</a> ]
					<?php
					}
				}
				?>
				</td>
        	</tr>
        	<tr>
        		<td id="first-child">Anak Berhadapan Dengan Hukum</td>
        		<td colspan="2">
        			<div class="cssTable">
        				<table>
        					<col width="5%">
        					<col width="45%">
        					<col width="40%">
        					<col width="10%">
        					<tr>
        						<td>No</td>
        						<td>Nama ABH</td>
        						<td>Orangtua/Wali</td>
        						<td>Diversi</td>
        					</tr>
        					<?php
                                $i=1;
                                foreach ($detail_terdakwa as $row) {
                                	echo "<tr>";
                                    echo "<td align='center'>".$i."</td>";
                                    echo "<td>".$row->nama_anak."</td>";
                                    echo "<td>".$row->nama_orang_tua."</td>";
                                    echo "<td width='10%' align='center'>";?>
                                    <input type='checkbox' value='<?php echo $row->id;?>' <?php $id_pihak_diversi=$row->id;if(preg_match("/".$id_pihak_diversi."/i",$detail_diversi->pihak_diversi)){echo 'checked';} ?>  
                                                    readonly disabled id='pihak_diversi_'<?php echo $i;?> style=";" class="sc-js-input scFormObjectOdd"><?php echo "</td>";
                                    echo "</tr>";
                                    $i++;
                                }
                                ?>
        				</table>
        			</div>
        		</td>
        	</tr>
        	<tr>
        		<td id="first-child">Anak Korban</td>
        		<td colspan="2">
        			<div class="cssTable">
        				<table>
        					<col width="5%">
        					<col width="50%">
        					<col width="45%">
        					<tr>
        						<td>No</td>
        						<td>Nama Korban</td>
        						<td>Orangtua/Wali</td>
        					</tr>
        					<?php
								$i=1;
                                foreach ($detail_korban as $row) {
                                	echo "<tr>";
                                    echo "<td align='center'>".$i."</td>";
                                    echo "<td>".$row->nama_anak."</td>";
                                    echo "<td>".$row->nama_orang_tua."</td>";
                                    echo "<td></td>";
                                    echo "</tr>";
                                    $i++;
                                }
                                ?>
        				</table>
        			</div>
        		</td>
        	</tr>
        	<tr>
        		<td id="first-child">Pembimbing Kemasyarakatan<span style="color:red">*</span></td>
        		<td colspan="2">
        			<div class="cssTable">
        				<table>
        					<col width="5%">
        					<col width="40%">
        					<col width="45%">
							<?php 
							if ($caneditdiversi){
								if($detail_diversi->kesepakatan_melaksanakan_diversi==0){ 
							?>
        					<col width="10%">
							<?php 
								}
							}
							?>
        					<tr>
        						<td>No</td>
        						<td>Nama</td>
        						<td>Alamat</td>
								<?php 
								if ($caneditdiversi){
									if($detail_diversi->kesepakatan_melaksanakan_diversi==0){
								?>
        						<td>Edit</td>
								<?php 
									}
								}
								?>
        					</tr>
        					<?php
								$i=1;
                                foreach ($detail_pembimbing as $row) {
                                	echo "<tr>";
                                    echo "<td align='center'>".$i."</td>";
                                    echo "<td>".$row->nama."</td>";
                                    echo "<td>".$row->alamat."</td>";
                                    $pihak_id=base64_encode($this->encrypt->encode($row->pihak_id));;
                                    $enc_id = base64_encode($this->encrypt->encode($row->id));
                                    $urutan=$row->urutan;
									if ($caneditdiversi){
										if($detail_diversi->kesepakatan_melaksanakan_diversi==0){
										?>
											<td align='center'>[<a href="#" onClick="popup_form('<?php echo base_url("add_pihak_pemkes/".$enc."/edit1/".$pihak_id."/urt/".$urutan.'/'.$enc_id);?>')">Edit</a>]</td>
										<?php 
										}
									}
									echo "</tr>";
                                    $i++;
                                }
                                ?>
        				</table>
        			</div>
					<?php
						if ($caneditdiversi){
							if($detail_diversi->kesepakatan_melaksanakan_diversi==0){
					?>
                        <table>
                        <tr>
                            <td>[<a href="#" onClick="popup_form('<?php echo base_url("add_pihak_pemkes/".$enc."/add1");?>')">Tambah Pembimbing Kemasyarakatan</a>]</td>
                        </tr>
                        </table>
					<?php
							}
						}
					?>
        		</td>
        	</tr>
            <tr>
                <td id="first-child">Pekerja Sosial Profesional</td>
                <td colspan="2">
                    <div class="cssTable">
                        <table>
                            <col width="5%">
                            <col width="40%">
                            <col width="45%">
							<?php 
							if ($caneditdiversi){
								if($detail_diversi->kesepakatan_melaksanakan_diversi==0){ ?>
                            <col width="10%">
							<?php 
								}
							} ?>
                            <tr>
                                <td>No</td>
                                <td>Nama</td>
                                <td>Alamat</td>
								<?php 
								if ($caneditdiversi){
									if($detail_diversi->kesepakatan_melaksanakan_diversi==0){ ?>
                                <td>Edit</td>
								<?php 
									}
								}?>
                            </tr>
                            <?php
                                $i=1;
                                foreach ($detail_peksos as $row) {
                                    echo "<tr>";
                                    echo "<td align='center'>".$i."</td>";
                                    echo "<td>".$row->nama."</td>";
                                    echo "<td>".$row->alamat."</td>";
                                    $pihak_id=base64_encode($this->encrypt->encode($row->pihak_id));;
                                    $enc_id = base64_encode($this->encrypt->encode($row->id));
                                    $urutan=$row->urutan;
									if ($caneditdiversi){
										if($detail_diversi->kesepakatan_melaksanakan_diversi==0){
                                    ?>
                                    <td align='center'>[<a href="#" onClick="popup_form('<?php echo base_url("add_pihak_pemkes/".$enc."/edit2/".$pihak_id."/urt/".$urutan.'/'.$enc_id);?>')">Edit</a>]</td>
                                    </tr>
                                    <?php
										}
									}
                                    $i++;
                                }
                                ?>
                        </table>
                    </div>
                    <?php
					if ($caneditdiversi){
						if($detail_diversi->kesepakatan_melaksanakan_diversi==0){
                    ?>
                        <table>
                        <tr>
                            <td>[<a href="#" onClick="popup_form('<?php echo base_url("add_pihak_pemkes/".$enc."/add2");?>')">Tambah Pekerja Sosial Profesional</a>]</td>
                        </tr>
                        </table>
                    <?php
						}
					}
                    ?>
                </td>
            </tr>
            <tr>
                <td id="first-child">Perwakilan Masyarakat</td>
                <td colspan="2">
                    <div class="cssTable">
                        <table>
                            <col width="5%">
                            <col width="40%">
                            <col width="45%">
							<?php 
							if ($caneditdiversi){
								if($detail_diversi->kesepakatan_melaksanakan_diversi==0){ ?>
                            <col width="10%">
							<?php 
								}
							} ?>
                            <tr>
                                <td>No</td>
                                <td>Nama</td>
                                <td>Alamat</td>
								<?php 
								if ($caneditdiversi){
									if($detail_diversi->kesepakatan_melaksanakan_diversi==0){ ?>
                                <td>Edit</td>
								<?php 
									}
								} ?>
                            </tr>
                            <?php
                                $i=1;
                                foreach ($detail_wakil_m as $row) {
                                    echo "<tr>";
                                    echo "<td align='center'>".$i."</td>";
                                    echo "<td>".$row->nama."</td>";
                                    echo "<td>".$row->alamat."</td>";
                                    $pihak_id=base64_encode($this->encrypt->encode($row->pihak_id));;
                                    $enc_id = base64_encode($this->encrypt->encode($row->id));
                                    $urutan=$row->urutan;
									if ($caneditdiversi){
										if($detail_diversi->kesepakatan_melaksanakan_diversi==0){
                                    ?>
                                    <td align='center'>[<a href="#" onClick="popup_form('<?php echo base_url("add_pihak_pemkes/".$enc."/edit3/".$pihak_id."/urt/".$urutan.'/'.$enc_id);?>')">Edit</a>]</td>
                                    </tr>
                                    <?php
										}
									}
                                    $i++;
                                }
                                ?>
                        </table>
                    </div>
                    <?php
					if ($caneditdiversi){
						if($detail_diversi->kesepakatan_melaksanakan_diversi==0){
                    ?>
                        <table>
                        <tr>
                            <td>[<a href="#" onClick="popup_form('<?php echo base_url("add_pihak_pemkes/".$enc."/add3");?>')">Perwakilan Masyarakat</a>]</td>
                        </tr>
                        </table>
                    <?php
						}
					}
                    ?>
                </td>
            </tr>
            <tr>
            	<td id="first-child">Tgl. Penetapan Musyawarah Diversi Pertama</td>
                <td colspan="2">
                	<?php echo $this->tanggalhelper->convertDayDate($detail_diversi->tgl_penetapan_musyawarah);
                	?>
                </td>                
            </tr>
            <tr>
            	<td id="first-child">Tgl. Musyawarah Diversi Pertama</td>
                <td colspan="2">
                	<?php echo $this->tanggalhelper->convertDayDate($detail_diversi->tgl_musyawarah);
                    ?>
                </td>
            </tr>
            <?php
            if(!empty($detail_diversi->tgl_penetapan_musyawarah)){
                echo '<tr>';
                    echo '<td id="first-child">Template Penetapan Musyawarah Diversi</td>';
                    echo '<td colspan="2">';                                                
                        echo '<a href="#" style="color:white;margin-bottom:15px" class="btn btn-primary btn-sm" onClick=cetakPenDiversi();><i class="fa fa-print" aria-hidden="true"></i> Cetak</a>';               
                    echo '</td>';
                echo '</tr>';
            }
			if(count($detail_pembimbing)>0){
			?>
			<tr>
				<td colspan="3" class="divider">Data Kesepakatan Pelaksanaan Musyawarah Diversi</td>
			</tr>
			<tr>
				<td id="first-child">Kesepakatan Pelaksanaan Musyawarah Diversi</td>
				<td>
					<?php
					if ($detail_diversi->kesepakatan_melaksanakan_diversi==1){
						echo "Sepakat Melaksanakan Diversi";
					}elseif ($detail_diversi->kesepakatan_melaksanakan_diversi==2){
						echo "Tidak Sepakat Melaksanakan Diversi";
					}else{
						echo "-";
					}
					?>
				</td>
				<td style="text-align:right;">
				<?php
				if ($caneditdiversi){
					// if($jadwaldiversi[0]->jam_musyawarah==NULL && $jadwaldiversi[0]->sampai_jam==NULL & $jadwaldiversi[0]->tempat==NULL){
						if($adaputusanakhir==false && $perkarapenetapan[0]['penetapan_hari_sidang']==NULL){
							if($detail_diversi->tgl_kesepakatan_diversi==NULL){
				?>
				[ <a href="#" onClick="popup_form('<?php echo base_url('edit_landiv/'.$enc.'/'.$encdiversi);?>')">Edit Kesepakatan Melaksanakan Diversi</a> ]
				<?php 
							}
						}
					// }
				}?>
				</td>
			</tr>
			<?php
			if ($detail_diversi->kesepakatan_melaksanakan_diversi==2){
			?>
            <tr>
            	<td id="first-child">Template Berita Acara Para Pihak Tidak Sepakat Melakukan Diversi</td>
				<td>
				<?php
				echo '<a href="#" style="color:white;margin-bottom:15px" class="btn btn-primary btn-sm" onClick="window.open(\''.base_url('c_template_diversi/cetak_ba_diversi/'.$enc.'/3').'\')"><i class="fa fa-print" aria-hidden="true"></i> Cetak</a>';
				?>
				</td>
			</tr>
			<?php
			}
			//if ($detail_diversi->kesepakatan_melaksanakan_diversi==1
			if ($detail_diversi->kesepakatan_melaksanakan_diversi>0)
			{
			?>
			<tr>
				<td colspan="3" class="divider">Data Jadwal Musyawarah Diversi</td>
			</tr>
			<tr>
            	<td id="first-child">Jadwal Musyawarah Diversi</td>
                <td colspan="2">
				<?php
				echo'<div class="cssTable" style="">
					<table id="tableinfo" style="margin:0px;padding:0px;">
						<col style="width:5%">
						<col>
						<col>
						<col>';
						if ($caneditdiversi){
							if($detail_diversi->tgl_kesepakatan_diversi==NULL){
								echo '<col style="width:100px">';
							}
						}
						echo'<tbody>
						<tr>
						<td>No</td>
						<td>Tanggal</td>
						<td>Dihadiri Oleh</td>
						<td>Tempat</td>';
						if ($caneditdiversi){
							if($detail_diversi->tgl_kesepakatan_diversi==NULL){
								echo '<td></td>';
							}
						}
						echo'</tr>';
							$urutan=1;
							foreach ($jadwaldiversi as $rowx){
								$encjadwaldiversi=base64_encode($this->encrypt->encode($rowx->id));
								$enctanggaldiversi=base64_encode($this->encrypt->encode($this->tanggalhelper->convertToInputDate($rowx->tanggal_musyawarah)));
								if($rowx->dihadiri_oleh==1){
									$hadir='Semua Pihak';
								}elseif($rowx->dihadiri_oleh==2){
									$hadir='Anak/Orang Tua/Wali/Penasihat Hukum Saja';
								}elseif($rowx->dihadiri_oleh==3){
									$hadir='Anak Korban/Orang Tua/Wali/Penasihat Hukum Saja';
								}elseif($rowx->dihadiri_oleh==4){
									$hadir='Semua Pihak Tidak Hadir';
								}else{
									if ($detail_diversi->kesepakatan_melaksanakan_diversi==1){
										$hadir='<font style="color:red">Kehadiran pihak belum diinput<br/>(Edit untuk menampilkan link Tunda)</font>';
									}else{
										$hadir='<font style="color:red">Kehadiran pihak belum diinput</font>';
										$statususer='Lengkapi Jadwal Musyawarah Diversi';
									}
								}
								if($rowx->tempat==''){
									$tempat='<font style="color:red">Ditentukan Kemudian</font>';
									$statususer='Lengkapi Jadwal Musyawarah Diversi';
								}else{
									$tempat=$rowx->tempat;
								}
								echo'<tr>
								<td style="text-align:center">'.$urutan.'</td>
								<td style="text-align:center">'.$this->tanggalhelper->convertDayDate($rowx->tanggal_musyawarah).'</td>
								<td style="text-align:center">'.$hadir.'</td>
								<td style="text-align:center">'.$tempat.'</td>';
								if ($caneditdiversi){
									if($detail_diversi->tgl_kesepakatan_diversi==NULL){
										if ($urutan==count($jadwaldiversi)){
											echo'<td style="text-align:center">
												<a href="#" onClick="popup_form(\''.base_url('edit_info_jadwal_diversi/'.$enc.'/'.$encdiversi.'/'.$encjadwaldiversi).'\')">Edit';
											
											if ($detail_diversi->kesepakatan_melaksanakan_diversi==1){
												if(($rowx->dihadiri_oleh!='' || $rowx->dihadiri_oleh!=0) && $jdiversiterakhir->tempat!='Ditentukan Kemudian'){
												echo'</a>|<a href="#" onClick="popup_form(\''.base_url('tunda_info_jadwal_diversi/'.$enc.'/'.$encdiversi.'/'.$encjadwaldiversi).'\')">Tunda</a>';
												}
											}
											echo'</td>';
										}else{
										echo '<td style="text-align:center"></td>';
										}
									}
								}
								echo'</tr>';
								$urutan++;
							}
					echo'</tbody>
					</table>
					</div>';
?>					
                </td>
			</tr>
            <tr>
            	<td id="first-child">Template Berita Acara Musyawarah Diversi</td>
                <td colspan="2">
				<?php
					echo '<a href="#" style="color:white;margin-bottom:15px" onClick="popup_form(\''.base_url('menu_data_persidangan_diversi/'.$enc.'/diversi/'.$encjadwaldiversi).'\')" class="btn btn-primary btn-sm"><i class="fa fa-pencil" aria-hidden="true"></i> Data Berita Acara</a>';
					echo '&nbsp;';
					echo '<a href="#" style="color:white;margin-bottom:15px" class="btn btn-primary btn-sm" onClick="popup_form(\''.base_url('c_template_diversi/popup_jenis_ba_diversi/'.$enc).'\')"><i class="fa fa-print" aria-hidden="true"></i> Cetak</a>';				
				?>
				</td>
			</tr>
<?php
if(!empty($jdiversiterakhir->dihadiri_oleh) && !empty($jdiversiterakhir->jam_musyawarah) && !empty($jdiversiterakhir->sampai_jam) && $jdiversiterakhir->tempat!='Ditentukan Kemudian'){
?>
			<tr>
				<td colspan="3" class="divider">Data Hasil Musyawarah Diversi</td>
			</tr>
            <tr>
            	<td id="first-child">Tgl. Hasil Musyawarah Diversi</td>
                <td>
                	<?php 
					if (!empty($detail_diversi->hasil_diversi) || $detail_diversi->hasil_diversi!=NULL){
						echo $this->tanggalhelper->convertDayDate($detail_diversi->tgl_kesepakatan_diversi);
					}else{
						echo "-";
						$statususer='Lengkapi Data Hasil Musyawarah Diversi';
					}
                    ?>
                </td>
				<td style="text-align:right">
				<?php
				if ($caneditdiversi){
					if($adaputusanakhir==false && $perkarapenetapan[0]['penetapan_hari_sidang']==NULL){
						if(($detail_diversi->hasil_diversi==1 && $detail_diversi->no_penetapan_kesepakatan==NULL) || ($detail_diversi->hasil_diversi==0)){
						?>
						[ <a href="#" onClick="popup_form('<?php echo base_url('edit_hsldiv/'.$enc.'/'.$encdiversi);?>')">Edit Data Hasil Musyawarah Diversi</a> ]
						<?php 
						} 
					}
				}?>
				</td>
            </tr>
            <tr>
            	<td id="first-child">Hasil Musyawarah Diversi</td>
                <td colspan="2">
                	<?php 
                		if ($detail_diversi->hasil_diversi==1){
                			echo "Berhasil/Mencapai Kesepakatan";
                		}else if ($detail_diversi->hasil_diversi==0 && $detail_diversi->hasil_diversi!=NULL){
                			echo "Tidak Berhasil/Tidak Mencapai Kesepakatan";
                		}else{
							echo "-";
                		}
                    ?>
                </td>
            </tr>
            <tr>
            	<td id="first-child">Isi Hasil Musyawarah Diversi</td>
                <td colspan="2">
                	<?php echo $detail_diversi->isi_singkat_diversi;?>
                </td>
            </tr>
	<?php 
	if ($detail_diversi->hasil_diversi==1){
	?>
			<tr>
            	<td id="first-child">Template Kesepakatan Diversi</td>
                <td colspan="2">
				<?php				
                echo '<a href="#" style="color:white;margin-bottom:10px" class="btn btn-primary btn-sm" onClick="window.open(\''.base_url('c_template_diversi/cetak_kesepakatan_diversi/'.$enc).'\')"><i class="fa fa-print" aria-hidden="true"></i> Cetak</a>';                
				?>
				</td>
			</tr>
	<?php
	}
	?>
            <tr>
            	<td id="first-child">Tanggal Laporan Hakim Fasilitator Kepada Ketua Pengadilan Negeri</td>
                <td colspan="2">
                	<?php echo $this->tanggalhelper->convertDayDate($detail_diversi->tgl_laporan_hakim);
                    ?>
                	
                </td>
            </tr>
		<?php
	if($detail_diversi->hasil_diversi==1 || $detail_diversi->hasil_diversi==0){
		if ($detail_diversi->hasil_diversi==1){
			$tampilnya="Template Laporan Diversi Mencapai Kesepakatan";
		}else{
			$tampilnya="Template Laporan Diversi Tidak Mencapai Kesepakatan";
		}
			?>
				<tr>
					<td id="first-child"><?php echo $tampilnya; ?></td>
					<td colspan="2">
					<?php
                    echo '<a href="#" style="color:white;margin-bottom:15px" class="btn btn-primary btn-sm" onClick="window.open(\''.base_url('c_template_diversi/cetak_laporan_diversi/'.$enc).'\')"><i class="fa fa-print" aria-hidden="true"></i> Cetak</a>';					              
					?>
					</td>
				</tr>
			<?php
	}
	if ($detail_diversi->hasil_diversi==1){
		?>
			<tr>
				<td colspan="3" class="divider">Data Penetapan Kesepakatan Diversi Oleh Ketua Pengadilan Negeri</td>
			</tr>
            <tr>
            	<td id="first-child">Nomor Penetapan Kesepakatan Diversi</td>
                <td><b>
                	<?php echo $detail_diversi->no_penetapan_kesepakatan;
                    ?>
                </b></td>
				<td style="text-align:right">
				<?php
				if ($this->authorization->HasRuleAddEditDiversiKPN()){
					if($detail_diversi->hasil_lap_pembimbing_masyarakat==NULL || $detail_diversi->tgl_lap_pembimbing_masyarakat==NULL){
						?>
						[ <a href="#" onClick="popup_form('<?php echo base_url('edit_penkesdiv/'.$enc.'/'.$encdiversi);?>')">Edit Penetapan Kesepakatan Diversi</a> ]
					<?php 
					}
				}?>
				</td>
            </tr>
            <tr>
            	<td id="first-child">Tanggal Penetapan Kesepakatan Diversi</td>
                <td colspan="2">
                	<?php echo $this->tanggalhelper->convertDayDate($detail_diversi->tgl_penetapan_kesepakatan_diversi);
                    ?>
                </td>
            </tr>
		<?php
		if (!empty($detail_diversi->no_penetapan_kesepakatan)){
		?>
            <!-- <tr>
            	<td id="first-child">Template Penetapan Kesepakatan Diversi</td>
                <td colspan="2">
				<?php
				// echo '<a href="#" style="color:white;margin-bottom:15px" class="btn btn-primary btn-sm" onClick=cetakPenDiversi();><i class="fa fa-print" aria-hidden="true"></i> Cetak</a>';               
				?>
				</td>
			</tr> -->
            <tr>
            	<td id="first-child">Tanggal Mulai Pelaksanaan Kesepakatan Diversi</td>
                <td colspan="2">
                	<?php echo $this->tanggalhelper->convertDayDate($detail_diversi->tgl_pelaksanaan_isi_diversi);
                    ?>	
                </td>
            </tr>
			<tr>
				<td colspan="3" class="divider">Data Hasil Pelaksanaan Kesepakatan Diversi</td>
			</tr>
            <tr>
            	<td id="first-child">Status Pelaksanaan Kesepakatan Diversi</td>
                <td>
					<?php 
					if($detail_diversi->hasil_lap_pembimbing_masyarakat==1){
						echo "Kesepakatan Diversi Dilaksanakan Sepenuhnya";
					}elseif($detail_diversi->hasil_lap_pembimbing_masyarakat==2){
						echo "Kesepakatan Diversi Tidak Dilaksanakan Sepenuhnya";
					}else{
						echo "-";
					}
                    ?>	
                </td>
				<td style="text-align:right">
				<?php
				if ($caneditdiversi){
					if($adaputusanakhir==false && $perkarapenetapan[0]['penetapan_hari_sidang']==NULL){
						?>
						[ <a href="#" onClick="popup_form('<?php echo base_url('edit_pelaksanaandiv/'.$enc.'/'.$encdiversi);?>')">Edit Hasil Pelaksanaan Kesepakatan Diversi</a> ]
						<?php 
					}
				} ?>
				</td>
            </tr>
            <tr>
            	<td id="first-child">Tgl. Laporan Pembimbing Kemasyarakatan Kepada Ketua Pengadilan Negeri</td>
                <td colspan="2">
                	<?php echo $this->tanggalhelper->convertDayDate($detail_diversi->tgl_lap_pembimbing_masyarakat);
                    ?>
                </td>
            </tr>
            <tr>
                <td id="first-child">No. Laporan Pembimbing Kemasyarakatan Kepada Ketua Pengadilan Negeri</td>
                <td colspan="2">
                    <?php echo $detail_diversi->nomor_laporan_pembimbing_masyarakat; ?>
                </td>
            </tr>
			<?php
			if($detail_diversi->hasil_lap_pembimbing_masyarakat==1){
				?>
				<tr>
					<td id="first-child">Template Penetapan Penghentian Pemeriksaan</td>
					<td colspan="2">
					<?php
					echo '<a href="#" style="color:white;margin-bottom:15px" class="btn btn-primary btn-sm" onClick=cetakPenHentiDiversi();><i class="fa fa-print" aria-hidden="true"></i> Cetak</a>';               
					?>
					</td>
				</tr>
				<?php
				if ($caneditdiversi){
					if($adaputusanakhir==false){
						?>
						<tr>
							<td id="first-child">Tautan Putusan</td>
							<td colspan="2">
							<?php echo '[ <a style="text-decoration: none;color:#e74c3c;" href="#" onClick="popup_form(\''.base_url("add_putusan_akhir/".$enc."/diversi").'\')">Tambah Penetapan Penghentian Pemeriksaan Perkara (Putusan Akhir)</a> ]'; ?>
							</td>
						</tr>
					<?php
					}
				}
			}
			}
		}
	}
}
}			
	?>
	<?php
	if ($detail_diversi->kesepakatan_melaksanakan_diversi==2 || ($detail_diversi->hasil_diversi==0 && $detail_diversi->hasil_diversi!=NULL) || $detail_diversi->hasil_lap_pembimbing_masyarakat==2){
	?>
				<tr>
					<td colspan="3" class="divider" style="background:red;text-align:center;color:white">
					<?php
					if (!empty($statususer)){
						echo $statususer;
					}else{
					?>
					Persidangan Perkara Pidana Khusus Anak Dilanjutkan - Lengkapi Penetapan Jadwal Sidang Pertama
					<?php } ?>
					</td>
				</tr>
	<?php
	}
?>
		</tbody>
	</table>
</div>
<script type="text/javascript">
function cetakPenDiversi(){
    window.open('<?php echo base_url("c_template_penetapan/cetak_penetapan_diversi/")."/".$enc;?>','_self');
};
function cetakPenHentiDiversi(){
    window.open('<?php echo base_url("c_template_putusan_pidana/cetak_penetapan_penghentian_pemeriksaan/")."/".$enc;?>','_self');  
}
closeLoading();
</script>