



<!DOCTYPE html>
<html>
<head>
  <title>Cetak R/L TGL sd TGL</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 
    session_start();
    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);
            //////////////////////////////////////////////////////////////////////////// 
            $kdc   =$_SESSION['kdc'];
            $oleh  =$_GET['toleh'];
            //////////////////////////////////////////////////////////////////////////// 
            $oleh   =$_SESSION['id_kar'];
            $xx     = $oleh ;
            $tabel_tujuan   = "nawal_".$xx; 
            $tabel_asal     = "nawal";
            ////////////////////////////////////////////////////////////////////////////     
            $tgl_d = $_GET['xtgl_d'];
            $tgl_s = $_GET['xtgl_s'];
              
              $tgl_ke_1 =date('2025-01-01');        
              $tgl_p    =strtotime("$tgl_d");
              $tgl_lalu =date('Y-m-d', strtotime("-1 day", $tgl_p));
            //////////////////////////////////////////////////////////////////////////// 
        $sql2 = mysqli_query($koneksi, "SELECT kota,ttd_2,nama_ttd_2,gambar FROM kdkanca WHERE kd='$kdc'");
        list($kota,$ttd_2,$nama_ttd_2,$gambar) = mysqli_fetch_array($sql2);
    ?>  
<!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>Laporan Kenaikan (Penurunan) Aset Bersih</h3>
  </center>
    <table class="">
      <tr>
        <td width="20%">Keterangan</td>
        <td width="1%">:</td>
        <td>S/d Tanggal : <?php echo date('d-m-Y', strtotime($tgl_s)); ?> dan s/d Tanggal <?php echo date('d-m-Y', strtotime($tgl_lalu)); ?></td>
      </tr>
    </table>
	<table border="1" width="100%" style="border-collapse:collapse;" align="center">
    	<tr class="tableheader">
            <tr class="tr-title">
              <thead>
          
            <tr>
                <th width="55%" Style="text-align:center" colspan="3" bgcolor="#D3D3D3">Keterangan</th>
                <th width="15%" Style="text-align:center" colspan="1" bgcolor="#DCDCDC">S/d <?php echo date('d-m-Y', strtotime($tgl_s)); ?></th>
                <th width="15%" Style="text-align:center" colspan="1" bgcolor="#DCDCDC">S/d <?php echo date('d-m-Y', strtotime($tgl_lalu)); ?></th>
                <th width="15%" Style="text-align:center" colspan="1" bgcolor="#DCDCDC">Antara</th>
            </tr>               
              </thead>
          <tbody>
            <?php
                $kd4='4';
                $sqlx = mysqli_query($koneksi, "SELECT nama FROM n_kode_1 WHERE kd1='$kd4' limit 1 ");
                list($nama) = mysqli_fetch_array($sqlx);
            ?>
                <tr>
                    <td colspan="3" style="font-weight: bold;text-align: center;background-color: <?php echo$_SESSION['warna_bag']; ?>;"><?php echo $nama ?></td>
                    <td align='right' style="font-weight: bold;background-color: <?php echo$_SESSION['warna_bag']; ?>;"><?php echo ""?></td>
                    <td align='right' style="font-weight: bold;background-color: <?php echo$_SESSION['warna_bag']; ?>;"><?php echo ""?></td>
                    <td align='right' style="font-weight: bold;background-color: <?php echo$_SESSION['warna_bag']; ?>;"><?php echo ""?></td>
                </tr>
            <?php 
            $no=1;
            $nol=0;
            //
            $data = mysqli_query($koneksi,"SELECT * FROM $tabel_tujuan WHERE nosub='411' and kt<>'X' and (awald+awalk+akhird+akhirk)<>0 order by noperk ASC ");
            while($w = mysqli_fetch_array($data)){
              $antara=$w['akhirk']-$w['awalk'];
              ?>
                          <tr>
                            <td><?php echo $no++; ?></td>
                            <td style="text-align:left; font-size: 11pt; font-weight:normal;"><?php echo $w['noperk'] ?></td>
                            <td style="text-align:left; font-size: 11pt; font-weight:normal;"><?php echo $w['perk']; ?></td>
                            <td style="text-align:right; font-size: 11pt; font-weight:normal;"><?php echo "" . number_format("$w[akhirk]", 0, ",", "."); ?></td>
                            <td style="text-align:right; font-size: 11pt; font-weight:normal;"><?php echo "" . number_format("$w[awalk]", 0, ",", "."); ?></td>
                            <td style="text-align:right; font-size: 11pt; font-weight:normal;"><?php echo "" . number_format("$antara", 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 $tabel_tujuan WHERE kt<>'X' and nosub='411' ");
                list($awald,$awalk,$tmutd,$tmutk,$takhird,$takhirk) = mysqli_fetch_array($sql2);
                  $phu_4_ak=($takhirk);
                  $phu_4_aw=($awalk);
                  $jantara=$takhirk-$awalk;
            	        ?>						
							<tr>
						    	<td colspan="3" style="font-weight: bold;text-align: center;background-color: #B0C4DE;">Jumlah <?php echo $nama ?> </td>																																									
								<td style="font-weight: bold;text-align: right;background-color: #B0C4DE;"><?php echo "" . number_format("$takhirk", 0, ",", "."); ?></td>    
								<td style="font-weight: bold;text-align: right;background-color: #B0C4DE;"><?php echo "" . number_format("$awalk", 0, ",", "."); ?></td>
                <td style="font-weight: bold;text-align: right;background-color: #B0C4DE;"><?php echo "" . number_format("$jantara", 0, ",", "."); ?></td>    
							</tr>              
 

          <tbody>
            <?php
                $kd5='5';
                $sqlx = mysqli_query($koneksi, "SELECT nama FROM n_kode_1 WHERE kd1='$kd5' limit 1 ");
                list($nama) = mysqli_fetch_array($sqlx);
            ?>
                <tr>
                    <td colspan="3" style="font-weight: bold;text-align: center;background-color: <?php echo$_SESSION['warna_bag']; ?>;"><?php echo $nama ?></td>
                    <td align='right' style="font-weight: bold;background-color: <?php echo$_SESSION['warna_bag']; ?>;"><?php echo ""?></td>
                    <td align='right' style="font-weight: bold;background-color: <?php echo$_SESSION['warna_bag']; ?>;"><?php echo ""?></td>
                    <td align='right' style="font-weight: bold;background-color: <?php echo$_SESSION['warna_bag']; ?>;"><?php echo ""?></td>
                </tr>
            <?php 
            $no=1;
            $nol=0;
            //
            $data = mysqli_query($koneksi,"SELECT * FROM $tabel_tujuan WHERE nosub='511' and kt<>'X' and (awald+awalk+akhird+akhirk)<>0 order by noperk ASC ");
            while($w = mysqli_fetch_array($data)){
              $antara=$w['akhird']-$w['awald'];
              ?>
                          <tr>
                            <td><?php echo $no++; ?></td>
                            <td style="text-align:left; font-size: 11pt; font-weight:normal;"><?php echo $w['noperk'] ?></td>
                            <td style="text-align:left; font-size: 11pt; font-weight:normal;"><?php echo $w['perk']; ?></td>
                            <td style="text-align:right; font-size: 11pt; font-weight:normal;"><?php echo "" . number_format("$w[akhird]", 0, ",", "."); ?></td>
                            <td style="text-align:right; font-size: 11pt; font-weight:normal;"><?php echo "" . number_format("$w[awald]", 0, ",", "."); ?></td>
                            <td style="text-align:right; font-size: 11pt; font-weight:normal;"><?php echo "" . number_format("$antara", 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 $tabel_tujuan WHERE kt<>'X' and nosub='511' ");
                list($awald,$awalk,$tmutd,$tmutk,$takhird,$takhirk) = mysqli_fetch_array($sql2);
                  $phu_5_ak=($takhird);
                  $phu_5_aw=($awald);
                  $jantara=$takhird-$awald;
                      ?>            
              <tr>
                  <td colspan="3" style="font-weight: bold;text-align: center;background-color: #B0C4DE;">Jumlah <?php echo $nama ?> </td>                                                                                  
                <td style="font-weight: bold;text-align: right;background-color: #B0C4DE;"><?php echo "" . number_format("$takhird", 0, ",", "."); ?></td>    
                <td style="font-weight: bold;text-align: right;background-color: #B0C4DE;"><?php echo "" . number_format("$awald", 0, ",", "."); ?></td>
                <td style="font-weight: bold;text-align: right;background-color: #B0C4DE;"><?php echo "" . number_format("$jantara", 0, ",", "."); ?></td>      
              </tr>              
          </tbody>
        

 
                <?php 
                  $phu_ktr_ak=($phu_4_ak-$phu_5_ak);
                  $phu_ktr_aw=($phu_4_aw-$phu_5_aw);  
                  $tantaran_shu_k=$phu_ktr_ak-$phu_ktr_aw ;
                ?>						
                <tr>
                    <td colspan="3" style="font-weight: bold;text-align: center;background-color: #00FFFF;">Kenaikan (Penurunan) Aset Bruto</td>                   
                    <td align='right' style="font-weight: bold;background-color: #00FFFF;"><?php echo "" . number_format("$phu_ktr_ak", 0, ",", "."); ?></td>
                    <td align='right' style="font-weight: bold;background-color: #00FFFF;"><?php echo "" . number_format("$phu_ktr_aw", 0, ",", "."); ?></td>
                    <td align='right' style="font-weight: bold;background-color: #00FFFF;"><?php echo "" . number_format("$tantaran_shu_k", 0, ",", "."); ?></td>
                </tr>			

          <tbody>
            <?php
                $kd6='6';
                $sqlx = mysqli_query($koneksi, "SELECT nama FROM n_kode_1 WHERE kd1='$kd6' limit 1 ");
                list($nama) = mysqli_fetch_array($sqlx);
            ?>
                <tr>
                    <td colspan="3" style="font-weight: bold;text-align: center;background-color: <?php echo$_SESSION['warna_bag']; ?>;"><?php echo $nama ?></td>
                    <td align='right' style="font-weight: bold;background-color: <?php echo$_SESSION['warna_bag']; ?>;"><?php echo ""?></td>
                    <td align='right' style="font-weight: bold;background-color: <?php echo$_SESSION['warna_bag']; ?>;"><?php echo ""?></td>
                    <td align='right' style="font-weight: bold;background-color: <?php echo$_SESSION['warna_bag']; ?>;"><?php echo ""?></td>
                </tr>
            <?php 
            $no=1;
            $nol=0;
            //
            $data = mysqli_query($koneksi,"SELECT * FROM $tabel_tujuan WHERE noperk>'40000' and nosub<>'511' and nosub<>'411' and kt<>'X' and (awald+awalk+akhird+akhirk)<>0 order by noperk ASC ");
            while($w = mysqli_fetch_array($data)){
              $jumlah_aw=$w[awalk]-$w[awald];
              $jumlah_ak=$w[akhirk]-$w[akhird];
              $jumlah_an=$jumlah_ak-$jumlah_aw;
              ?>
                          <tr>
                            <td><?php echo $no++; ?></td>
                            <td style="text-align:left; font-size: 11pt; font-weight:normal;"><?php echo $w['noperk'] ?></td>
                            <td style="text-align:left; font-size: 11pt; font-weight:normal;"><?php echo $w['perk']; ?></td>
                            <td style="text-align:right; font-size: 11pt; font-weight:normal;"><?php echo "" . number_format("$jumlah_ak", 0, ",", "."); ?></td>
                            <td style="text-align:right; font-size: 11pt; font-weight:normal;"><?php echo "" . number_format("$jumlah_aw", 0, ",", "."); ?></td>
                            <td style="text-align:right; font-size: 11pt; font-weight:normal;"><?php echo "" . number_format("$jumlah_an", 0, ",", "."); ?></td>
                            </tr>       
                        </div>
                      </div>
                    </div>
              <?php } ?>
          </tbody>
                        <?php 
                $sql2 = mysqli_query($koneksi, "SELECT sum(awalk-awald) AS tawal,sum(mutasik-mutasik) AS tmutasi,sum(akhirk-akhird) AS takhir FROM $tabel_tujuan WHERE noperk>'40000' and nosub<>'511' and nosub<>'411' and kt<>'X' ");
                list($tawal,$tmutasi,$takhir) = mysqli_fetch_array($sql2);
                      $tantar=$takhir-$tawal ;
                      ?>            
              <tr>
                  <td colspan="3" style="font-weight: bold;text-align: center;background-color: #B0C4DE;">Jumlah <?php echo $nama ?> </td>                                                                                  
                <td style="font-weight: bold;text-align: right;background-color: #B0C4DE;"><?php echo "" . number_format("$takhir", 0, ",", "."); ?></td>    
                <td style="font-weight: bold;text-align: right;background-color: #B0C4DE;"><?php echo "" . number_format("$tawal", 0, ",", "."); ?></td>  
                <td style="font-weight: bold;text-align: right;background-color: #B0C4DE;"><?php echo "" . number_format("$tantar", 0, ",", "."); ?></td>   
              </tr>
                        <?php 
                $sql2 = mysqli_query($koneksi, "SELECT sum(awalk-awald) AS tawal,sum(mutasik-mutasik) AS tmutasi,sum(akhirk-akhird) AS takhir FROM $tabel_tujuan WHERE kt<>'X' and noperk>'40000' ");
                list($tawal,$tmutasi,$takhir) = mysqli_fetch_array($sql2);
                    $shu_antar=$takhir-$tawal;
                ?>            
                <tr>
                    <td colspan="3" style="font-weight: bold;text-align: center;background-color: #00FFFF;">Kenaikan (Penurunan) Aset Bersih </td>                   
                    <td align='right' style="font-weight: bold;background-color: #00FFFF;"><?php echo "" . number_format("$takhir", 0, ",", "."); ?></td>
                    <td align='right' style="font-weight: bold;background-color: #00FFFF;"><?php echo "" . number_format("$tawal", 0, ",", "."); ?></td>
                    <td align='right' style="font-weight: bold;background-color: #00FFFF;"><?php echo "" . number_format("$shu_antar", 0, ",", "."); ?></td>
                </tr>                                 
          </tbody>                				




							
        </table>
            <br />
            <div>
                <?php echo $kota ; ?>, <?php echo $tgl_indo ; ?>
            </div>
            <div>
                <?php
                echo $ttd_2;
                ?>
            </div>
                <p>
                <br />
                <br />
                </p>            
            <div>
                <?php
                echo $nama_ttd_2;
                ?>
            </div>
              </div>
    </h5>
</body>

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