<div style="padding:5px;min-width:1550px;">
<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;min-width:1000px;">
	<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;">Januari - Desember <?php echo $tahun;?></td>
		</tr>
	</tbody>
  <col width="64" />
  <col width="179" />
  <col width="64" span="51" />
  <tr height="21">
    <th rowspan="2" height="123" width="64">NO</th>
    <th rowspan="2" width="179">SATUAN KERJA</th>
    <th colspan="4" width="256">JANUARI</th>
    <th colspan="4" width="256">FEBRUARI</th>
    <th colspan="4" width="256">MARET</th>
    <th colspan="4" width="256">APRIL</th>
    <th colspan="4" width="256">MEI</th>
    <th colspan="4" width="256">JUNI</th>
    <th colspan="4" width="256">JULI</th>
    <th colspan="4" width="256">AGUSTUS</th>
    <th colspan="4" width="256">SEPTEMBER</th>
    <th colspan="4" width="256">OKTOBER</th>
    <th colspan="4" width="256">NOPEMBER</th>
    <th colspan="4" width="256">DESEMBER</th>
    <th colspan="3" width="192">JUMLAH</th>
  </tr>
  <tr height="102">
    <th height="102">SISA LALU</th>
    <th>MASUK</th>
    <th>PUTUS</th>
    <th>SISA BLN INI</th>
    <th>SISA BLN LALU</th>
    <th>MASUK</th>
    <th>PUTUS</th>
    <th>SISA BLN INI</th>
    <th>SISA BLN LALU</th>
    <th>MASUK</th>
    <th>PUTUS</th>
    <th>SISA BLN INI</th>
    <th>SISA BLN LALU</th>
    <th>MASUK</th>
    <th>PUTUS</th>
    <th>SISA BLN INI</th>
    <th>SISA BLN LALU</th>
    <th>MASUK</th>
    <th>PUTUS</th>
    <th>SISA BLN INI</th>
    <th>SISA BLN LALU</th>
    <th>MASUK</th>
    <th>PUTUS</th>
    <th>SISA BLN INI</th>
    <th>SISA BLN LALU</th>
    <th>MASUK</th>
    <th>PUTUS</th>
    <th>SISA BLN INI</th>
    <th>SISA BLN LALU</th>
    <th>MASUK</th>
    <th>PUTUS</th>
    <th>SISA BLN INI</th>
    <th>SISA BLN LALU</th>
    <th>MASUK</th>
    <th>PUTUS</th>
    <th>SISA BLN INI</th>
    <th>SISA BLN LALU</th>
    <th>MASUK</th>
    <th>PUTUS</th>
    <th>SISA BLN INI</th>
    <th>SISA BLN LALU</th>
    <th>MASUK</th>
    <th>PUTUS</th>
    <th>SISA BLN INI</th>
    <th>SISA BLN LALU</th>
    <th>MASUK</th>
    <th>PUTUS</th>
    <th>SISA BLN INI</th>
    <th>MASUK</th>
    <th>PUTUS</th>
    <th>SISA BLN INI</th>
  </tr>

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

          }
    ?>
    </tr>


	<?php 
	if($rekap_tahunan!=''){
		if($rekap_tahunan->num_rows>0){
			$i=0;
			foreach ($rekap_tahunan->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_bln_lalu_01."</td>";
					echo "<td style ='text-align:center'>".$row->masuk_01."</td>";
					echo "<td style ='text-align:center'>".$row->putus_01."</td>";
					echo "<td style ='text-align:center'>".$row->sisa_bln_ini_01."</td>";

          echo "<td style ='text-align:center'>".$row->sisa_bln_lalu_02."</td>";
          echo "<td style ='text-align:center'>".$row->masuk_02."</td>";
          echo "<td style ='text-align:center'>".$row->putus_02."</td>";
          echo "<td style ='text-align:center'>".$row->sisa_bln_ini_02."</td>";

          echo "<td style ='text-align:center'>".$row->sisa_bln_lalu_03."</td>";
          echo "<td style ='text-align:center'>".$row->masuk_03."</td>";
          echo "<td style ='text-align:center'>".$row->putus_03."</td>";
          echo "<td style ='text-align:center'>".$row->sisa_bln_ini_03."</td>";

          echo "<td style ='text-align:center'>".$row->sisa_bln_lalu_04."</td>";
          echo "<td style ='text-align:center'>".$row->masuk_04."</td>";
          echo "<td style ='text-align:center'>".$row->putus_04."</td>";
          echo "<td style ='text-align:center'>".$row->sisa_bln_ini_04."</td>";

          echo "<td style ='text-align:center'>".$row->sisa_bln_lalu_05."</td>";
          echo "<td style ='text-align:center'>".$row->masuk_05."</td>";
          echo "<td style ='text-align:center'>".$row->putus_05."</td>";
          echo "<td style ='text-align:center'>".$row->sisa_bln_ini_05."</td>";

          echo "<td style ='text-align:center'>".$row->sisa_bln_lalu_06."</td>";
          echo "<td style ='text-align:center'>".$row->masuk_06."</td>";
          echo "<td style ='text-align:center'>".$row->putus_06."</td>";
          echo "<td style ='text-align:center'>".$row->sisa_bln_ini_06."</td>";

          echo "<td style ='text-align:center'>".$row->sisa_bln_lalu_07."</td>";
          echo "<td style ='text-align:center'>".$row->masuk_07."</td>";
          echo "<td style ='text-align:center'>".$row->putus_07."</td>";
          echo "<td style ='text-align:center'>".$row->sisa_bln_ini_07."</td>";

          echo "<td style ='text-align:center'>".$row->sisa_bln_lalu_08."</td>";
          echo "<td style ='text-align:center'>".$row->masuk_08."</td>";
          echo "<td style ='text-align:center'>".$row->putus_08."</td>";
          echo "<td style ='text-align:center'>".$row->sisa_bln_ini_08."</td>";

          echo "<td style ='text-align:center'>".$row->sisa_bln_lalu_09."</td>";
          echo "<td style ='text-align:center'>".$row->masuk_09."</td>";
          echo "<td style ='text-align:center'>".$row->putus_09."</td>";
          echo "<td style ='text-align:center'>".$row->sisa_bln_ini_09."</td>";

          echo "<td style ='text-align:center'>".$row->sisa_bln_lalu_10."</td>";
          echo "<td style ='text-align:center'>".$row->masuk_10."</td>";
          echo "<td style ='text-align:center'>".$row->putus_10."</td>";
          echo "<td style ='text-align:center'>".$row->sisa_bln_ini_10."</td>";

          echo "<td style ='text-align:center'>".$row->sisa_bln_lalu_11."</td>";
          echo "<td style ='text-align:center'>".$row->masuk_11."</td>";
          echo "<td style ='text-align:center'>".$row->putus_11."</td>";
          echo "<td style ='text-align:center'>".$row->sisa_bln_ini_11."</td>";

          echo "<td style ='text-align:center'>".$row->sisa_bln_lalu_12."</td>";
          echo "<td style ='text-align:center'>".$row->masuk_12."</td>";
          echo "<td style ='text-align:center'>".$row->putus_12."</td>";
          echo "<td style ='text-align:center'>".$row->sisa_bln_ini_12."</td>";
          $tot_masuk=$row->masuk_01
          +$row->masuk_02
          +$row->masuk_03
          +$row->masuk_04
          +$row->masuk_05
          +$row->masuk_06
          +$row->masuk_07
          +$row->masuk_08
          +$row->masuk_09
          +$row->masuk_10
          +$row->masuk_11
          +$row->masuk_12;

          echo "<td style ='text-align:center'>".$tot_masuk."</td>";
          $tot_putus=$row->putus_01
          +$row->putus_02
          +$row->putus_03
          +$row->putus_04
          +$row->putus_05
          +$row->putus_06
          +$row->putus_07
          +$row->putus_08
          +$row->putus_09
          +$row->putus_10
          +$row->putus_11
          +$row->putus_12  ;        
          echo "<td style ='text-align:center'>".$tot_putus."</td>";
          $tot_sisa_bln_ini=$row->sisa_bln_lalu_01+$tot_masuk-$tot_putus;
          echo "<td style ='text-align:center'>".$tot_sisa_bln_ini."</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>