<?php
include '../config.php';
$token = $_GET['token'];
$cek = mysqli_query($conn, "SELECT * FROM pengguna WHERE reset_token='$token'");
if (mysqli_num_rows($cek) == 0) {
  die("Token tidak valid.");
}
?>

<!DOCTYPE html>
<html>
<head>
  <title>Reset Password</title>
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="bg-light">
<div class="container mt-5">
  <div class="row justify-content-center">
    <div class="col-md-6">
      <div class="card">
        <div class="card-body">
          <h4 class="card-title">Reset Password</h4>
          <form action="../proses/proses_reset_password.php" method="POST">
            <input type="hidden" name="token" value="<?= htmlspecialchars($token) ?>">
            <div class="mb-3">
              <label>Password Baru</label>
              <input type="password" name="password" class="form-control" required>
            </div>
            <button class="btn btn-success">Simpan Password Baru</button>
          </form>
        </div>
      </div>
    </div>
  </div>
</div>
</body>
</html>
