<?php $item = $row ?? null; ?>
<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']) ?>" <?= ((int) ($item['conference_id'] ?? ($_GET['conference_id'] ?? 0)) === (int) $c['id']) ? 'selected' : '' ?>>
                    <?= 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"><?= e(trans('badge_role')) ?></label>
        <select name="badge_role" class="form-select rounded-3">
            <?php foreach (['attendee','author','presenter','reviewer','chair','organizer','guest','speaker'] as $r): ?>
                <option value="<?= e($r) ?>" <?= (($item['badge_role'] ?? 'attendee') === $r) ? 'selected' : '' ?>><?= e(trans($r)) ?></option>
            <?php endforeach; ?>
        </select>
    </div>
    <div class="col-md-6"><label class="form-label"><?= e(trans('presenter_name_en')) ?></label><input type="text" name="person_name_en" class="form-control rounded-3" value="<?= e((string) ($item['person_name_en'] ?? '')) ?>" required></div>
    <div class="col-md-6"><label class="form-label"><?= e(trans('presenter_name_ar')) ?></label><input type="text" name="person_name_ar" class="form-control rounded-3" value="<?= e((string) ($item['person_name_ar'] ?? '')) ?>"></div>
    <div class="col-md-6"><label class="form-label"><?= e(trans('title_en')) ?></label><input type="text" name="title_en" class="form-control rounded-3" value="<?= e((string) ($item['title_en'] ?? '')) ?>"></div>
    <div class="col-md-6"><label class="form-label"><?= e(trans('title_ar')) ?></label><input type="text" name="title_ar" class="form-control rounded-3" value="<?= e((string) ($item['title_ar'] ?? '')) ?>"></div>
    <div class="col-md-6"><label class="form-label"><?= e(trans('affiliation_en')) ?></label><input type="text" name="affiliation_en" class="form-control rounded-3" value="<?= e((string) ($item['affiliation_en'] ?? '')) ?>"></div>
    <div class="col-md-6"><label class="form-label"><?= e(trans('affiliation_ar')) ?></label><input type="text" name="affiliation_ar" class="form-control rounded-3" value="<?= e((string) ($item['affiliation_ar'] ?? '')) ?>"></div>
    <div class="col-md-12"><label class="form-label">QR Text</label><input type="text" name="qr_text" class="form-control rounded-3" value="<?= e((string) ($item['qr_text'] ?? '')) ?>"></div>
    <div class="col-md-12">
        <div class="form-check"><input class="form-check-input" type="checkbox" name="is_active" <?= !isset($item) || !empty($item['is_active']) ? 'checked' : '' ?>><label class="form-check-label"><?= e(trans('is_active')) ?></label></div>
    </div>
</div>
