<?php 
include 'header.php';
    $id = $_GET['id'];
?>

<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">Lengkapi MAP Tempat Usaha <?php echo $id ?></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">
            <form action="angg_tempus_map_act.php" method="post" enctype="multipart/form-data">

          <?php 
          $data = mysqli_query($koneksi, "select * from permohonan where m_nomor='$id'");
          while($i = mysqli_fetch_array($data)){
              $noang=$i['m_angg_no'] ;
                $sql1 = mysqli_query($koneksi, "SELECT foto_diri,nama,alamat,angg_id FROM anggota WHERE angg_no='$noang' and hapus<>'HAPUS' ");
                list($foto_diri,$nama,$alamat,$angg_id) = mysqli_fetch_array($sql1);
            ?>
              <center>
                <?php if($foto_diri == ""){ ?>
                  <img src="../gambar/user.png" style="width: 50px;height: auto">
                <?php }else{ ?>
                  <img src="../gambar/diri/<?php echo $foto_diri ?>" style="width: 50px;height: auto">
                <?php } ?>
              </center>
                <hr>  
                
                <div class="form-group mb-2">
                  <label class="form-label">Nama</label>
                  <input type="text" class="form-control" name="nama" value="<?php echo $nama ?>" readonly="readonly">
                  <input type="hidden" class="form-control" name="id" value="<?php echo $id ?>" readonly="readonly">
                </div>

                 <div class="form-group mb-2">
                    <label>Alamat</label>
                    <input type="text" name="alamat" required="required" class="form-control" placeholder="..." value="<?php echo $alamat; ?>" style="width:100%">
                </div>

                            <div class="form-group mb-2">
                              <label>G-map Latitude Tempat Usaha</label>
                              <input type="text" name="u_latitude" required="required" class="form-control" placeholder="......" value="<?php echo $i['u_latitude']; ?>" style="width:100%">
                            </div>  
                            <div class="form-group mb-2">
                              <label>G-map Longitude Tempat Usaha</label>
                              <input type="text" name="u_longitude" required="required" class="form-control" placeholder="......" value="<?php echo $i['u_longitude']; ?>" style="width:100%">
                            </div>                

              
                <div class="form-group mb-2">
                  <input type="submit" class="btn btn-primary" value="Simpan">
                </div>
                <?php
              }

              ?>
              
            </form>
          </div>

        </div>
      </section>
    </div>
  </section>

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