
<?php 
include 'header.php';
    $id = $_GET['id'];
    $kdc= $_SESSION['kdc'];
    $kel= $_SESSION['kelurahan'];
    
    $sql2 = mysqli_query($koneksi, "SELECT nama,alamat,angg_no FROM anggota where angg_id='$id'");
        list($nama,$alamat,$angg_no) = mysqli_fetch_array($sql2);      
?>

<div class="container">

  <div class="my-2 border-bottom">
    <h2 class="fw-semibold fs-3">Foto Anggota <?php echo $kel ?> No. <?php echo $angg_no ?></h2>
  </div>
<div style="background-color: <?php echo$_SESSION['warna_bag']; ?>; padding: 15px; border-radius: 15px; box-shadow: 0 0 15px <?php echo$_SESSION['warna_bag']; ?>;">
  <section class="content">
    <div class="row justify-content-center">
      <div class="col-lg-3">    
        <div class="card card-info">
          <div class="card-header justify-content-between d-flex">
            <span class="card-title fw-semibold">Foto Pribadi</span>
          </div>
          <div class="card-body">
            <?php 
            $id = $_GET['id'];              
            $data = mysqli_query($koneksi, "select * from anggota where angg_id='$id'");
            while($d = mysqli_fetch_array($data)){

              ?>
              <div class="form-group mb-2">
                <label class="form-label">Nama</label>
                <input type="text" class="form-control" name="nama" value="<?php echo $d['nama'] ?>" disabled>
              </div>
              <div class="form-group mb-2">
                <label class="form-label">Foto Pribadi</label>
              </div>
                <div class="form-group mb-2">
                  <center>
                    <?php if($d['foto_diri'] == ""){ ?>
                      <img src="../gambar/user.png" style="width: 30px;height: auto">  
                    <?php }else{ ?>
                        <a href="#" class="pop">								    
                           <img width="80" height="80" 
                        src="../gambar/diri/<?php echo $d['foto_diri'] ?>" style="width: 80px;height: auto">
                        </a>             
                    <?php } ?>
                  </center>
                </div>    
              <div class="form-group mb-2">
                  <?php if($_SESSION[level]<>'TOP'){ ?>
                     <center>
                        <a href="angg_foto_diri.php?id=<?php echo $id ?>" class="btn btn-success btn-sm"><i class="bi bi-arrows-fullscreen"></i> &nbsp Lihat / Ganti / Isi Foto</a> 
                     </center>
                  <?php } ?>
              </div>                    
                
              <?php
            }
            ?>
          </div>
        </div>
         <label class="form-label"><i><font color='#ff0000'>Klik gambar untuk melihat lebih besar</font></i></label>
      </div>
              
               
              
      
      
      <div class="col-lg-3">
       <div class="card card-info">
          <div class="card-header justify-content-between d-flex">
            <span class="card-title fw-semibold">Foto KTP</span>
<!--            <a href="b_karyawan_top.php" class="btn btn-success btn-sm pull-right"><i class="bi bi-printer"></i> &nbsp; Cetak Slip</a>   -->
          </div>
        <div class="card-body">
            <?php 
            $id = $_GET['id'];              
            $data = mysqli_query($koneksi, "select * from anggota where angg_id='$id'");
            while($d = mysqli_fetch_array($data)){

              ?>
              <div class="form-group mb-2">
                <label class="form-label">Nomor KTP</label>
                <input type="text" class="form-control" name="ktp" value="<?php echo $d['ktp']; ?>" disabled>
              </div>  
              <div class="form-group mb-2">
                <label class="form-label">Foto KTP</label>
              </div>
                <div class="form-group mb-2">
                  <center>
                    <?php if($d['foto_ktp'] == ""){ ?>
                      <img src="../gambar/user.png" style="width: 30px;height: auto">  
                    <?php }else{ ?>
                        <a href="#" class="pop">								    
                           <img width="80" height="80" 
                        src="../gambar/ktp/<?php echo $d['foto_ktp']; ?>" style="width: 80px;height: auto">
                        </a>             
                    <?php } ?>
                  </center>                    
                </div>    
              <div class="form-group mb-2">
                  <center>
                      <?php if($_SESSION[level]<>'TOP'){ ?>
                        <a href="angg_foto_ktp.php?id=<?php echo $id ?>" class="btn btn-primary btn-sm"><i class="bi bi-arrows-fullscreen"></i> &nbsp Lihat / Ganti / Isi Foto</a> 
                      <?php } ?>    
                  </center>
              </div>                    
                
              <?php
            }
            ?>
          </div>
        </div>
      </div>
      
      
      
      <div class="col-lg-3">
       <div class="card card-info">
          <div class="card-header justify-content-between d-flex">
            <span class="card-title fw-semibold">Foto KK</span>
