<?php require __DIR__ . '/../../layouts/header.php'; ?>
<div class="d-flex justify-content-between align-items-center mb-4">
<h1 class="page-title"><?= e(trans('session_items')) ?></h1>
<div class="d-flex gap-2">
<a href="<?= e(base_path('admin')) ?>" class="btn ec-btn btn-outline-secondary rounded-3"><?= e(trans('back')) ?></a>
<?php if ($conference): ?><a href="<?= e(base_path('admin/session-items/create?conference_id=' . (int) $conference['id'])) ?>" class="btn ec-btn btn-success rounded-3"><?= e(trans('create')) ?></a><?php endif; ?>
</div>
</div>
<div class="ec-card   mb-4"><div class="ec-card-body">
<form method="get" action="<?= e(base_path('admin/session-items')) ?>" class="row g-3">
<div class="col-md-6"><label class="form-label"><?= e(trans('conference')) ?></label><select name="conference_id" class="form-select rounded-3"><?php foreach ($conferences as $c): ?><option value="<?= e((string) $c['id']) ?>" <?= ($conference && (int) $conference['id'] === (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-2 d-flex align-items-end"><button class="btn ec-btn btn-primary rounded-3 w-100"><?= e(trans('search')) ?></button></div>
</form></div></div>
<?php if ($conference): ?>
<div class="ec-card  "><div class="table-responsive"><table class="table ec-table align-middle mb-0">
<thead><tr><th>#</th><th><?= e(trans('sessions')) ?></th><th><?= e(trans('title_en')) ?></th><th><?= e(trans('presenter_name_en')) ?></th><th><?= e(trans('actions')) ?></th></tr></thead>
<tbody><?php foreach ($rows as $row): ?><tr><td><?= e((string) $row['id']) ?></td><td><?= e(current_lang() === 'ar' ? (string) ($row['session_title_ar'] ?: $row['session_title_en']) : (string) $row['session_title_en']) ?></td><td><?= e(current_lang() === 'ar' ? (string) ($row['title_ar'] ?: $row['title_en']) : (string) $row['title_en']) ?></td><td><?= e(current_lang() === 'ar' ? (string) ($row['presenter_name_ar'] ?: $row['presenter_name_en']) : (string) $row['presenter_name_en']) ?></td><td><a href="<?= e(base_path('admin/session-items/edit?id=' . (int) $row['id'])) ?>" class="btn ec-btn btn-sm btn-outline-primary rounded-3"><?= e(trans('edit')) ?></a></td></tr><?php endforeach; ?></tbody>
</table></div></div>
<?php endif; ?>
<?php require __DIR__ . '/../../layouts/footer.php'; ?>
