<script type="text/javascript" charset="utf-8">
          $(document).ready(function(){
            $('#bbkas').dataTable({
					     "oLanguage": {
						      "sLengthMenu": "Tampilkan _MENU_ data per halaman",
						      "sSearch": "Pencarian: ", 
						      "sZeroRecords": "Maaf, tidak ada data yang ditemukan",
						      "sInfo": "Menampilkan _START_ s/d _END_ dari _TOTAL_ data",
						      "sInfoEmpty": "Menampilkan 0 s/d 0 dari 0 data",
						      "sInfoFiltered": "(di filter dari _MAX_ total data)",
						      "oPaginate": {
						          "sFirst": "<<",
						          "sLast": ">>", 
						          "sPrevious": "<", 
						          "sNext": ">"
					       }
				      },
              "sPaginationType":"full_numbers",
              "bJQueryUI":true
            });
          })    
        </script>

<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="400" class="isi_tabel">
        <tr>
          <td colspan="3"><h1 style="color:#033">Index Buku Besar Aktiva</h1></td>
        </tr>
        <tr>
          <td width="159">Bulan/ Tahun Lapor</td>
          <td width="10">:</td>
          <td width="215"><?php echo $bulan.'/ '.$tahun;?></td>
        </tr>
        <tr>
          <td>Unit</td>
          <td>:</td>
          <td><?php echo $_SESSION['nama'];?></td>
        </tr>
        <tr>
          <td>Tanggal</td>
          <td>:</td>
          <td><?php echo date('d-M-Y');?></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="90%" align="center"  bgcolor="#FFFFFF" class="display" id="bbkas">
      <thead>
        <tr class="form_body" height="30">
          <th align="center" width="48">No</th>
          <th width="95" align="center">Akun</th>
           <th width="104" align="center">Perkiraan</th>
          <th width="264" align="center">Keterangan</th>
          <th width="118" align="center">Saldo Awal</th>
          <th width="120" align="center">Saldo Akhir</th>
        </tr>
        </thead>
      <tbody>
      
        <?php        mysql_select_db("csabrude_akurat");
					          $sql = mysql_query("SELECT * From akun_tb where kelompok='Aktiva' order by akun");
					          $no = 1;
							
                    while ($r = mysql_fetch_array($sql)) {
                      echo "<tr height='25'>
          <td align='center'>$no</td>";?>
		  <?php
		  if($r['akun']=='1300'){
			  $saldo_all=$row_saldo_awal['col_1300'];
		  }else{
		  $saldo_all=$row_saldo_awal['col_1210']+$row_saldo_awal['col_1220']+$row_saldo_awal['col_1230']+$row_saldo_awal['col_1240']+$row_saldo_awal['col_1250'];
		  }
		  ?>
          <?php echo
            "<td align='center'>";?><a href="?section=Report&module=bb_aktiva&akun=<?php echo $r['akun'];?>&saldo=<?php echo $saldo_all;?>"><?php echo $r['akun'];?></a><?php echo"</td>";?>
				<?php
			if($r['perkiraan']=='1210'){
		  $saldo=$row_saldo_awal['col_1210'];
	
			}
			elseif($r['perkiraan']=='1220'){
		  $saldo=$row_saldo_awal['col_1220'];
	
			}
			elseif($r['perkiraan']=='1230'){
		  $saldo=$row_saldo_awal['col_1230'];
	
			}
			elseif($r['perkiraan']=='1240'){
		  $saldo=$row_saldo_awal['col_1240'];
	
			}
			elseif($r['perkiraan']=='1250'){
		  $saldo=$row_saldo_awal['col_1250'];
	
			}
			elseif($r['perkiraan']=='1300'){
		  $saldo=$row_saldo_awal['col_1300'];
		
			}
			else{
			}?> 	
            <?php echo
			"<td align='center'>";?><a href="?section=Report&module=bb_aktiva_perkir&perkir=<?php echo $r['perkiraan'];?>&saldo=<?php echo $saldo;?>"><?php echo $r['perkiraan'];?></a><?php echo"</td>
			<td align='left'>$r[keterangan]</td>
			<td align='right'>";?>
			<?php
			if($r['perkiraan']=='1210'){
		  $saldo=$row_saldo_awal['col_1210'];
		  echo formatRupiah($saldo);
			}
			elseif($r['perkiraan']=='1220'){
		  $saldo=$row_saldo_awal['col_1220'];
		  echo formatRupiah($saldo);
			}
			elseif($r['perkiraan']=='1230'){
		  $saldo=$row_saldo_awal['col_1230'];
		  echo formatRupiah($saldo);
			}
			elseif($r['perkiraan']=='1240'){
		  $saldo=$row_saldo_awal['col_1240'];
		  echo formatRupiah($saldo);
			}
			elseif($r['perkiraan']=='1250'){
		  $saldo=$row_saldo_awal['col_1250'];
		  echo formatRupiah($saldo);
			}
			elseif($r['perkiraan']=='1300'){
		  $saldo=$row_saldo_awal['col_1300'];
		  echo formatRupiah($saldo);
			}
			else{
			}?>
			<?php echo"</td>
			<td align='right'>";?>
			<?php
			include 'module/_proses/hitung_aktiva.php';
			if($r['perkiraan']=='1210'){
		  $saldo=($row_saldo_awal['col_1210']+$row_saldo['ttl_krd'])-$row_saldo['ttl_dbt'];
		  echo formatRupiah($saldo);
			}
			elseif($r['perkiraan']=='1220'){
		  $saldo=($row_saldo_awal['col_1220']+$row_saldo['ttl_krd'])-$row_saldo['ttl_dbt'];
		  echo formatRupiah($saldo);
			}
			elseif($r['perkiraan']=='1230'){
		  $saldo=($row_saldo_awal['col_1230']+$row_saldo['ttl_krd'])-$row_saldo['ttl_dbt'];
		  echo formatRupiah($saldo);
			}
			elseif($r['perkiraan']=='1240'){
		  $saldo=($row_saldo_awal['col_1240']+$row_saldo['ttl_krd'])-$row_saldo['ttl_dbt'];
		  echo formatRupiah($saldo);
			}
			elseif($r['perkiraan']=='1250'){
		  $saldo=($row_saldo_awal['col_1250']+$row_saldo['ttl_krd'])-$row_saldo['ttl_dbt'];
		  echo formatRupiah($saldo);
			}
			elseif($r['perkiraan']=='1300'){
		  $saldo=($row_saldo_awal['col_1300']+$row_saldo['ttl_krd'])-$row_saldo['ttl_dbt'];
		  echo formatRupiah($saldo);
			}
			else{
			}?>
			<?php echo"</td>
          </tr>";
                      $no++;
                    }
                    ?>
      </tbody>
      <tfoot>
        </tfoot>
    </table></td>
  </tr>
</table>
        