<?php
/*
- NTLCMS v 18.1 19.08.2017 г
- Автор скрипта Александр (NTL)
- Скрипт клик клуба v 18.1
- Оф.сайт http://clicks24.ru
- Контакты ntl-jt@mail.ru
- Все права принадлежат разработчику
- Вы не имеете право вносить изменения в код скрипта
- Данный скрипт запрещено распространять
*/
define('NTLCMS', 1);
$module = 'panel';
include ('../system/start.php');
include ('../system/function.php');
include ('../system/antidos.php');
include ('../system/head.php');
################################################################################
if ($active && $_USER['admin'] == '1'){
################################################################################
switch($act){
default:
echo '<div class="title"><center>Админ-Панель | Модерация сайтов</center></div>';
################################################################################
$k_post = DB :: run() -> querySingle("select count(`id`) from `sites` where `status` = ?", array(2));
$k_page = k_page($k_post, $onpage);
$page = page($k_page);
$start = $onpage * $page - $onpage;
$sql = DB :: run() -> query("select * from `sites` where `status` = ? order by `id` asc limit ".$start.", ".$onpage, array(2));
if ($k_post == 0){
echo '<div class="post"><center>'.image('fail.png','16|16').' Сайтов на модерацию нет!</center></div>';
} else {
echo '<table border="1" class="menu" width="100%"><tr><td><center>Логин</center></td><td><center>Площадка</center></td><td><center>Тип ссылки</center></td><td><center>Действие</center></td></tr>';
while ($row = $sql -> fetch(PDO::FETCH_OBJ)){
echo '<tr><td><center>'.login($row -> login, 1).'</center></td>
<td><center><a href="'.URL.'/go/http://'.str_ireplace('http://', '', $row -> url).'">'.filter_out($row -> name).'</a></center></td><td><center>'.typelink($row -> type).'</center></td>
<td><center><a href="'.URL.'/_mod_on'.((int) $row -> id).'">ON</a> | <a href="'.URL.'/_mod_off'.((int) $row -> id).'">OFF</a></center></td></tr>';
}
echo '</table>';
if ($k_page > 1) navigation(URL.'/_modsites?', $k_page, $page);
}
echo '<div class="block">'.image('home.png','18|18').' <a href="'.URL.'/cabinet">В кабинет</a> | <a href="'.URL.'/_control">Админ-Панель</a></div>';
break;
################################################################################
case 'on':
$id = isset($_GET['id']) ? filter_int($_GET['id']) : '0';
if (DB :: run() -> querySingle("select count(`id`) from `sites` where `status` = ? and `id` = ?", array('2', $id))){
DB :: run() -> query("update `sites` set `status` = ?, `active` = ? where `id` = ?", array('1', '1', $id));
$_SESSION['success'] = 'Сайт успешно промодерирован!';
header('Location: '.URL.'/_modsites');
}
break;
################################################################################
case 'off':
$id = isset($_GET['id']) ? filter_int($_GET['id']) : '0';
if (DB :: run() -> querySingle("select count(`id`) from `sites` where `status` = ? and `id` = ?", array('2', $id))){
DB :: run() -> query("update `sites` set `status` = ?, `active` = ? where `id` = ?", array('3', '0', $id));
$_SESSION['success'] = 'Сайт успешно заблокирован!';
header('Location: '.URL.'/_modsites');
}
break;
################################################################################
}
} else {
echo '<div class="title"><center>Проверка прав доступа</center></div>';
echo '<div class="menu"><center>'.image('fail.png','16|16').' Доступ запрещен!</center></div>';
echo '<div class="block">'.image('home.png','18|18').' '.(isset($active) ? '<a href="'.URL.'/cabinet">В кабинет</a>' : '<a href="'.URL.'">На главную</a>').'</div>';
}
include ('../system/foot.php');
?>