<?php
include '../inc/db.php';
include '../inc/1.php';
if ($user['admin']==0){header("Location: /index.php");
exit;}
echo "<div class='t2'>Бан-лист</div>";
$q=mysql_query("SELECT * FROM `ban` ORDER BY `id` DESC");
$b=1;
while ($f=mysql_fetch_assoc($q)){
$p=($b%2);
$ank=mysql_fetch_assoc(mysql_query("SELECT `id`, `name` FROM `user` WHERE `id` = '$f[user]'"));
echo "<div class='p$p'>".im($ank['id'])." <a href='/ank.php?id=$f[user]'>$ank[name]</a><br>".out($f['why'])."</div>";
$b++;
}
include '../inc/foot.php';
?>