<?php 
include 'header.php';
$id = $_GET['tid'];              
          $data = mysqli_query($koneksi, "select * from anggota where angg_id='$id'");
            while($a = mysqli_fetch_array($data)){
            $noang=$a['angg_no'];
            
                $sql3 = mysqli_query($koneksi, "SELECT kode AS tkode FROM kode_unik WHERE id='$id'");
                list($tkode) = mysqli_fetch_array($sql3);     
}
?>

<div class="container">

  <div class="my-4 border-bottom">
    <h1 class="fw-semibold fs-3"></h1>
  </div>

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

        <?php 
        if(isset($_GET['alert'])){
          if($_GET['alert'] == "sukses"){
            echo "<div class='alert alert-success'>Password berhasil diganti!</div>";
          }
        }
        ?>
     
        <div class="card card-info">
          <div class="card-header justify-content-between d-flex">
            <span class="card-title fw-semibold">Reset Pasword 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_ganti_password_act.php" method="post">
              <div class="form-group mb-2">
                <input type="hidden" class="form-control" name="tid" value="<?php echo $id ?>" readonly="readonly">  
                <label class="form-label">Password ini menggunakan Kode Unik : <?php echo $tkode ?> - jangan diganti, langsung klik SIMPAN saja </label>
                <input type="password" class="form-control" name="password" value="<?php echo $tkode ?>" readonly="readonly" min="5">
              </div>
              <div class="form-group mb-2">
                <input type="submit" class="btn btn-primary" value="Simpan">
                
              </div>
            </form>
          </div>

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

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