<?php
define('MKTOP', 1);
require_once ('system/connect.php');
require_once ('system/core.php');
require_once ('system/function.php');
switch($act){
default:
$title = 'Kategoriya';
require_once ('head.php');
$cats = mysql_query("SELECT * FROM `cat` ORDER BY `position`");
while($cat = mysql_fetch_array($cats)){
$count_sites = mysql_num_rows(mysql_query("SELECT * FROM `sait` WHERE `category` = '".$cat['id']."' AND `status` = '1' AND `ban` = '0'"));
echo '<a class="link" href = "/cat_'.$cat['id'].'.php"><img height="20" width="20" src="img/categoryi.png"> <b><big>'.$cat['name'].'</big></b> <span class="stat"><b><big>'.$count_sites.'</big></b></span></a>';
if(isset($user_data) AND $user_data['level'] == 3)
echo '<div class="text"><a href="/adminka/category.php?act=del&id='.$cat['id'].'">Sil</a> | <a href="/adminka/category.php?act=edit&id='.$cat['id'].'">Deyiş</a></div>';
}
break;
case 'view':
$isset = mysql_query("SELECT * FROM `cat` WHERE `id` = '".$id."'");
if(mysql_num_rows($isset) > 0){
$catt = mysql_fetch_array($isset);
$title = $catt['name'];
require_once ('head.php');
echo '<div class="maintxt">';
$count = mysql_num_rows(mysql_query("SELECT * FROM `sait` WHERE `category` = '".$id."' AND `status` = '1' AND `ban` = '0'"));
if($_COOKIE['version'] == 'web'){
echo'<table width="100%"><tr>
<td style="text-align:center;font: 18px Arial;vertical-align:center;width:8%;"> </td>
<td style="text-align:left;font: 20px verdena;vertical-align:center;width:56%;"></td>
<td style="text-align:center;font: 13px verdana;vertical-align:center;width:14%;"> <font color="black"><span class="indexhosthit">Host</span></font></td>
<td style="text-align:center;font: 13px verdana;vertical-align:center;width:14%;"> <font color="black"><span class="indexhosthit">Hit</span></font></td>
<td style="text-align:center;font: 18px verdena;vertical-align:center;width:10%;"> </td>
</tr></table>';
}
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 `category` = '".$id."' AND `status` = '1' AND `ban` = '0' ORDER BY `".$sort."` DESC LIMIT ".$start.",".$page_sait."");
while($row = mysql_fetch_array($saits)){
$gunu = $row['logman'];
$indi = date("d-m-Y");
$start++;
$img = file_exists('images/'.$start.'_place.png') ? ' <img src = "http://'.$set['home'].'/images/'.$start.'_place.png">' : '';
echo '<div style="text-align:bottom"><div class="stitle"><table style="width:100%" cellspacing="0" cellpadding="0"><tr><td style="vertical-align:center;width:25px;border-right:solid; border-width:0px">';
echo '<div style="padding-top:1px"><div class="sayi">';
if($gunu==$indi){
echo "<img src=\"/img/newtop.png\"></img>";
}else{
if($start < 2){
echo "<span style=\"color:red\"><b>0$start</b></span>";
}elseif($start < 3){
echo "<span style=\"color:green\"><b>0$start</b></span>";
}elseif($start < 4){
echo "<span style=\"color:blue\"><b>0$start</b></span>";
}elseif($start < 10){
echo "<b>0$start</b>";
}else{
echo "<b>$start</b>";
}
}
if($_COOKIE['version'] == 'web'){
echo '</div></div></td><td style="vertical-align:top;width:60%;border-right:solid; border-width:0px"><img src="http://www.google.com/s2/favicons?domain='.$row['url'].'"/> <a href="/out/'.$row['id'].'.php"><b>'.$row['name'].'</b></a><br/>';
if(mb_strlen($row['about']) > 50){
$text = mb_substr($row['about'], 0, 50, 'utf-8');
echo ''.$text.'... <br/>';
}
else echo ''.$row['about'].'<br/>';
echo '</font></b></td>';
//if($row['in'] >= 10){
//echo '<img src="/img/topico.png"></img> ';
//}else{
//echo '<img width="12" height="14" src="/img/downs.png"></img> ';
//}
echo '<td style="vertical-align:center;width:14%;"><center><b>'.$row['hosts'].'</b></center></td><td style="vertical-align:center;width:14%;"><center><b>';
echo ($row['hits'] > 999 ? round($row['hits']/1000).'К' : $row['hits']);
if($gunu==$indi){
echo '</b></center></td><td style="vertical-align:center;width:7%;border-left:solid;border-width:0px;"><div style="text-align:right; padding-top:4px;">
<a href="/info/'.$row['id'].'.php"><img title="Statistika" src="/img/ico-stat.png"></img></a>';
}else{
echo '</b></center></td><td style="vertical-align:center;width:7%;border-left:solid;border-width:0px;"><div style="text-align:right; padding-top:4px;">
<a href="/info/'.$row['id'].'.php"><img title="Statistika" src="/img/ico-stat.png"></img></a>';
}
echo '</div></td></tr></table></div>';
}elseif($_COOKIE['version'] == 'wap'){
echo '</div></div></td><td style="vertical-align:top;width:88%;border-right:solid; border-width:0px"><img src="http://www.google.com/s2/favicons?domain='.$row['url'].'"/> <a href="/out/'.$row['id'].'.php">'.$row['name'].'</a> ['.$row['hosts'].'|';
//echo ($row['hits'] > 999 ? round($row['hits']/1000).'К' : $row['hits']);
//echo ']<br/>';
echo ''.$row['hits'].']<br/>';
if(mb_strlen($row['about']) > 50){
$text = mb_substr($row['about'], 0, 50, 'utf-8');
echo ''.$text.'... <br/>';
}
else echo ''.$row['about'].'<br/>';
echo '</font></b></td>';
echo '<td style="vertical-align:bottom;width:7%;border-left:solid;border-width:0px;"><div style="text-align:right; padding-top:4px;">
<a href="/info/'.$row['id'].'.php"><span id="ekozade"><img src="img/statgoo.png" alt="s"/></span></a></div></td>
</tr></table></div></div> ';
}else{
echo '</div></div></td><td style="vertical-align:top;width:88%;border-right:solid; border-width:0px"><img src="http://www.google.com/s2/favicons?domain='.$row['url'].'"/> <a href="/out/'.$row['id'].'.php">'.$row['name'].'</a> ['.$row['hosts'].'|';
echo ($row['hits'] > 999 ? round($row['hits']/1000).'К' : $row['hits']);
echo ']<br/>';
//echo ''.$row['hits'].']<br/>';
if(mb_strlen($row['about']) > 50){
$text = mb_substr($row['about'], 0, 50, 'utf-8');
echo ''.$text.'... <br/>';
}
else echo ''.$row['about'].'<br/>';
echo '</font></b></td>';
echo '<td style="vertical-align:bottom;width:7%;border-left:solid;border-width:0px;"><div style="text-align:right">
<a href="/info/'.$row['id'].'.php"><span id="ekozade"><img src="img/statgoo.png" alt="s"/></span></a></div></td>
</tr></table></div> ';
}
echo '</a>';
echo '</div>';
if(isset($user_data) AND $user_data['level'] >= 3){
echo '<div class="stitle"><a href="/adminka/platforms.php?act=edit_sait&id='.$row['id'].'">Deyiş</a> | ';
echo '<a href="/adminka/platforms.php?act=ban&id='.$row['id'].'">Ban Et</a> | ';
echo '<a href="/adminka/platforms.php?act=del_sait&id='.$row['id'].'">Sil</a></div>';
}
}
navigation($count,$page_sait,$page,'cat.php?id='.$id.'&sort='.$sort.'&',$total);
}
else{
echo '<div class="text">Bu Kategoriyada Aktiv sayt yoxdur!</div>';
}
}
else{
$title = 'Sehf!';
require_once ('head.php');
echo '<div class="text">Bele Kategoriya Movcud Deyil!</div>';
}
echo '</div>';
break;
}
require_once ('foot.php');
?>