<style type="text/css">
#infoPerkara .wrapword li {
  display: list-item !important;
  clear: both;
  float: none !important;
}
</style>
<?php $idalurperkara = $this->tanggalhelper->getIDAlurPerkara($idperkara);
$canEditPenetapanPanitera=$this->authorization->HasRuleAddPenetapanPanitera($idperkara);
$can_edit=false;
if ($this->authorization->HasRuleAddEditDiversi($idperkara)) $can_edit=true;

?>
<div style="font-size:14px;">
    <?php         
        if($idalurperkara==9){
    ?>
        <table id='infoPerkara' style="font-size:14px;width:100%;">
            <col width="15%">            
            <col width="85%">
            <tbody>
                <tr>
                    <td colspan="2" style="background-color:#A3DBA8;padding:5px;">Panggilan Dismissal</td>                                        
                </tr>
            </tbo
        <table id='infoPerkara' style="font-size:14px;">
            <col width="15%">
            <col width="85%">
            <tbody>
                <tr>
                    <td id="first-child">Jadwal Panggilan Dismissal</td>
                    <td colspan="2">
                    <?php if(!empty($encid)){ ?>
                        <div class="cssTable">
                            <table id="tableinfo" style="margin:0px;padding:0px;">
                                <col width="10%">
                                <col width="30%">
                                <col width="20%">
                                <col width="30%">
                                <?php if ($can_edit){ ?>
                                    <col width="20%">
                                    <col width="10%"> 
                                <?php } ?>                            
                                <tbody>
                                    <tr>
                                        <td>No</td>
                                        <td>Tanggal Panggilan</td>
                                        <td>Waktu</td>
                                        <td>Status Kehadiran</td>
                                        <?php if ($can_edit){ ?>
                                            <td>Cetak Dokumen</td>
                                            <td></td>
                                        <?php } ?>                                     
                                   </tr>                                                                       
                                <?php
                                    if(!empty($jadwal)){
                                        $con=1;
                                        if($jadwal->num_rows>0){                                                                                                      
                                            foreach ($jadwal->result() as $rowx){
                                                $encid = base64_encode($this->encrypt->encode($rowx->id));
                                ?>
                                                <tr>
                                                    <td style="text-align:center"><?php echo $con; ?></td>
                                                    <td style="text-align:center"><?php echo $this->tanggalhelper->convertDayDate($rowx->tanggal_panggilan); ?></td>
                                                    <td style="text-align:center"><?php echo substr($rowx->waktu,0,5); ?></td>
                                                    <td style="text-align:center"><?php echo $rowx->status_text; ?></td>
                                                    <?php if ($can_edit){ ?>
                                                    <td>
                                                        
                                                        <span class="custom-dropdown custom-dropdown--emerald">
                                                            <select onchange="pilih_cetak(this)" style="width:150px;z-index:99999" class="custom-dropdown__select custom-dropdown__select--white">
                                                                <option>Cetak Relas</option>
                                                                <option value="<?php echo base_url("c_template_perdata_pemberitahuan_putusan/popup_pilihan_pihak/".$enc."/".$encid."/3");?>">Relaas Panggilan Pengugat</option>
                                                                <option value="<?php echo base_url("c_template_perdata_pemberitahuan_putusan/popup_pilihan_pihak/".$enc."/".$encid."/4");?>">Relaas Panggilan Tergugat</option>                                        
                                                            </select>
                                                        </span>
                                                    </td>
                                                    <td style="text-align:center">                                            
                                                        <a href="#" onClick="popup_form('<?php echo base_url('edit_info_panggilan_dismissal/'.$enc.'/'.$encid);?>')">Edit</a>                                                    
                                                    </td>
                                                    <?php } ?>
                                                </tr>
                                <?php
                                    $con++;
                                            }
                                        }
                                    }
                                ?>
                                </tbody>
                            </table>
                        </div> 
                    <?php } 
                    
                    if($canEditPenetapanPanitera){
                    ?>                       
                            <a href="#" onClick="popup_form('<?php echo base_url('add_info_panggilan_dismissal/'.$enc);?>')" class="btn btn-default btn-sm">Tambah Panggilan</a>            
                    <?php } ?>
                    </td>
                </tr>
            </tbody>
        </table>    
    <div style="padding:3px;"></div>
    <?php
        }
    ?>
    <table id='infoPerkara' style="font-size:14px;width:100%;" >
        <col width="15%">
        <col width="85%">
        <tbody>
            <tr>
                <td style="background-color:#A3DBA8;padding:5px;">Data Penetapan Dismissal</td>
                <td style="background-color:#A3DBA8;padding:5px;text-align:right;">                 
                </td>
            </tr>
        </tbody>
    <table id='infoPerkara' style="font-size:14px;width:100%;">
        <col width="15%">
        <col width="70%">
        <col width="15%">
        <tbody>
            <tr>
                <td id="first-child">Tanggal Dismissal</td>
                <td><?php echo $this->tanggalhelper->convertDayDate($tgl_dismissal);?></td>
                <td style="text-align:right;">
                    <?php if ($can_edit){?>
                        <a href="#" onClick="popup_form('<?php echo base_url("edit_dismissal/".$enc);?>')" class="btn btn-default btn-sm">Edit Penetapan Dismissal</a>
                    <?php } ?>
                </td>
            </tr>
        <?php if($idalurperkara==9){ ?>
            <tr>
                <td id="first-child" style="vertical-align: top;">Hasil Dismissal</td>
                <td colspan="2" class='wrapword'>
                    <?php 
                        if($hasil_dismissal==1){
                         echo 'Lolos';
                        }elseif($hasil_dismissal==2){
                         echo 'Tidak Lolos';
                        }else{
                         echo '-';
                        }
                    ?>
                </td>
            </tr>
        <?php } ?>
        <?php if($idalurperkara==8 OR $idalurperkara==17 OR ($idalurperkara==9 AND $hasil_dismissal==2)){ ?>
            <tr>
                <td id="first-child" style="vertical-align: top;">Pertimbangan Hukum dan Amar</td>
                <td colspan="2" class='wrapword'><?php echo $isi_dismissal;?></td>
            </tr>
        <?php } ?>
        <?php if(!empty($tgl_dismissal) && $can_edit){
                if($idalurperkara==9) {
                    $hasil_dismissal>0;
                } 
        ?>
            <tr>
                <td id="first-child">Dokumen Penetapan Dismissal</td>
                <td>
                <?php
                    $baseurl=$amar_putusan_dok;
                    if (($baseurl) and (file_exists($baseurl))){
                        echo "<br><a target='_new' href=$baseurl>Unduh Dokumen</a>";
                    }else{
                        echo "<br><span style='color:red;font-weight:bold'>Dokumen Belum Ada</span>";
                    }                    
                                    
                echo '</td>';
                if ($this->authorization->HasRuleFormHakimPanitera($this->encrypt->decode(base64_decode($enc))) AND !empty($isi_dismissal)){
                    echo '<td style="text-align:right">';
                        echo '<a href="#" onClick="popup_form(\''.base_url("fileupload_putusan/".$enc."/putusan").'\')" style="color:white" class="btn btn-warning btn-sm"><i class="fa fa-file-word-o"></i> Unggah E-Doc</a>';
                    echo '</td>';
                } ?>
            </tr>
            <tr>
                <td id="first-child">Cetak Dokumen Penetapan</td>
                <td colspan="2">
                    <a href="#" onClick=cetakPenetapanDismissal()>
                        <img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif">
                    </a>    
                </td>
            </tr>
        <?php } ?>
        </tbody>
    </table>
    <div style="padding:3px;"></div>
    <?php if($idalurperkara==8 OR $idalurperkara==17 OR ($idalurperkara==9  AND $hasil_dismissal==2)){ ?>
    <table id='infoPerkara' style="font-size:14px;width:100%;">
        <col width="15%">
        <col width="85%">
        <tbody>
            <tr>
                <td style="background-color:#A3DBA8;padding:5px;">Data Pemberitahuan</td>
                <td style="background-color:#A3DBA8;padding:5px;text-align:right;">                                        
                </td>
            </tr>
        </tbody>
    </table>
    <table id="infoPerkara" style="font-size:14px;width:100%;" >
        <col width="15%">
        <col width="65%">
        <col width="20%">
        <tbody>
        <?php 
        if($idalurperkara==8 OR $idalurperkara==17){ ?>
            <tr>
                <td id="first-child" style="vertical-align: top;">Tanggal Pemberitahuan</td>
                <td>
                    <?php
                    if($pihak_pertama!=''){
                        if($pihak_pertama->num_rows>0){
                    ?>
                        <div class="cssTable" >
                            <table id="tableinfo" style="margin:0px;padding:0px;">
                                <col width="15%">
                                <col width="55%">
                                <col width="30%">
                                <tbody>
                                    <tr>
                                        <td>Status</td>
                                        <td>Nama</td>
                                        <td>Tanggal Pemberitahuan</td>
                                    </tr>
                                        <?php
                                        $i=1;
                                        foreach ($pihak_pertama->result() as $row) {
                                            $status = $this->nativesession->getStatusPihak(10,$idalurperkara,1);
                                            echo '<tr>';
                                                echo '<td>'.$status.' '.$row->urutan.'</td>';
                                                echo '<td>'.$row->nama.'</td>';
                                                echo '<td>'.$this->tanggalhelper->convertDayDate($row->tanggal_pemberitahuan_putusan).'</td>';
                                            echo '</tr>';
                                        }?>
                                </tbody>
                            </table>
                        </div>
                    <?php
                        }
                    }
                    ?>
                    </br>
                    <?php
                    if($pihak_kedua!=''){
                        if($pihak_kedua->num_rows>0){
                    ?>
                        <div class="cssTable" >
                            <table id="tableinfo" style="margin:0px;padding:0px;">
                                <col width="15%">
                                <col width="55%">
                                <col width="30%">
                                <tbody>
                                    <tr>
                                        <td>Status</td>
                                        <td>Nama</td>
                                        <td>Tanggal Pemberitahuan</td>
                                    </tr>
                                        <?php
                                        $i=1;
                                        foreach ($pihak_kedua->result() as $row) {
                                            $status = $this->nativesession->getStatusPihak(10,$idalurperkara,2);
                                            echo '<tr>';
                                                echo '<td>'.$status.' '.$row->urutan.'</td>';
                                                echo '<td>'.$row->nama.'</td>';
                                                echo '<td>'.$this->tanggalhelper->convertDayDate($row->tanggal_pemberitahuan_putusan).'</td>';
                                            echo '</tr>';
                                        }?>
                                </tbody>
                            </table>
                        </div>
                    <?php
                        }
                    }
                    ?>
                </td>
                <td style="text-align:right;vertical-align:top;">         
                    <?php 
                    if ($this->authorization->HasRuleEditPemberitahuanPutusan($idalurperkara,$idperkara)){
                        ?>
                        <a href="#" onClick="popup_form('<?php echo base_url("add_pemberitahuan_dismissal/".$enc);?>')" class="btn btn-default btn-sm">Edit Pemberitahuan Dismissal</a>
                    <?php 
                    } 
                    ?>
                </td> 
            </tr>
            <tr>
                <td id="first-child">Tanggal Minutasi</td>
                <td><?php echo $this->tanggalhelper->convertDayDate($tgl_minutasi);?></td>
            </tr>
        <?php }else{ ?>
            <tr>
                <td id="first-child" style="vertical-align: top;">Tanggal Pemberitahuan Penggugat</td>
                <td><?php echo (!empty($pemberitahuan_penggugat))? $this->tanggalhelper->convertDayDate($pemberitahuan_penggugat):'-';?><br/>                    
                </td>  
                <td style="text-align:right;">
                    <?php 
                    // if ($can_edit)
                    if ($this->authorization->HasRuleEditPemberitahuanPutusan($idalurperkara,$idperkara))
                        {?>
                        <a href="#" onClick="popup_form('<?php echo base_url("add_pemberitahuan_dismissal/".$enc);?>')" class="btn btn-default btn-sm">Edit Pemberitahuan Dismissal</a>
                    <?php } ?>
                </td>                          
            </tr>
            <?php if(!empty($pemberitahuan_penggugat) && $can_edit){ ?>
            <tr>
                <td id="first-child">Cetak Dokumen</td>
                <td >                    
                    <a href="#" onClick=cetakPemberitahuanDismissalPenggugat()>
                        <img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif">
                    </a>                       
                </td>
            </tr>
            <?php } ?>
            <tr>
                <td id="first-child" style="vertical-align: top;">Tanggal Pemberitahuan Tergugat</td>
                <td colspan="2" ><?php echo (!empty($pemberitahuan_tergugat))? $this->tanggalhelper->convertDayDate($pemberitahuan_tergugat):'-';?><br/>                     
                </td>                            
            </tr>
            <?php if(!empty($pemberitahuan_tergugat) && $can_edit){ ?>
            <tr>
                <td id="first-child">Cetak Dokumen</td>
                <td >                    
                    <a href="#" onClick=cetakPemberitahuanDismissalTergugat()>
                        <img src="<?php echo base_url();?>resources/img/nm_icon_doc.gif">
                    </a>                       
                </td>
            </tr>
            <?php } ?>
            <?php if($ada_perlawanan==0){ ?>
            <tr>
                <td id="first-child">Tanggal Minutasi</td>
                <td colspan="2" ><?php echo $this->tanggalhelper->convertDayDate($tgl_minutasi);?></td>
            </tr>
            <?php } ?>
        <?php } ?>
        </tbody>
    </table>
    <?php } ?>
</div>
<script type="text/javascript">
<?php
if($idalurperkara==9){
    if($hasil_dismissal==1){
        $idtemplate = 1595;
    }else{
        $idtemplate = 1596;
    }
?>
function cetakPenetapanDismissal(){
    popup_form('<?php echo base_url("c_template_tun_perlawanan/popup_pilihan_ketua/".$enc."/".$idtemplate);?>');
};

<?php }else{ ?>
    function cetakPenetapanDismissal(){  
        window.open('<?php echo base_url("c_template_penetapan_perdata/cetak_penetapan_dismissal_pdt/".$enc);?>','_self'); 
    };
<?php } ?>

<?php if($idalurperkara==9){ ?> 
    function cetakPemberitahuanDismissalPenggugat(){
        popup_form('<?php echo base_url("c_template_tun_perlawanan/popup_pilihan_panitera_pbt/".$enc."/1627/3");?>');
    };

    function cetakPemberitahuanDismissalTergugat(){
        popup_form('<?php echo base_url("c_template_tun_perlawanan/popup_pilihan_panitera_pbt/".$enc."/1628/4");?>');
    };
<?php } ?>
closeLoading();
</script>
