<?php 
include 'header.php';
$id = $_GET['id'];              
          $data = mysqli_query($koneksi, "select * from anggota where angg_id='$id'");
while($a = mysqli_fetch_array($data)){
    $noang=$a['angg_no'];
    
}
?>

<div class="container">

  <div class="my-2 border-bottom">
    <h2 class="fw-semibold fs-3"></h2>
  </div>

  <section class="content">
    <div class="row justify-content-center">
      <section class="col-lg-5">       
        <div class="card card-info">

          <div class="card-header justify-content-between d-flex">
            <span class="card-title fw-semibold">Lokasi MAP Rumah Anggota No : <?php echo $noang ?></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">
<div style="background-color: <?php echo$_SESSION['warna_bag']; ?>; padding: 15px; border-radius: 15px; box-shadow: 0 0 15px <?php echo$_SESSION['warna_bag']; ?>;">
            <form action="angg_isi_map_act.php" method="post" enctype="multipart/form-data">

          <?php 
          $id = $_GET['id'];              
          $data = mysqli_query($koneksi, "select * from anggota where angg_id='$id'");
          while($i = mysqli_fetch_array($data)){
            ?>
                   <center>
                    <?php if($i['foto_rumah'] == ""){ ?>
                      <img src="../gambar/user.png" style="width: 30px;height: auto">  
                    <?php }else{ ?>
                        <a href="#" class="pop">								    
                           <img width="800" height="800" 
                        src="../gambar/rumah/<?php echo $i['foto_rumah']; ?>" style="width: 100px;height: auto">
                        </a>             
                    <?php } ?>
                    
                  </center>     
                <hr>  
                <div class="form-group mb-2">
                  <label class="form-label">Cara Isi : Kirimkan LOKASI MAP dari rumah domisili Anda ke WA Anda, terus buka LOKASI MAP yg terkirim ke WA Anda, 
                  kemudian ambil angka yg ada tanda Minus sampai dengan tanda koma masukkan angka tersebut sebagai kode LATITUDE dan angka setelah 
                  koma sebagai kode LONGITUDE.
                  </label>
                </div>
                
                <div class="form-group mb-2">
                  
                  <input type="hidden" class="form-control" name="nama" value="<?php echo $i['nama'] ?>" readonly="readonly">
                  <input type="hidden" class="form-control" name="id" value="<?php echo $i['angg_id'] ?>" readonly="readonly">
                </div>

                 <div class="form-group mb-2">
                    <input type="hidden" name="alamat" required="required" class="form-control" placeholder="..." value="<?php echo $i['alamat']; ?>" style="width:100%">
                </div>

                            <div class="form-group mb-2">
                              <label>G-map Latitude (Contoh : -7.010810)</label>
                              <input type="text" name="a_latitude" required="required" class="form-control" placeholder="......" value="<?php echo $i['a_latitude']; ?>" style="width:100%">
                            </div>  
                            <div class="form-group mb-2">
                              <label>G-map Longitude (Contoh : 110.301890)</label>
                              <input type="text" name="a_longitude" required="required" class="form-control" placeholder="......" value="<?php echo $i['a_longitude']; ?>" style="width:100%">
                            </div>                

              
                <div class="form-group mb-2">
                  <input type="submit" class="btn btn-primary" value="Simpan">
                </div>
                
                <div class="form-group mb-2">
                    <a href="https://www.google.com/search?q=google+map+<?php echo $i['a_latitude'] ?>%2C+<?php echo $i['a_longitude'] ?>" target="_blank" class="btn btn-warning btn-sm pull-right"><i class="bi bi-shop"></i> &nbsp; Cek Lokasi Map sebagaimana data yg tertampil.</a>
                </div>                
            <?php
              }
            ?>
            </form>
          </div>
        </div>
      </section>
    </div>
  </section>

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