<?php require __DIR__ . '/../../layouts/header.php'; ?>
<div class="d-flex justify-content-between align-items-center mb-4">
    <h1 class="page-title"><?= e(trans('payment_invoices')) ?></h1>
    <a href="<?= e(base_path('admin/payments')) ?>" class="btn ec-btn btn-outline-secondary rounded-3"><?= e(trans('back')) ?></a>
</div>

<div class="ec-card  "><div class="ec-card-body p-4">
<form method="post" action="<?= e(base_path('admin/payments/create')) ?>">
<input type="hidden" name="_csrf" value="<?= e(csrf_token()) ?>">
<div class="row g-3">
    <div class="col-md-6">
        <label class="form-label ec-required"><?= e(trans('conference')) ?></label>
        <select name="conference_id" class="form-select rounded-3" required>
            <?php foreach ($conferences as $c): ?>
                <option value="<?= e((string) $c['id']) ?>"><?= e(current_lang() === 'ar' ? (string) ($c['title_ar'] ?? '') : (string) ($c['title_en'] ?? '')) ?></option>
            <?php endforeach; ?>
        </select>
    </div>
    <div class="col-md-6">
        <label class="form-label ec-required"><?= e(trans('submissions')) ?></label>
        <select name="submission_id" class="form-select rounded-3">
            <option value="0">--</option>
            <?php foreach ($submissions as $s): ?>
                <option value="<?= e((string) $s['id']) ?>"><?= e((string) ($s['submission_no'] ?? '')) ?> — <?= e((string) ($s['title'] ?? '')) ?></option>
            <?php endforeach; ?>
        </select>
    </div>
    <div class="col-md-4"><label class="form-label ec-required"><?= e(trans('amount')) ?></label><input type="number" step="0.01" name="amount" class="form-control rounded-3" required></div>
    <div class="col-md-4"><label class="form-label"><?= e(trans('currency')) ?></label><input type="text" name="currency" class="form-control rounded-3" value="JOD"></div>
    <div class="col-md-4"><label class="form-label"><?= e(trans('invoice_type')) ?></label><select name="invoice_type" class="form-select rounded-3"><option value="registration">registration</option><option value="publication">publication</option><option value="attendance">attendance</option><option value="other">other</option></select></div>
    <div class="col-md-12"><label class="form-label"><?= e(trans('rating_notes')) ?></label><textarea name="notes" class="form-control rounded-3" rows="4"></textarea></div>
</div>
<div class="mt-4"><button class="btn ec-btn btn-success rounded-3"><?= e(trans('save')) ?></button></div>
</form>
</div></div>
<?php require __DIR__ . '/../../layouts/footer.php'; ?>
