<?php
define('MKTOP', 1);
$title='Ferqli Saytlar Toplusu';
require_once('../system/connect.php');
require_once('../system/core.php');
require_once('../system/function.php');
level(3);
require_once('../head.php');
switch($act)
{
default:
echo '<div class="text"><a href="rand.php?act=all">Cemi Ferqli Saytlar</a></div>';
$count = mysql_num_rows(mysql_query("SELECT * FROM `rand_site` WHERE `status` = '0'"));
if($count > 0)
{
$total=intval(($count-1)/$set['page_moderacia'])+1;
$page=abs(intval($_GET['page']));
if(empty($page) OR $page < 0)
{
$page = 1;
}
if($page > $total)
{
$page = $total;
}
$past=intval($count/$set['page_moderacia']);
$start=$page*$set['page_moderacia']-$set['page_moderacia'];
$moder = mysql_query("SELECT * FROM `rand_site` WHERE `status` = '0' ORDER BY `id` DESC LIMIT ".$start.",".$set['page_moderacia']."");
while($row = mysql_fetch_array($moder)) {
$start++;
echo '<div class="text">'.$start.'.<strong><a href="http://'.$row['url'].'">'.$row['name'].'</a></strong><br/>';
echo '• <a href="rand.php?act=activate&id='.$row['id'].'">Aktiv Et</a> | ';
echo '<a href="rand.php?act=delete&id='.$row['id'].'">Sil</a><br/>';
echo '</div>';
}
navigation($count,$set['page_moderacia'],$page,'http://'.$set['home'].'/adm_panel/rand.php?',$total);
}
else
{
echo '<div class="text">';
echo 'Tesdiq Gozleyen Ferqli Sayt Yoxdur!!<br/>';
echo '</div>';
}
break;
case 'activate':
$up = mysql_query("UPDATE `rand_site` SET `status` = '1' WHERE `id` = '".$id."'");
if($up)
{
echo '<div class="text">';
echo 'Ferqli sayt ugurla aktiv edildi!<br/>';
echo '</div>';
}
else
{
echo '<div class="text">';
echo 'Ferqli sayt aktiv edilmedi!<br/>';
echo '</div>';
}
break;
case 'delete':
$del = mysql_query("DELETE FROM `rand_site` WHERE `id` = '".$id."'");
if($del)
{
echo '<div class="text">';
echo 'Ferqli sayt ugurla silindi!<br/>';
echo '</div>';
}
else
{
echo '<div class="text">';
echo 'Ferqli sayt silinmedi!<br/>';
echo '</div>';
}
break;
case 'all':
$count = mysql_num_rows(mysql_query("SELECT * FROM `rand_site` WHERE `status` = '1'"));
if($count > 0)
{
$total=intval(($count-1)/$set['page_moderacia'])+1;
$page=abs(intval($_GET['page']));
if(empty($page) OR $page < 0)
{
$page = 1;
}
if($page > $total)
{
$page = $total;
}
$past=intval($count/$set['page_moderacia']);
$start=$page*$set['page_moderacia']-$set['page_moderacia'];
$moder = mysql_query("SELECT * FROM `rand_site` WHERE `status` = '1' ORDER BY `id` DESC LIMIT ".$start.",".$set['page_moderacia']."");
while($row = mysql_fetch_array($moder))
{
$start++;
echo '<div class="text">'.$start.'.<strong><a href="http://'.$row['url'].'">'.$row['name'].'</a></strong><br/>';
echo '• <a href="rand.php?act=delete&id='.$row['id'].'">[Sil]</a><br/>';
echo '</div>';
}
navigation($count,$set['page_moderacia'],$page,'http://'.$set['home'].'/adm_panel/rand.php?',$total);
}
else
{
echo '<div class="text">';
echo 'Ferqli Sayt Yoxdur!<br/>';
echo '</div>';
}
break;
}
echo '<div class="main"><a href="/adminka/">Admin Panel</a><br/></div>';
require_once('../foot.php');
?>