<?php
include "common.php";
head();
?>
                <!--/span-->
                <div class="span9" id="content">

                    <div class="row-fluid">
                        <!-- block -->
                        <div class="block">
                            <div class="navbar navbar-inner block-header">
                                <div class="muted pull-left">Search for bans</div>
                            </div>
                            <div class="block-content collapse in">
                                <div class="span12">
<?php
$for = $_GET['keywords'];
if ($_GET['keywords']) {
    $duma = $_GET['keywords'];
    if (strlen($duma) < 7) {
        echo '
Please enter at least 7 characters
';
    } else {
        $sql    = "SELECT * FROM bans WHERE ip LIKE '%$duma%' ORDER BY id DESC";
        $result = mysql_query($sql);
        $row    = mysql_fetch_assoc($result);
        $broi   = mysql_num_rows($result);
        if ($broi == 0) {
            echo '
There are no bans
';
        } else {
            echo '<p>' . $broi . ' results were found for your search</p>

            <table class="table table-bordered table-striped table-hover">
                <tr>
                    <th>IP Address</th>
                    <th>Date</th>
					<th>Redirect</th>
					<th>Actions</th>
                </tr>
';
            echo '
                <tr class="even">
	                <td>' . $row['ip'] . '</td>
	                <td>' . $row['date'] . '</td>
					<td>' . $row['redirect'] . '</td>
					<td>
						<a href="ban_details.php?id=' . $row['id'] . '" class="btn btn-primary"><i class="icon-eye-open icon-white"></i> Details</a>
						<a href="?delete-id=' . $row['id'] . '" class="btn btn-danger"><i class="icon-remove icon-white"></i> Delete</a>
					</td>
                </tr>
';
            echo '      </table>';
        }
    }
}
?>
								<hr />
								</div>
                            </div>
                        </div>
                        <!-- /block -->
                    </div>
   
<?php
footer();
?>