<?php
/**
 * SISPENRA - Reset Password Admin
 * ⚠️  HAPUS FILE INI SETELAH DIGUNAKAN!
 */
require_once 'config/database.php';
require_once 'includes/functions.php';

$newPassword = 'admin123';
$hash = password_hash($newPassword, PASSWORD_DEFAULT);
db_query("UPDATE users SET password = ? WHERE username = 'admin'", [$hash]);
$base = BASE_URL;
?>
<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Reset Password</title>
<style>body{font-family:sans-serif;max-width:500px;margin:60px auto;padding:20px;text-align:center;}
.box{background:#d4edda;border:1px solid #28a745;border-radius:8px;padding:24px;}
code{background:#f0f0f0;padding:4px 10px;border-radius:4px;}
.warn{background:#fff3cd;border:1px solid #ffc107;border-radius:8px;padding:12px;margin-top:16px;font-size:13px;}
</style></head><body>
<div class="box">
  <h2>✅ Password Berhasil Direset!</h2>
  <p>Username: <code>admin</code> | Password: <code><?= $newPassword ?></code></p>
  <a href="<?= $base ?>/index.php" style="background:#1a4a7a;color:#fff;padding:10px 24px;border-radius:8px;text-decoration:none;display:inline-block;margin-top:12px;">→ Login Sekarang</a>
</div>
<div class="warn">⚠️ <strong>HAPUS</strong> file <code>reset_password.php</code> dari server setelah login!</div>
</body></html>
