<?php
//---[CZ]: ověříme přístup
if ($login->check_access("bans")==1):

//---[CZ]: načteme potřebné třídy
include CLASSES_PATH."Bans.php";

//---[CZ]: vytvoříme instance
$bans=new Bans();

//---[CZ]: nový ban
if ($_GET["action"]=="add") { $bans->add(); }

//---[CZ]: smazání banu
if ($_GET["action"]=="remove") { $bans->delete(); }
?>

<h2><?php echo LANG_BANS; ?></h2>

<h3><?php echo LANG_ADD_BAN; ?></h3>

<form action="./admin.php?function=bans&amp;action=add" method="post">

<div>

<p><strong><?php echo LANG_IP_ADDRESS; ?>:</strong><br /><input type="text" name="ip" style="width: 150px;"<?php if (isset($_POST["submit"]) AND $_POST["ip"]=="") { echo " class=\"input-error\""; } ?> /></p>

<p><input type="submit" name="submit" class="greenbutton" value="<?php echo LANG_ADD; ?>" /></p>

</div>

</form>

<table>
<tr>
<th class="table-title" colspan="2"><?php echo LANG_BANS; ?></th>
</tr>
<tr>
<th><?php echo LANG_IP_ADDRESS; ?></th>
<th style="width: 15%;"><?php echo LANG_OPTIONS; ?></th>
</tr>
<?php
$bans->output();
?>
</table>

<?php else: $access_denied=1; endif; ?>