<?php

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

/* GET VILLAGE SLUG */
$slug = $_GET['village'] ?? '';

if($slug == ''){
    echo "Village not selected";
    exit;
}

/* FETCH VILLAGE */
$query = mysqli_query($conn,"
SELECT * FROM villages WHERE slug='$slug'
");

$village = $query ? mysqli_fetch_assoc($query) : null;

if(!$village){
    echo "Village not found";
    exit;
}

$village_id = $village['id'];

include __DIR__ . "/header.php";
include __DIR__ . "/home.php";
include __DIR__ . "/footer.php";

?>
