Файл: panel/bann.php
Строк: 67
<?php
/**
* @package Prime Social
* @link http://primesocial.ru
* @copyright Copyright (C) 2016 Prime Social
* @author BoB | http://primesocial.ru/about
*/
require_once('../core/start.php');
check_auth();
head('Ban olganlar ro`yhati');
if (privilegy('anceta_bann')) {
switch ($select) {
default:
if ($_GET['del']) {
$del = num($_GET['del']);
$bann = DB::$dbs->queryFetch("SELECT `moder` FROM ".BANN." WHERE `id` = ?",array($del));
$moder = DB::$dbs->queryFetch("SELECT `user_id`, `name`, `level` FROM ".USERS." WHERE `user_id` = ?",array($bann['moder']));
if ($user['user_id'] == $bann['moder'] || $user['level'] > $moder['level']) {
DB::$dbs->query("DELETE FROM ".BANN." WHERE `id` = ?",array($del));
echo DIV_MSG . 'Ban olindi' . CLOSE_DIV;
} else {
echo DIV_ERROR . 'Kirishda xatolik' . CLOSE_DIV;
}
}
$all = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".BANN." WHERE `time_bann` > ?", array(time()));
if ($all == 0) {
echo DIV_AUT . 'Ro`yhat bo`sh' . CLOSE_DIV;
} else {
$n = new Navigator($all,10,'');
$sql = DB::$dbs->query("SELECT * FROM ".BANN." WHERE `time_bann` > ? LIMIT {$n->start()}, 10", array(time()));
while($bann = $sql -> fetch()) {
echo DIV_AUT;
$ank = DB::$dbs->queryFetch("SELECT `user_id`, `name` FROM ".USERS." WHERE `user_id` = ?",array($bann['user_id']));
echo '<a href="'.HOME.'/id'.$ank['user_id'].'"><b>'.$ank['name'].'</b> [id: '.$ank['user_id'].']<br />';
$moder = DB::$dbs->queryFetch("SELECT `user_id`, `name`, `level` FROM ".USERS." WHERE `user_id` = ?",array($bann['moder']));
echo 'Ban bergan moderator: '.user_choice($moder['user_id'], 'link').'<br />';
echo '<b>Sabab:</b> '.$bann['prich'].'<br />';
echo '<b>Ban tugash vaqti:</b> '.vrem($bann['time_bann']).'<br />';
echo '<b>Ban sanasi:</b> '.vrem($bann['time']).'<br />';
echo CLOSE_DIV;
echo DIV_LI;
echo ($user['user_id'] == $bann['moder'] || $user['level'] > $moder['level'] ? '<a href="'.HOME.'/panel/bann_list/?del='.$bann['id'].'">[Chiqarish]</a>' : NULL);
echo CLOSE_DIV;
}
echo $n->navi();
}
break;
}
} else {
echo DIV_BLOCK . 'Kirishda xatolik' . CLOSE_DIV;
}
echo DIV_GO . '<a href="'.HOME.'/">Bosh sahifa</a> / <a href="'.HOME.'/panel">Boshqaruv paneli</a> / <b>Ban olganlar ro`yhati</b>' . CLOSE_DIV;
require_once('../core/stop.php');
?>