

<!DOCTYPE html>
<html>
<head>
  <title>Cetak R/L All</title>
</head>
<body>

  <style type="text/css">
    body{
      font-family: arial;
    }

    .table{
      width: 100%;
    }

    th,td{
    }
    .table,
    .table th,
    .table td {
      padding: 5px;
      border: 1px solid black;
      border-collapse: collapse;
    }
  </style>
   <?php 
    include '../koneksi.php';
    include '../fungsi_indotgl.php';
    include 'fungsi_penyebut.php' ;

    $tgl=date('Y-m-d') ;
    $bln = date('m');
    $bulan=($bln) ;
    $tgl_indo=tgl_indo($tgl);
    
        $tgl_d = date('2024-01-01'); 
        $tgl_s = $_GET['tgls'];
        $rayon = $_GET['rayon'];
        $kdm   = $_GET['kdr'];
        $kdc   = '01' ;

        $sql2 = mysqli_query($koneksi, "SELECT kota,keuangan,gambar FROM kdkanca WHERE kd='01'");
        list($kota,$keuangan,$gambar) = mysqli_fetch_array($sql2);
        $jabatan='Bidang Akuntansi';
    ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD       XHTML       1.0       Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Untitled Document</title></head><body><img src="../gambar/<?php echo $gambar; ?>"></a><div align="center"></div>
  <center>
    <h3>Daftar Akunt Buku Besar LABA RUGI</h3>
  </center>
    <table class="">
      <tr>
        <td width="20%">Keterangan</td>
        <td width="1%">:</td>
        <td>Input Terakhir <?php echo date('d-m-Y', strtotime($tgl)); ?></td>
      </tr>
    </table>
	<table border="1" width="100%" style="border-collapse:collapse;" align="center">
    	<tr class="tableheader">
                    <tr class="tr-title">
              <thead>
                <tr>
                <th Style="text-align:center" colspan="3" bgcolor="#D3D3D3">Akunt Buku Besar</th>
                <th Style="text-align:center" colspan="2" bgcolor="#DCDCDC">Saldo Awal</th>
                <th Style="text-align:center" colspan="2" bgcolor="#DCDCDC">Mutasi</th>
                <th Style="text-align:center" colspan="2" bgcolor="#DCDCDC">Saldo Akhir</th>
                
            </tr>                
            <tr>
              <th width="2%" class="text-center" style="text-align:center; font-size: 10pt; font-weight:normal;">No</th>
              <th width="7%" class="text-center" style="text-align:center; font-size: 10pt; font-weight:normal;">Kode</th>
              <th width="25%" class="text-center" style="text-align:center; font-size: 10pt; font-weight:normal;">Nama</th>
              <th width="10%" class="text-center" style="text-align:center; font-size: 10pt; font-weight:normal;">Debet</th>
              <th width="10%" class="text-center" style="text-align:center; font-size: 10pt; font-weight:normal;">Kredit</th>
              <th width="10%" class="text-center" style="text-align:center; font-size: 10pt; font-weight:normal;">Debet</th>
              <th width="10%" class="text-center" style="text-align:center; font-size: 10pt; font-weight:normal;">Kredit</th>
              <th width="10%" class="text-center" style="text-align:center; font-size: 10pt; font-weight:normal;">Debet</th>
              <th width="10%" class="text-center" style="text-align:center; font-size: 10pt; font-weight:normal;">Kredit</th>
              
            </tr>
              </thead>
                <tbody>
            <?php 
            $no=1;
            $data = mysqli_query($koneksi,"SELECT * FROM nawal_isi WHERE klp>='40' order by noperk ASC");
            while($d = mysqli_fetch_array($data)){
    
              ?>
                        <tr>
                            <td><?php echo $no++; ?></td>
                            <td style="text-align:center; font-size: 11pt; font-weight:normal;"><?php echo $d['noperk'] ?></td>
                            <td style="text-align:left; font-size: 11pt; font-weight:normal;"><?php echo $d['perk']; ?></td>
                            <td style="text-align:right; font-size: 11pt; font-weight:normal;"><?php echo "" . number_format("$d[awald]", 0, ",", "."); ?></td>
                            <td style="text-align:right; font-size: 11pt; font-weight:normal;"><?php echo "" . number_format("$d[awalk]", 0, ",", "."); ?></td>
                            <td style="text-align:right; font-size: 11pt; font-weight:normal;"><?php echo "" . number_format("$d[mutasid]", 0, ",", "."); ?></td>
                            <td style="text-align:right; font-size: 11pt; font-weight:normal;"><?php echo "" . number_format("$d[mutasik]", 0, ",", "."); ?></td>
                            <td style="text-align:right; font-size: 11pt; font-weight:normal;"><?php echo "" . number_format("$d[akhird]", 0, ",", "."); ?></td>
                            <td style="text-align:right; font-size: 11pt; font-weight:normal;"><?php echo "" . number_format("$d[akhirk]", 0, ",", "."); ?></td>
                        </tr>   
                        </div>
                      </div>
                    </div>
              <?php } ?>
          </tbody>
                      
                        <?php 
                $sql2 = mysqli_query($koneksi, "SELECT sum(awald) AS tawald,sum(awalk) AS tawalk,sum(mutasid) AS tmutd,sum(mutasik) AS tmutk,sum(akhird) AS takhird,sum(akhirk) AS takhirk FROM nawal_isi WHERE klp>='40' ");
                list($awald,$awalk,$tmutd,$tmutk,$akhird,$akhirk) = mysqli_fetch_array($sql2);
                
                $laba_rugi=($akhirk-$akhird);
                $nol=0 ;
                $total_balance=($akhirk+$laba_rugi);
            	        ?>						
							<tr>
						    	<td colspan="3" style="font-weight: bold;text-align: center;">Total </td>																																									
								<td align='right'><style="font-weight: bold;">
								    <?php echo "" . number_format("$awald", 0, ",", "."); ?>
								</td>    
								<td align='right'><style="font-weight: bold;">
								    <?php echo "" . number_format("$awalk", 0, ",", "."); ?>
								</td>								

								<td align='right'><style="font-weight: bold;">
								    <?php echo "" . number_format("$tmutd", 0, ",", "."); ?>
								</td>    
								<td align='right'><style="font-weight: bold;">
								    <?php echo "" . number_format("$tmutk", 0, ",", "."); ?>
								</td>	
								<td align='right'><style="font-weight: bold;">
								    <?php echo "" . number_format("$akhird", 0, ",", "."); ?>
								</td>    
								<td align='right'><style="font-weight: bold;">
								    <?php echo "" . number_format("$akhirk", 0, ",", "."); ?>
								</td>		
							</tr>             
				
							<tr>
						    	<td colspan="7" style="font-weight: bold;text-align: center;">LABA (RUGI) </td>																																									
								<td align='right'><style="font-weight: bold;">
								    <?php echo "" . number_format("$nol", 0, ",", "."); ?>
								</td>    
								<td align='right'><style="font-weight: bold;">
								    <?php echo "" . number_format("$laba_rugi", 0, ",", "."); ?>
								</td>		
							</tr>         
        </table>
        
            <br />
            <div>
                <?php echo $kota ; ?>, <?php echo $tgl_indo ; ?>
            </div>
            <div>
                <?php
                echo $jabatan;
                ?>
            </div>
                <p>
                <br />
                <br />
                </p>            
            <div>
                <?php
                echo $keuangan;
                ?>
            </div>
            
              </div>

    </h5>

</body>

    <script>
		window.load = print_d();
		function print_d(){
			window.print();
		}
	</script>
</html>