<div style="padding:5px;min-width:1700px">
<div style="padding:20px;"></div>
<button class="btn btnExcel" style="width:150px;text-align:center;">Export Excel</button></div>
<table id="view_laporan" class="cetakExcel" border="0" cellpadding="2" cellspacing="0" style="margin:10px;">
	<tbody>
		<tr>
			<td align="center" colspan="93" style="text-align: center;border:0px;border-top:0;font-size:14px;border-right:0px;"><?php echo $perkara_nama;?></td>
		</tr>
		<tr>
			<td align="center" colspan="93" style="text-align: center;border:0px;font-size:14px;border-right:0px;"><?php echo $nama_pn;?></td>
		</tr>
		<tr>
<td align="center" colspan="93" style="text-align: center;border:0px;font-size:14px;border-bottom:1px solid #000000;border-right:0px;"><?php echo "Periode : ".$periode_awal." s/d ".$periode_akhir;?></td>
		</tr>
	</tbody>
  
  <tr>
    <th width="20"><p align="center"><strong>NO</strong></p></th>
    <?php if($idalurperkara==121){ ?>
    <th width="180"><p align="center"><strong>TANGGAL TERIMA</strong></p></th>
    <?php } ?>
    <th width="180"><p align="center"><strong>NOMOR REGISTER</strong></p></th>
    <?php if($idalurperkara==121){ ?>
    <th width="180"><p align="center"><strong>TANGGAL PERBUATAN</strong></p></th>
    <th width="180"><p align="center"><strong>NOMOR/TANGGAL SKEPPERA</strong></p></th>
    <?php } ?>    
    <th width="265"><p align="center"><strong>NAMA/PANGKAT/NRP/</strong><strong> </strong><br />
            <strong>JABATAN/KESATUAN</strong></p></th>
    <?php if($idalurperkara==120){ ?>
    <th width="30"><p align="center"><strong>MATRA</strong></p></th>
    <?php } ?>    
    <th width="400"><p align="center"><strong>PASAL</strong><strong> </strong><strong>DAKWAAN</strong></p></th>
    <?php if($idalurperkara==120){ ?>
    <th width="400"><p align="center"><strong>KLASIFIKASI DELIK</strong></p></th>
    <?php } ?>    
    <th width="150"><p align="center"><strong>KETERANGAN</strong></p></th>
  </tr>

	<tr>
    <?php 
          if($idalurperkara==120){
            for ($a=1; $a<=7;$a++){
              echo "<th style='width:20px;'>".$a."</th>";
            }
          }else{
            for ($a=1; $a<=8;$a++){
              echo "<th style='width:20px;'>".$a."</th>";
            }

          }
    ?>
    </tr>

	<?php
	if($rekap!=''){
		if($rekap->num_rows>0){
			$i=0;
			foreach ($rekap->result() as $row) {	
				$i++;
				echo "<tr>";
					  echo "<td style='width:20px;'>".$i."</td>";
            if($idalurperkara==121){
                echo "<td style ='text-align:left'>".parse_date($row->tanggal_pendaftaran)."</td>";  
            }
            if($idalurperkara==120){
					      echo "<td>".$row->nomor_perkara_banding."</br>".parse_date($row->permohonan_banding)."</td>";
            }else{
                echo "<td>".$row->nomor_perkara."</td>";
            }
            if($idalurperkara==121){
                echo "<td style ='text-align:left'>".parse_date($row->tanggal_kejadian)."</td>";  
                echo "<td style ='text-align:left'>".$row->nomor_skeppera."</br>".parse_date($row->tanggal_kejadian)."</td>";  
            }

					  echo "<td style ='text-align:left'>".$row->terdakwa."</td>";
            if($idalurperkara==120){
                echo "<td style ='text-align:center'>".$row->matra."</td>";
            }
            echo "<td style ='text-align:left'>".$row->pasal_dakwaan."</td>";
            if($idalurperkara==120){
                echo "<td style ='text-align:left'>".$row->klasifikasi_delik."</td>";
            }
            echo "<td></td>";

				echo "</tr>";

			
			}
				

		}
	}

	

	?>
</table>
</div>
<div style="padding:15px;"></div>
<script src="resources/js/jquery.table2excel.js"></script>
<script>
$(function() {
    $(".btnExcel").click(function(){
        $(".cetakExcel").table2excel({
            exclude: ".noExl",
            name: "Excel Document Name",
            filename: "Cetak Excel"
        });
    });
});
</script>