<?= $this->extend('layouts/admin') ?>

<?= $this->section('content') ?>

<section>
    <h1>Login Admin</h1>

    <?php if (isset($error) && $error): ?>
        <div>
            <p><?= esc($error) ?></p>
        </div>
    <?php endif; ?>

    <?php if (isset($login_success) && $login_success): ?>
        <div>
            <p><?= esc($login_success) ?></p>
        </div>
    <?php endif; ?>

    <form method="post">
        <div>
            <label for="username">Username:</label>
            <input type="text" id="username" name="username" value="<?= esc($old_username ?? '') ?>" required>
        </div>

        <div>
            <label for="password">Password:</label>
            <input type="password" id="password" name="password" required>
        </div>

        <button type="submit">Login</button>
    </form>
</section>

<?= $this->endSection() ?>
