<?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'];
            $nama=$a['nama'];
            $alamat=$a['alamat'];
            $rt=$a['rt'];
            $rw=$a['rw'];
    
}
?>

<div class="container">

  <div class="my-2 border-bottom">
    <h2 class="fw-semibold fs-3">Edit Data</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">No. <?php echo $noang ?></span> <br>
            
            <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_data_lain_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_diri'] == ""){ ?>
                      <img src="../gambar/user.png" style="width: 30px;height: auto">  
                    <?php }else{ ?>
                        <a href="#" class="pop">								    
                           <img width="800" height="800" 
                        src="../gambar/diri/<?php echo $i['foto_diri']; ?>" style="width: 100px;height: auto">
                        </a>             
                    <?php } ?>
                    
                  </center>     
                <hr>  

                <div class="form-group mb-2">
                  <input type="hidden" class="form-control" name="tid" value="<?php echo $i['angg_id'] ?>" readonly="readonly">
                </div>

                <div class="form-group row mb-2">
                  <label for="tnama" class="col-sm-4 col-form-label">Nama</label>
                  <div class="col-sm-8">
                    <input type="text" name="tnama" required="required" class="form-control" placeholder="......" value="<?php echo $i['nama']; ?>">
                  </div>
                </div>
                <div class="form-group row mb-2">
                  <label for="talamat" class="col-sm-4 col-form-label">Jalan/Kampung</label>
                  <div class="col-sm-8">
                    <input type="text" name="talamat" required="required" class="form-control" placeholder="......" value="<?php echo $i['alamat']; ?>">
                  </div>
                </div>                
                <div class="form-group row mb-2">
                  <label for="trt" class="col-sm-4 col-form-label">RT</label>
                  <div class="col-sm-8">
                    <input type="text" minlength="2" maxlength = "2" name="trt" required="required" class="form-control" placeholder="......" value="<?php echo $i['rt']; ?>">
                  </div>
                </div> 
                <div class="form-group row mb-2">
                  <label for="trw" class="col-sm-4 col-form-label">RW</label>
                  <div class="col-sm-8">
                    <input type="text" minlength="2" maxlength = "2" name="trw" required="required" class="form-control" placeholder="......" value="<?php echo $i['rw']; ?>">
                  </div>
                </div> 
                <div class="form-group row mb-2">
                  <label for="tkel" class="col-sm-4 col-form-label">Kelurahan</label>
                  <div class="col-sm-8">
                    <input type="text" name="tkel" required="required" class="form-control" placeholder="......" value="<?php echo $i['kel']; ?>">
                  </div>
                </div>                 
                <div class="form-group row mb-2">
                  <label for="tkec" class="col-sm-4 col-form-label">Kecamatan</label>
                  <div class="col-sm-8">
                    <input type="text" name="tkec" required="required" class="form-control" placeholder="......" value="<?php echo $i['kec']; ?>">
                  </div>
                </div>  
                <div class="form-group row mb-2">
                  <label for="tkab" class="col-sm-4 col-form-label">Kota/Kab.</label>
                  <div class="col-sm-8">
                    <input type="text" name="tkab" required="required" class="form-control" placeholder="......" value="<?php echo $i['kab']; ?>">
                  </div>
                </div> 
                <div class="form-group row mb-2">
                  <label for="thp" class="col-sm-4 col-form-label">Nomor HP (WA)</label>
                  <div class="col-sm-8">
                    <input type="text" name="thp" required="required" class="form-control" placeholder="......" value="<?php echo $i['hp']; ?>">
                  </div>
                </div>     
                <div class="form-group row mb-2">
                  <label for="thp" class="col-sm-4 col-form-label"></label>
                  <div class="col-sm-8">
                    
                  </div>
                </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 'foot_ku.php'; ?>
