<?php
session_start();
include 'header.php';
include 'db.php';

if (!isset($_SESSION['user_id'])) {
    header("Location: login.php");
    exit();
}
?>

<div class="container mt-5">
    <h2 class="mb-4">Manually Enter Secret Code</h2>
    <p>If you don't have a QR code, enter the secret key manually to generate OTPs.</p>

    <form action="save_scanned_qr.php" method="POST" class="mt-3">
        <label for="app_name">Enter App Name:</label>
        <input type="text" id="app_name" name="app_name" required class="form-control mb-2">

        <label for="manual-secret">Secret Key:</label>
        <input type="text" id="manual-secret" name="secret" required class="form-control mb-2">

        <button type="submit" class="btn btn-success">Save Secret</button>
    </form>
</div>

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