
<!DOCTYPE html>
<html>
<head>
  <title>Cetak Transaksi Penerimaan Donasi</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' ;

    $kdc        =$_SESSION['kdc'];
    $kel        =$_SESSION['kelurahan'];
    $tgambar    =$_SESSION['logo_kop'];

    $tgl    =date('Y-m-d') ;
    $bln    = date('m');
    $bulan  =($bln) ;
    $tgl_indo=tgl_indo($tgl);
    
        $tgl_d = $_GET['tgl_dr'];
        $tgl_s = $_GET['tgl_sd'];

        $sql2 = mysqli_query($koneksi, "SELECT kota,keuangan,gambar FROM kdkanca WHERE kd='$kdc'");
        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 Transaksi Penerimaan Donasi</h3>
  </center>
	<table border="0" width="100%" style="border-collapse:collapse;" align="center">
    	<tr class="tableheader">
            <tr class="tr-title">
              <thead>
            <tr>
                <th Style="text-align:center" colspan="6" >Periode Tanggal <?php echo date('d-m-Y', strtotime($tgl_d)); ?> s/d <?php echo date('d-m-Y', strtotime($tgl_s)); ?></th>
            </tr>  
            
            
<tr>
    <th width="5%" class="text-center" style="border-top: 2px solid #000; border-bottom: 2px solid #000; border-right: 4px solid white; background-color: #D3D3D3;">No</th>
    <th width="10%" class="text-center" style="border-top: 2px solid #000; border-bottom: 2px solid #000; border-right: 4px solid white; background-color: #D3D3D3;">Tanggal</th>
    <th width="25%" class="text-center" style="border-top: 2px solid #000; border-bottom: 2px solid #000; border-right: 4px solid white; background-color: #D3D3D3;">Nama</th>
    <th width="25%" class="text-center" style="border-top: 2px solid #000; border-bottom: 2px solid #000; border-right: 4px solid white; background-color: #D3D3D3;">Alamat</th>
    <th width="20%" class="text-center" style="border-top: 2px solid #000; border-bottom: 2px solid #000; border-right: 4px solid white; background-color: #D3D3D3;">Jenis</th>
    <th width="20%" class="text-center" style="border-top: 2px solid #000; border-bottom: 2px solid #000; background-color: #D3D3D3;">Jumlah</th>
</tr>


                  </thead>
          <tbody>
            <?php 
            $no=1;
            $data = mysqli_query($koneksi,"SELECT * FROM anggota_trans WHERE tanggal>='$tgl_d' and tanggal<='$tgl_s' ");
            while($t = mysqli_fetch_array($data)){
                $noang  =$t['angg_no'] ;
                $anggota = mysqli_query($koneksi,"select * from anggota where angg_no='$noang'");
                $a = mysqli_fetch_assoc($anggota);

                        $no_hp      =$a['hp'] ;
                        $foto_diri  =$a['foto_diri'] ;
                        $angg_id    =$a['angg_id'] ;
                        $noang      =$a['angg_no'] ;
                $nawal = mysqli_query($koneksi,"select * from nawal where noperk='$t[kdj]'");
                $n = mysqli_fetch_assoc($nawal);                        
                        
              ?>
              <tr>
                <td style="text-align:center; font-size: 11pt; font-weight:normal;"><?php echo $t['notrans']; ?></td>
                <td style="text-align:center; font-size: 11pt; font-weight:normal;"><?php echo date('d/m/Y', strtotime($t['tanggal'])); ?></td>
                <td style="text-align:left; font-size: 11pt; font-weight:normal;"><?php echo $a['nama']; ?></td>
                <td style="text-align:left; font-size: 11pt; font-weight:normal;"><?php echo $a['alamat']; ?> <?php echo $a['rt']; ?> <?php echo $a['rw']; ?> <?php echo $a['kel']; ?> <?php echo $a['kec']; ?></td>
                <td style="text-align:left; font-size: 11pt; font-weight:normal;"><?php echo $n['perk']; ?></td>
                <td style="text-align:right; font-size: 11pt; font-weight:normal;"><?php echo "" . number_format("$t[masuk]", 0, ",", "."); ?></td>

              </tr>
              <?php 
            }
            ?>
          </tbody>
                        <?php 
                $sql2 = mysqli_query($koneksi, "SELECT sum(masuk) AS tmasuk FROM anggota_trans WHERE tanggal>='$tgl_d' and tanggal<='$tgl_s' ");
                list($tmasuk) = mysqli_fetch_array($sql2);

            	        ?>						
							<tr>
						    	<td colspan="5" style="border-top: 1px solid black; border-bottom: 1px solid black; border-right: 4px solid white; text-align:center;">Total <?php echo $nama ?> </td>																																									
								<td style="border-top: 1px solid black; border-bottom: 1px solid black; text-align:right;"><?php echo "" . number_format("$tmasuk", 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>