<?php
/*[_X3T4_N!CK_] Muellifdir Silenin Anasin Sikim*/
define('MKTOP', 1);
require_once ('system/connect.php');
require_once ('system/core.php');
require_once ('system/function.php');
reg();
switch($act){
default:
$title = 'İstifadəci Anketi';
require_once('head.php');
$count = mysql_num_rows(mysql_query("SELECT * FROM `users`"));
if($count > 0){
echo '<div class="nav">';
if($_GET['sort'] == 'id' OR $_GET['sort'] == null) echo 'ID'; else echo '<a href="users.php?sort=id">ID</a>'; echo ' | ';
if($_GET['sort'] == 'level') echo 'Vezife'; else echo '<a href="users.php?sort=level">Vezife</a>'; echo ' | ';
if($_GET['sort'] == 'time_reg') echo 'Qeydiyyat Tarixi'; else echo '<a href="users.php?sort=time_reg">Qeydiyyat Tarixi</a>';
echo '</div>';
if($_GET['sort'] == 'time_reg') $sort= 'time_reg';
elseif($_GET['sort'] == 'level') $sort= 'level';
else $sort= 'id';
$total=intval(($count-1)/$page_users)+1;
$page=abs(intval($_GET['page']));
if(empty($page) OR $page < 0) $page = 1;
if($page > $total) $page = $total;
$past=intval($count/$page_users);
$start=$page*$page_users-$page_users;
$users = mysql_query("SELECT * FROM `users` ORDER BY `".$sort."` ASC LIMIT ".$start.",".$page_users."");
while($row = mysql_fetch_array($users)){
$start++;
$platforms_c = mysql_num_rows(mysql_query("SELECT * FROM `sait` WHERE `id_user` = '".$row['id']."'"));
echo '<a class="link" href="users.php?act=user&id='.$row['id'].'">'.$start.') '.$row['login'].' <span class="stat">'.$platforms_c.'</span></a>';
}
navigation($count,$page_users,$page,'users.php?sort='.$sort.'&',$total);
}
else{
echo '<div class="text">Istifadeci Movcud Deyil</div>';
echo '<a class="link" href="office.php">Kabinet</a>';
}
break;
case 'user':
$title = 'İstifadəci haqqında məlumat';
require_once('head.php');
$isset = mysql_query("SELECT * FROM `users` WHERE `id` = '".$id."'");
if(mysql_num_rows($isset) == 0) echo '<div class="text">İstifadəci tapılmadı</div>';
else{
$users = mysql_query("SELECT * FROM `users` WHERE `id` = '".$id."' LIMIT 1");
$user = mysql_fetch_array($users);
$platforms = mysql_num_rows(mysql_query("SELECT * FROM `sait` WHERE `id_user` = '".$user['id']."'"));
if($user['level'] == 4) $dolzhnost = 'SV!';
else if($user['level'] == 3) $dolzhnost = 'Adm';
else if($user['level'] == 2) $dolzhnost = 'Smd';
else $dolzhnost = 'İstifadəci';
echo '<div class="link">Login: ';
if($user['login'] == Admin) {
echo '<img src="/images/admin.gif" alt="SV!"> - <span class="eko"><b>'.$dolzhnost.'</b></span><br/>';
}else if ($user['login'] == Sistem){
echo '<img style="border-radius: 14px;" height="25" width="90" src="/images/systems.png" alt="SV!"> - <span class="eko"><b>'.$dolzhnost.'</b></span><br/>';
}else{
echo ''.$user['login'].' - <span class="eko"><b>'.$dolzhnost.'</b></span><br/>';
}
echo 'Email: '.$user['mail'].'<br/>';
echo 'Qeydiyyat Tarixi: '.data($user['time_reg']).'</div>';
if($user['id'] == 1){
echo '<div class="link">Mənim saytlarıma baxmaq olmaz</div>';
}else{
echo '<a class="link" href="users.php?act=platforms&id='.$id.'">Saytları <span class="stat">'.$platforms.'/'.$set['max_platforms'].'</span></a>';
}
}
echo '<a class="link" href="office.php">Kabinet</a>';
break;
case 'platforms':
$title = 'İstifadəci Saytlari';
require_once('head.php');
$count = mysql_num_rows(mysql_query("SELECT * FROM `sait` WHERE `id_user` = '".$id."'"));
if($count > 0){
$total=intval(($count-1)/$page_sait)+1;
$page=abs(intval($_GET['page']));
if(empty($page) OR $page < 0) $page = 1;
if($page > $total) $page = $total;
$past=intval($count/$page_sait);
$start=$page*$page_sait-$page_sait;
if($_GET['sort'] == 'hits') $sort= 'hits';
elseif($_GET['sort'] == 'in') $sort= 'in';
elseif($_GET['sort'] == 'out') $sort= 'out';
else $sort= 'hosts';
$saits = mysql_query("SELECT * FROM `sait` WHERE `id_user` = '".$id."' ORDER BY `".$sort."` DESC LIMIT ".$start.",".$page_sait."");
while($row = mysql_fetch_array($saits)){
$start++;
$zabanen = ($row['ban'] == 0) ? '' : '(Ban Edilib)';
$status = $row['status'] == 1 ? '' : '(Tesdiqlenmeyib)';
echo '<div class="link"><a href="/out/'.$row['id'].'.php">'.$start.'. '.$row['name'].' <span class="stat">'.$row['hosts'].'/'.$row['hits'].'</span> '.$zabanen.''.$status.'</a><br/>';
if(mb_strlen($row['about']) > 50){
$text = mb_substr($row['about'], 0, 50, 'utf-8');
echo '<a href="/infos.php?id='.$row['id'].'">'.$text.'...</a></div>';
}
else echo '<a href="/infos.php?id='.$row['id'].'">'.$row['about'].'</a></div>';
}
navigation($count,$page_sait,$page,'users.php?act=platforms&id='.$id.'&sort='.$sort.'&',$total);
}
else echo '<div class="text">Bu istifadəcinin hec bir saytı yoxdur</div>';
echo '<a class="link" href="office.php">Kabinet</a>';
break;
}
require_once('foot.php');
?>