<?php
require_once("auth.php");
require_once("../api/config/db.php");

$q = $conn->query("
SELECT name,mobile,father_name 
FROM users 
WHERE village_id='$village_id' 
AND role='sub_admin' 
AND status='approved'
ORDER BY id DESC
");
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Approved Sub Admins</title>

<style>
body{margin:0;font-family:Arial;background:#f1f5f9}
.app{max-width:520px;margin:0 auto}
.header{background:#16a34a;color:white;padding:20px;border-radius:0 0 25px 25px}
.card{background:white;margin:14px;padding:14px;border-radius:18px}
</style>
</head>

<body>
<div class="app">

<div class="header">
<h2>Approved Sub Admins</h2>
</div>

<?php while($row = $q->fetch_assoc()): ?>
<div class="card">
<b><?= $row['name'] ?></b><br>
<?= $row['mobile'] ?><br>
<?= $row['father_name'] ?>
</div>
<?php endwhile; ?>

</div>
</body>
</html>