



<!DOCTYPE html>
<html>
<head>
  <title>Cetak Pengurus & Pengawas</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);
    
        $tgl_s =date('Y-m-d');            
        $oleh=$_SESSION['id'];
        $kdc=$_SESSION['kdc'];
        
        $kanca = mysqli_query($koneksi,"select * from kdkanca where kd='$kdc'");
        $c = mysqli_fetch_assoc($kanca);  
        $tgl_dr=$c['tgl_dr']; 
        $tgl_sd=$c['tgl_sd'];
    
            //////////////////////////////////////////////////////////////////////////// 
        $sql2 = mysqli_query($koneksi, "SELECT kota,ttd_3,nama_ttd_3,gambar FROM kdkanca WHERE kd='$kdc'");
        list($kota,$ttd_3,$nama_ttd_3,$gambar) = mysqli_fetch_array($sql2);
        $jabatan=$ttd_3;
    ?>  
<!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>
	

	<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="4" >DAFTAR PENGURUS & PENGAWAS</th>
            </tr>  
            <tr>
                <th Style="text-align:center" colspan="4" >Periode Tanggal <?php echo date('d-m-Y', strtotime($tgl_dr)); ?> s/d <?php echo date('d-m-Y', strtotime($tgl_sd)); ?></th>
            </tr>  
            
            
  <tr>
    <th width="5%" class="text-center" style="border-top: 2px solid #000; border-bottom: 2px solid #000;" bgcolor="#D3D3D3">No</th>
    <th width="25%" class="text-center" style="border-top: 2px solid #000; border-bottom: 2px solid #000;" bgcolor="#D3D3D3">NAMA</th>
    <th width="50%" class="text-center" style="border-top: 2px solid #000; border-bottom: 2px solid #000;" bgcolor="#D3D3D3">ALAMAT</th>
    <th width="20%" class="text-center" style="border-top: 2px solid #000; border-bottom: 2px solid #000;" bgcolor="#D3D3D3">JABATAN</th>
  </tr>


                  </thead>
          <tbody>

  <tr>
    <td colspan="4" align='left'>A. PENGURUS</td>
  </tr>
            
            <?php 
            $no=1;
            $data = mysqli_query($koneksi,"SELECT * FROM karyawan WHERE hapus<>'HAPUS' and ket='PP' and jabatan<'10' ORDER BY jabatan ASC");
            while($d = mysqli_fetch_array($data)){
                $id=$d['id'];
                
                $gapok = mysqli_query($koneksi,"select * from karyawan_gapok where id='$id'");
                $g = mysqli_fetch_assoc($gapok);
                
                $iden = mysqli_query($koneksi,"select * from karyawan_iden where id='$id'");
                $i = mysqli_fetch_assoc($iden);
                
                $angg = mysqli_query($koneksi,"select * from anggota where angg_no='$d[angg_no]'");
                $a = mysqli_fetch_assoc($angg);  
                    $foto_diri=$a['foto_diri'];
                $jbt = mysqli_query($koneksi,"select * from kdpengurus where kd='$d[jabatan]'");
                $j = mysqli_fetch_assoc($jbt);                  
              ?>
              <tr>
               <td><?php echo $no++; ?></td>
                <td><?php echo $a['nama']; ?></td>
                <td align='left'><?php echo $a['alamat']; ?>, RT <?php echo $a['rt']; ?>, RW <?php echo $a['rw']; ?>, Kel. <?php echo $c['kelurahan']; ?>, Kec. <?php echo $c['kecamatan']; ?>, <?php echo $c['kota']; ?></td>
                <td align='left'><?php echo $j['nama']; ?></td>
              </tr>
              <?php 
            }
            ?>
            

  <tr>
    <td colspan="4" align='left'></td>
  </tr>
  <tr>
    <td colspan="4" align='left'></td>
  </tr>  
  <tr>
    <td colspan="4" align='left'>B. PENGAWAS</td>
  </tr>
            
            <?php 
            $no=1;
            $data = mysqli_query($koneksi,"SELECT * FROM karyawan WHERE hapus<>'HAPUS' and ket='PP' and jabatan>='10' ORDER BY jabatan ASC");
            while($d = mysqli_fetch_array($data)){
                $id=$d['id'];
                
                $gapok = mysqli_query($koneksi,"select * from karyawan_gapok where id='$id'");
                $g = mysqli_fetch_assoc($gapok);
                
                $iden = mysqli_query($koneksi,"select * from karyawan_iden where id='$id'");
                $i = mysqli_fetch_assoc($iden);
                
                $angg = mysqli_query($koneksi,"select * from anggota where angg_no='$d[angg_no]'");
                $a = mysqli_fetch_assoc($angg);  
                    $foto_diri=$a['foto_diri'];
                $jbt = mysqli_query($koneksi,"select * from kdpengurus where kd='$d[jabatan]'");
                $j = mysqli_fetch_assoc($jbt);                  
              ?>
              <tr>
               <td><?php echo $no++; ?></td>
                <td><?php echo $a['nama']; ?></td>
                <td align='left'><?php echo $a['alamat']; ?>, RT <?php echo $a['rt']; ?>, RW <?php echo $a['rw']; ?>, Kel. <?php echo $c['kelurahan']; ?>, Kec. <?php echo $c['kecamatan']; ?>, <?php echo $c['kota']; ?></td>
                <td align='left'><?php echo $j['nama']; ?></td>
              </tr>
              <?php 
            }
            ?>            
  <tr>
    <td colspan="4" style="border-bottom: 1px solid #000;"></td>
  </tr>
            
          </tbody>
          
        </table>
        
            <br />
            <div>
                <?php echo $kota ; ?>, <?php echo $tgl_indo ; ?>
            </div>
            <div>
                <?php
                echo $ttd_3;
                ?>
            </div>
                <p>
                <br />
                <br />
                </p>            
            <div>
                <?php
                echo $nama_ttd_3;
                ?>
            </div>
            
              </div>

    </h5>

</body>

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