<!--            <a href="b_karyawan_top.php" class="btn btn-success btn-sm pull-right"><i class="bi bi-printer"></i> &nbsp; Cetak Slip</a>   -->
          </div>
        <div class="card-body">
            <?php 
            $id = $_GET['id'];              
            $data = mysqli_query($koneksi, "select * from anggota where angg_id='$id'");
            while($d = mysqli_fetch_array($data)){

              ?>
              <div class="form-group mb-2">
                <label class="form-label">Nomor KK</label>
                <input type="text" class="form-control" name="kk" value="<?php echo $d['kk']; ?>" disabled>
              </div>  
              <div class="form-group mb-2">
                <label class="form-label">Foto KK</label>
              </div>
                <div class="form-group mb-2">
                  <center>
                    <?php if($d['foto_kk'] == ""){ ?>
                      <img src="../gambar/user.png" style="width: 30px;height: auto">  
                    <?php }else{ ?>
                        <a href="#" class="pop">								    
                           <img width="80" height="80" 
                        src="../gambar/kk/<?php echo $d['foto_kk']; ?>" style="width: 80px;height: auto">
                        </a>             
                    <?php } ?>
                  </center>                      
                </div>    
              <div class="form-group mb-2">
                  <center>
                      <?php if($_SESSION[level]<>'TOP'){ ?>
                        <a href="angg_foto_kk.php?id=<?php echo $id ?>" class="btn btn-warning btn-sm"><i class="bi bi-arrows-fullscreen"></i> &nbsp Lihat / Ganti / Isi Foto</a> 
                      <?php } ?>    
                  </center>
              </div>                    
                
              <?php
            }
            ?>
          </div>
        </div>
      </div>
      
      
      
      <div class="col-lg-3">
       <div class="card card-info">

        <div class="card-header justify-content-between d-flex">
          <span class="card-title fw-semibold">Foto Rumah</span>
          <a href="javascript:history.go(-1)" class="btn btn-primary btn-sm pull-right"><i class="bi bi-reply"></i> &nbsp; Kembali</a> 
        </div>

        <div class="card-body">
            <?php 
            $id = $_GET['id'];              
            $data = mysqli_query($koneksi, "select * from anggota where angg_id='$id'");
            while($d = mysqli_fetch_array($data)){

              ?>
                <div class="form-group mb-2">
                  <center>
                    <?php if($d['foto_rumah'] == ""){ ?>
                      <img src="../gambar/user.png" style="width: 30px;height: auto">  
                    <?php }else{ ?>
                        <a href="#" class="pop">								    
                           <img width="80" height="80" 
                        src="../gambar/rumah/<?php echo $d['foto_rumah']; ?>" style="width: 80px;height: auto">
                        </a>             
                    <?php } ?>
                  </center>                      
                </div>    
              <div class="form-group mb-2">
                  <center>
                      <?php if($_SESSION[level]<>'TOP'){ ?>
                        <a href="angg_foto_rumah.php?id=<?php echo $id ?>" class="btn btn-secondary btn-sm"><i class="bi bi-arrows-fullscreen"></i> &nbsp Lihat / Ganti / Isi Foto</a> 
                      <?php } ?>
                  </center>
              </div>                    
                

            <label class="fw-bold">Lokasi Alamat </label>
            <div class="form-group mb-2">
              <label class="form-label">Kode Latitude</label>
              <input type="text" class="form-control" name="latitude" value="<?php echo $d['a_latitude'] ?>" disabled>
            </div>
            <div class="form-group mb-2">
              <label class="form-label">Kode Longitude</label>
              <input type="text" class="form-control" name="longitude" value="<?php echo $d['a_longitude'] ?>" disabled>
            </div>

            <hr>      


            <?php if($d['a_latitude'] == "" && $d['a_longitude'] == ""){ ?>
              <div class="alert alert-danger">Lokasi g-map belum diisi.</div>
              <div class="form-group mb-2">
                  <center>
                      <a href="angg_isi_map.php?id=<?php echo $id ?>" class="btn btn-info btn-sm"><i class="bi bi-geo-alt"></i> &nbsp Isi Kode MAP</a> 
                  </center>
              </div>                   
            <?php }else{ ?>
            <center>
                <div class="form-group mb-2">
                    <a href="https://www.google.com/search?q=google+map+<?php echo $d['a_latitude'] ?>%2C+<?php echo $d['a_longitude'] ?>" target="_blank" class="btn btn-warning btn-sm pull-right"><i class="bi bi-shop"></i> &nbsp; ke Detail Google Map lokasi</a>
                </div>                
                <div class="form-group mb-2">
                    <?php if($_SESSION[level]<>'TOP'){ ?>
                      <a href="angg_isi_map.php?id=<?php echo $id ?>" class="btn btn-danger btn-sm"><i class="bi bi-geo-alt"></i> &nbsp Isi / Ganti Kode MAP</a> 
                    <?php } ?>
                </div>      
            </center>
<!--              
              <div class="alert alert-primary mb-2">Jarak dari rumah ke kantor : <span class="fw-bold jarak"></span></div>
              <div id="map" latitude="<?php echo $d['a_latitude'] ?>" longitude="<?php echo $d['a_longitude'] ?>" style="width:100%; height:300px"></div>
-->
            <?php } ?>

          <?php } ?>
        </div>
      </div>
      </div>
    </div>
  </section>
</div>

<?php include 'foot_ku.php'; ?>

