<?php
session_start();

require_once __DIR__ . '/../../includes/helpers.php';
require_once __DIR__ . '/../../includes/layout.php';
require_once __DIR__ . '/../../includes/expense_shell.php';

if (!isset($_SESSION['authenticated'])) {
    redirect(page_url('signin'));
}

render_expense_shell_start('Record Advance | Expense', 'dashboard-page advance-page', 'advances');
?>
<div class="page-surface page-surface--dimmed">
    <section class="trip-modal advance-modal">
        <header class="trip-modal-header">
            <div class="trip-modal-title">
                <i class="fa-solid fa-folder-open" aria-hidden="true"></i>
                <span>Record Advance</span>
            </div>
            <a class="page-close-button" href="<?= e(page_url('dashboard')) ?>" aria-label="Close">
                <i class="fa-solid fa-xmark" aria-hidden="true"></i>
            </a>
        </header>

        <div class="trip-modal-body advance-modal-body">
            <div class="trip-card">
                <label class="advance-field advance-field--required">
                    <span>Amount *</span>
                    <div class="advance-amount-row">
                        <select>
                            <option>INR</option>
                        </select>
                        <input type="text" value="0.00">
                    </div>
                </label>

                <label class="advance-field advance-field--required">
                    <span>Date *</span>
                    <input type="text" value="11/04/2026">
                </label>

                <label class="advance-field">
                    <span>Paid Through</span>
                    <select>
                        <option>Petty Cash</option>
                    </select>
                </label>

                <label class="advance-field">
                    <span>Reference#</span>
                    <input type="text">
                </label>

                <label class="advance-field">
                    <span>Notes</span>
                    <textarea rows="3"></textarea>
                </label>

                <label class="advance-field">
                    <span>Apply to Trip</span>
                    <select>
                        <option>Select</option>
                    </select>
                </label>
            </div>
        </div>

        <footer class="trip-modal-footer advance-modal-footer">
            <a class="trip-primary" href="<?= e(page_url('dashboard')) ?>">Record Advance</a>
            <a class="trip-secondary" href="<?= e(page_url('dashboard')) ?>">Cancel</a>
        </footer>
    </section>
</div>
<?php render_expense_shell_end(); ?>
