<?php
include_once"config.php";

$city = mysqli_query($con, "select emirate.* from emirate inner join area on emirate.id = area.pid where area.status = 1 group by emirate.name");

?>

<div id="area " style="margin-top:45px">

<h2><em><?= $Area_title; ?></em></h2>

<?php while($c = mysqli_fetch_array($city)){
	$pid = $c['id'];
$area = mysqli_query($con, "select * from area where pid= '$pid' and status = 1 order by name");
	?>

<div class="col-4" style="margin-bottom:40px;">
<h3><?= $c['name'];?> </h3>
<table border="0" cellpadding="7" width="100%" cellspacing="0">
<thead>
<tr>
<td width="80%">Area</td>
<td width="20%">Counts</td>
</tr>
</thead>
<tbody>
<?php while( $a = mysqli_fetch_array($area)){?>
<tr>
<td><?= $a['name']; ?></td>
<td><?= number_format($a['value']); ?></td>
</tr>
<?php } ?></tbody>
</table>

</div>
<?php } ?>

</div>