<?php $title = 'Hero Slides'; ?>

<div class="container-fluid py-4">

<div class="d-flex justify-content-between align-items-center mb-4">

<h1 class="fw-bold">

Hero Slides

</h1>

<a
href="/easychair/admin/hero-slides/create"
class="btn btn-dark rounded-pill">

<i class="fa fa-plus"></i>

Add Slide

</a>

</div>

<?php if(empty($slides)): ?>

<div class="alert alert-warning rounded-4">

No hero slides found.

</div>

<?php endif; ?>

<div class="row g-4">

<?php foreach($slides as $s): ?>

<div class="col-lg-4">

<div class="card border-0 shadow-lg rounded-4 overflow-hidden h-100">

<?php if(!empty($s['image_path'])): ?>

<img
src="/easychair/public/<?= htmlspecialchars($s['image_path']) ?>"
style="
height:220px;
width:100%;
object-fit:cover;
">

<?php endif; ?>

<div class="card-body p-4">

<h4 class="fw-bold mb-2">

<?= htmlspecialchars($s['title_en'] ?? '') ?>

</h4>

<div class="text-muted mb-3">

<?= htmlspecialchars($s['title_ar'] ?? '') ?>

</div>

<div class="small text-muted mb-3">

<?= htmlspecialchars($s['button_url'] ?? '') ?>

</div>

<div class="d-flex gap-2 flex-wrap">

<a
href="/easychair/admin/hero-slides/delete?id=<?= (int)$s['id'] ?>"
class="btn btn-outline-danger rounded-pill">

Delete

</a>

</div>

</div>

</div>

</div>

<?php endforeach; ?>

</div>

</div>
