<?php

include "../config/db.php";

$slug = $_GET['village'];

$village = mysqli_fetch_assoc(mysqli_query($conn,"
SELECT *
FROM villages
WHERE slug='$slug'
"));

$village_id = $village['id'];

$about = mysqli_fetch_assoc(mysqli_query($conn,"
SELECT *
FROM village_about
WHERE village_id='$village_id'
"));

?>

<!DOCTYPE html>
<html>

<head>

<title>About <?php echo $village['village_name']; ?></title>

<link rel="stylesheet" href="css/style.css">

</head>

<body>

<div class="container">

<h1>
About <?php echo $village['village_name']; ?>
</h1>

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

<img src="/digital_panchayat/uploads/villages/<?php echo $about['image']; ?>" style="width:100%;max-width:600px;border-radius:6px">

<br><br>

<?php } ?>

<p style="line-height:1.8">

<?php echo nl2br($about['description']); ?>

</p>

</div>

</body>

</html>