<?php
require_once('../classes/body.class.php');
require_once('../classes/db.class.php');
require_once('../classes/system.class.php');
$title= new Body;
$title->SetTitle('Дата-центр - Поиск по IP');
$title->GetHeader();
if ($b['level'] == 0) {
header('location:/');
die();
}
echo '<div class="tile"><div class="t-header th-alt bg-teal"><div class="th-title"><i class="zmdi zmdi-widgets"></i><a href="/"style="text-decoration:none; color:white;"> Главная</a> :: <a href="/administration/"style="text-decoration:none; color:white;"> Дата-центр</a> :: Поиск по IP</div></div></div>';
if (isset($_POST['ok'])) {
$ip = check($_POST['ip']);
$s = DB::$dbs->query("SELECT id,soft FROM blogger WHERE ip = ? ORDER BY id DESC", [$ip]);
if (empty($ip)) {
err('Не введен IP!');
}
elseif ($s -> rowCount() == false) {
err('Результат: не найдено.');
}
else
{
echo '<div class="list-group-item media">IP: <b>'.$ip.'</b></div>';
$c = 1;
while($a = $s -> fetch())
{

echo '<div class="list-group-item media">'.$c++ . ') ' . Nick($a['id']) . '<br/>Soft: '.$a['soft'].'</div>';
}
}
}
echo '<div class="list-group-item media"><form action="?" method="post">IP:<br/><input type="text" class="form-control" name="ip"/><br/><input class="btn btn-primary" type="submit" name="ok" value="Искать редиску"/></form></div>';

$title->GetMenu();
$title->GetFooter();
?>