Файл: AdminPanel/msmoder.php
Строк: 35
<?php
if(isset($_GET['msuser'])){
echo '<div class="feedbackPanel">Пользователи</div><div>
<div>
<table class="center pt6 pb6" style="margin:0 auto; width: 80%;">
<tr class="blueSecColor textshadow">';
$user['set'] = 10;
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_user`"),0);
if ($k_post==0){
}
$k_page=k_page($k_post,$user['set']);
$page=page($k_page);
$start=$user['set']*$page-$user['set'];
$q=mysql_query("SELECT * FROM `mystyle_user` LIMIT $start, $user[set]");
while($post=mysql_fetch_array($q))
{
$sr = $start+1;
echo '<tr class="blueSecColor textshadow">';
echo '<td>';
echo users($post['id']);
echo '</td>';
echo '<td>';
echo ''.vremja($post['date_last']).'';
echo '</td>';
echo '<td><a class="btnp" href="?msmoder&update1='.$post['id'].'">User</a><a class="btnp" href="?msmoder&update2='.$post['id'].'">Admin</a><a class="btnp" href="?msmoder&update3='.$post['id'].'">Moder</a><br /><br /></td>';
echo '</tr>';
$start++;
}
echo '</table></div></div></div>';
echo '<div class="center pt12 pb18">';
if ($k_page>1)str("?msmoder&msuser&",$k_page,$page);
echo '</div>';
}elseif(isset($_GET['update1']) && num($_GET['update1'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_user` WHERE `id` = '".num($_GET['update1'])."' LIMIT 1"),0)!=0){
$post = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_user` WHERE `id` = '".num($_GET['update1'])."'"));
mysql_query("UPDATE `mystyle_user` SET `admin` = '0' WHERE `id` = '".$post['id']."' LIMIT 1");
///////// Лог Пользователя ///// By MyStyle
$text = 'Изменен на пользователя';
$_SESSION['msg'] = $text;
header("Location: ./?msmoder");
exit;
}elseif(isset($_GET['update2']) && num($_GET['update2'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_user` WHERE `id` = '".num($_GET['update2'])."' LIMIT 1"),0)!=0){
$post = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_user` WHERE `id` = '".num($_GET['update2'])."'"));
mysql_query("UPDATE `mystyle_user` SET `admin` = '1' WHERE `id` = '".$post['id']."' LIMIT 1");
///////// Лог Пользователя ///// By MyStyle
$text = 'Изменен на админа';
$_SESSION['msg'] = $text;
header("Location: ./?msmoder");
exit;
}elseif(isset($_GET['update3']) && num($_GET['update3'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_user` WHERE `id` = '".num($_GET['update3'])."' LIMIT 1"),0)!=0){
$post = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_user` WHERE `id` = '".num($_GET['update3'])."'"));
mysql_query("UPDATE `mystyle_user` SET `admin` = '2' WHERE `id` = '".$post['id']."' LIMIT 1");
///////// Лог Пользователя ///// By MyStyle
$text = 'Изменен на модера';
$_SESSION['msg'] = $text;
header("Location: ./?msmoder");
exit;
}else{
echo '<div class="feedbackPanel">Модеры, Админы</div><div>
<div>
<table class="center pt6 pb6" style="margin:0 auto; width: 80%;">
<tr class="blueSecColor textshadow">';
$user['set'] = 10;
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_user` WHERE `admin`"),0);
if ($k_post==0){
}
$k_page=k_page($k_post,$user['set']);
$page=page($k_page);
$start=$user['set']*$page-$user['set'];
$q=mysql_query("SELECT * FROM `mystyle_user` WHERE `admin` LIMIT $start, $user[set]");
while($post=mysql_fetch_array($q))
{
$sr = $start+1;
echo '<tr class="blueSecColor textshadow">';
echo '<td>';
echo users($post['id']);
echo '</td>';
echo '<td>';
echo ''.vremja($post['date_last']).'';
echo '</td>';
echo '<td><a class="btnp" href="?msmoder&update1='.$post['id'].'">User</a><a class="btnp" href="?msmoder&update2='.$post['id'].'">Admin</a><a class="btnp" href="?msmoder&update3='.$post['id'].'">Moder</a><br /><br /></td>';
echo '</tr>';
$start++;
}
echo '</table></div></div></div>';
echo '<a class="btn" href="./?msmoder&msuser">Все пользователи</a>';
echo '<div class="center pt12 pb18">';
if ($k_page>1)str("?msmoder&",$k_page,$page);
echo '</div>';
}
?>