<div class="row justify-content-center">
    <div class="col-lg-8">
        <div class="card shadow-sm">
            <div class="card-body">
                <h4 class="card-title">Advance Salary Application</h4>
                <?php if (!empty($message)): ?>
                    <div class="alert alert-success"><?= htmlspecialchars($message) ?></div>
                <?php endif; ?>
                <?php if (!empty($error)): ?>
                    <div class="alert alert-danger"><?= htmlspecialchars($error) ?></div>
                <?php endif; ?>
                <form method="post" action="index.php?route=advance/store">
                    <?= $csrf ?>
                    <div class="row g-3">
                        <div class="col-md-6">
                            <label class="form-label">Nama</label>
                            <input type="text" class="form-control" value="<?= htmlspecialchars($user['name'] ?? '') ?>" readonly>
                        </div>
                        <div class="col-md-6">
                            <label class="form-label">Jumlah Advance Salary (RM)</label>
                            <input type="number" step="0.01" name="jumlah" class="form-control" required>
                        </div>
                        <div class="col-12">
                            <label class="form-label">Tujuan</label>
                            <textarea name="tujuan" class="form-control" rows="3" required></textarea>
                        </div>
                        <div class="col-12 form-check">
                            <input class="form-check-input" type="checkbox" value="1" id="setuju" name="kenyataan_setuju">
                            <label class="form-check-label" for="setuju">
                                Saya mengesahkan maklumat ini benar.
                            </label>
                        </div>
                    </div>
                    <div class="mt-3 d-flex gap-2">
                        <button class="btn btn-primary">Submit</button>
                        <a class="btn btn-outline-secondary" href="index.php?route=dashboard">Back</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

