<?php

/* ==========================
   SARPANCH LIST
========================== */

$sarpanches = mysqli_query($conn,"
SELECT *
FROM village_sarpanches
WHERE village_id='$village_id'
ORDER BY id DESC
LIMIT 4
");

?>

<div class="sarpanch-list-section">

<h2 class="section-title">
गांव के अब तक के सभी सरपंच
</h2>

<div class="sarpanch-grid">

<?php while($row=mysqli_fetch_assoc($sarpanches)){ ?>

<div class="sarpanch-card">

<?php if($row['image']){ ?>

<img src="/digital_panchayat/uploads/sarpanches/<?php echo $row['image']; ?>">

<?php } ?>

<h4><?php echo $row['name']; ?></h4>

<p><?php echo $row['duration']; ?></p>

</div>

<?php } ?>

</div>

<div class="view-more-wrapper">

<a href="sarpanches.php?village=<?php echo $slug; ?>" class="view-more-btn">
    सभी सरपंच देखें  →
</a>

</div>

</div>