<?php

include "../config/db.php";
include "common.php";   // ✅ VERY IMPORTANT
include "header.php";

/* ==========================
   GET ID
========================== */
$id = intval($_GET['id'] ?? 0);

/* ==========================
   FETCH DATA (LIKE SARPANCH)
========================== */
$q = mysqli_query($conn,"
SELECT *
FROM special_thanks
WHERE id='$id'
AND village_id='$village_id'
");

$data = mysqli_fetch_assoc($q);

?>

<div class="container">

<?php if($data){ ?>

<div class="sarpanch-box">

    <!-- IMAGE -->
    <div class="sarpanch-image">

        <?php if(!empty($data['image'])){ ?>
        <img src="/digital_panchayat/uploads/special_thanks/<?php echo $data['image']; ?>">
        <?php } ?>

    </div>

    <!-- TEXT -->
    <div class="sarpanch-text">

        <h2><?php echo htmlspecialchars($data['name']); ?></h2>

        <p style="color:#777;">
            <?php echo htmlspecialchars($data['designation']); ?>
        </p>

        <div style="margin-top:15px; line-height:1.8;">
            <?php echo nl2br($data['description']); ?>
        </div>

        <br>

        <a href="index.php" class="view-btn">
            ← वापस जाएं
        </a>

    </div>

</div>

<?php } else { ?>

<p>जानकारी उपलब्ध नहीं है</p>

<?php } ?>

</div>

<?php include "footer.php"; ?>