<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>
  <col width="64" span="18" />
  <tr height="20">
    <th rowspan="2" height="41" width="64">NO</th>
    <th rowspan="2" width="64">URAIAN</th>
    <th colspan="4" width="256">SISA AWAL</th>
    <th colspan="4" width="256">MASUK</th>
    <th colspan="4" width="256">PUTUS</th>
    <th colspan="4" width="256">SISA AKHIR</th>
  </tr>
  <tr height="21">
    <th height="21">AD</th>
    <th>AL</th>
    <th>AU</th>
    <th>JML</th>
    <th>AD</th>
    <th>AL</th>
    <th>AU</th>
    <th>JML</th>
    <th>AD</th>
    <th>AL</th>
    <th>AU</th>
    <th>JML</th>
    <th>AD</th>
    <th>AL</th>
    <th>AU</th>
    <th>JML</th>
  </tr>
	<tr>
    <?php 
          if($idalurperkara==120){
            for ($a=1; $a<=18;$a++){
              echo "<th style='width:20px;'>".$a."</th>";
            }
          }else{
            for ($a=1; $a<=18;$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>";
					  echo "<td>".$row->uraian."</td>";
					  echo "<td style ='text-align:center'>".$row->sisa_lalu_m1."</td>";
			          echo "<td style ='text-align:center'>".$row->sisa_lalu_m2."</td>";
			          echo "<td style ='text-align:center'>".$row->sisa_lalu_m3."</td>";
			          echo "<td style ='text-align:center'>".$row->sisa_lalu_jml."</td>";

			          echo "<td style ='text-align:center'>".$row->masuk_m1."</td>";
			          echo "<td style ='text-align:center'>".$row->masuk_m2."</td>";
			          echo "<td style ='text-align:center'>".$row->masuk_m3."</td>";
			          echo "<td style ='text-align:center'>".$row->masuk_jml."</td>";

			          echo "<td style ='text-align:center'>".$row->putus_01."</td>";
			          echo "<td style ='text-align:center'>".$row->putus_02."</td>";
			          echo "<td style ='text-align:center'>".$row->putus_03."</td>";
			          echo "<td style ='text-align:center'>".$row->putus_jml."</td>";

			          echo "<td style ='text-align:center'>".$row->sisa_akhir_01."</td>";
			          echo "<td style ='text-align:center'>".$row->sisa_akhir_02."</td>";
			          echo "<td style ='text-align:center'>".$row->sisa_akhir_03."</td>";
			          echo "<td style ='text-align:center'>".$row->sisa_akhir_jml."</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>