View file Modules/Ban-List.php

File size: 1.51Kb
<?PHP
require '../System/core.php';
 $config['title'] = 'Бан лист';
require '../System/header.php';

# Проверяем есть ли забаненые сайты
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `site` WHERE `ban` = '1'"),0); $sql_count++;

if($count !== '0')
 {


                        $pages = $system['page'];
						$page = num($_GET['page']);
                        $total = intval(($count-1)/$pages) + 1;
						if(empty($page) OR $page < 0)
						      {
							    $page = 1;
						      }
						if($page > $total)
						      {
							    $page = $total;
						      }
						$past = intval($count/$pages);
						$start = $page*$pages-$pages;


  $query = mysql_query("SELECT * FROM `site` WHERE `ban` = '1' ORDER BY `time` DESC LIMIT ".$start.",".$pages.""); $sql_count++;
  while($site = mysql_fetch_array($query))
   {
    $ban = mysql_fetch_array(mysql_query("SELECT * FROM `banlist` WHERE `id_site` = '".$site['id']."'")); $sql_count++;
    echo '<div class="text">';
	 echo 'Название: '.$site['name'].'<br />';
	 echo 'URL: '.$site['url'].'<br />';
	 echo 'Забанен: '.data($ban['time']).'<br />';
	 echo 'Причина: '.$ban['about'].'';
	echo '</div>';
   }
  if ($pages < $count)
	echo $navigation = navigation($total, $page, '/Ban-List/'.$id.'');
 }
else
 {
  echo '<div class="text">Забаненых сайтов нет</div>';
 }
echo '<div class="back"><a href="/"><img src="/Style/icons/back.png" alt="" /> На главную</a></div>';
require '../System/footer.php';
?>