<?php
$perkaraid = $this->encrypt->decode(base64_decode($idperkara)); 
?>

<div id='infoPerkara' style="font-size:14px;">
            <a href="#" onClick="popup_form('<?php echo base_url('tambah_court_calendar/tambah/'.$idperkara);?>')" class="btn btn-default btn-sm">Tambah Court Calender</a>
            <a href="#" onClick="cetakCC()" class="btn btn-warning btn-sm" style="color:white"> Cetak</a>
        </div>
<div class="cssTable" style="margin-top:5px;">
    <table id="tableinfo">
        <colgroup></colgroup>
        <tbody>
            <tr>
                <td width="3%">NO</td>
                <td width="14%">Tanggal</td>
                <td width="15%">Pukul</td>
                <td width="43%">Agenda/Acara Sidang</td>
                <td width="20%">Keterangan</td>
                <?php 
                    if(empty($edoc_court)){
                        echo '<td width="5%">Link</td>';
                    }
                ?>
            </tr>           
			<?php
			$con=1;
			if($detil_court_calendar->num_rows>0){
				foreach ($detil_court_calendar->result() as $row) {
					$id = base64_encode($this->encrypt->encode($row->id));
					$i=0;
                    ?>
							<tr>
                            <td align="center"><?php echo $con++;?></td>
                            <td >
                                <?php echo $this->tanggalhelper->convertDayDate($row->rencana_tanggal);?>
                            </td>
                            <td>
                                <?php if (!empty($row->rencana_jam)){echo 'Pukul : '.substr($row->rencana_jam,0,5).' s.d selesai';}else{echo " - ";} ?>
                            </td>
                            <td align="left"><?php if (!empty($row->rencana_agenda)){echo $row->rencana_agenda;}else{echo "-";}?></td>
                            <td align="left"><?php if (!empty($row->keterangan)){echo $row->keterangan;}else{echo "-";}?></td>
                            <?php 
                                if(empty($edoc_court)){ ?>
                                <td align="center">
                                    <a href="#" onClick="popup_form('<?php echo base_url('tambah_court_calendar/edit/'.$idperkara.'/'.$id);?>')">Edit</a>
                                </td>
                            <?php }
                            ?>
                            </tr><?php
				}
			}else{
                echo '<tr>';
                    echo '<td colspan="8" align="center">Tidak Ada Pencatatan Rencana Sidang</td>';
                echo '</tr>';
            }
			?>
        </tbody>
    </table>
    <?php if($detil_court_calendar->num_rows>0){?>
        <a href="#" onClick="popup_form('<?php echo base_url('fileupload/'.$idperkara.'/kalender');?>')" class="btn btn-success btn-sm" style="color:white">Unggah E-Dokumen</a>
    <?php }
        if(file_exists($edoc_court)){
            echo "<a style='color:white' class='btn btn-success btn-sm' href='#' onClick='unduh()'>Unduh Dokumen</a>";
        }
    ?>
</div>
<script type="text/javascript">

function cetakCC(){
	    window.open('<?php echo base_url("manage_court_calendar/cetak/")."/".$idperkara;?>','_self');
	}
function unduh(){
        window.open('<?php echo base_url($edoc_court); ?>','_parent');
    }

closeLoading();
</script>
