View file Services and entertainment/plugins/services/user.php

File size: 2.2Kb
<?php
include_once '../../sys/inc/start.php';
include_once '../../sys/inc/compress.php';
include_once '../../sys/inc/sess.php';
include_once '../../sys/inc/home.php';
include_once '../../sys/inc/settings.php';
include_once '../../sys/inc/db_connect.php';
include_once '../../sys/inc/ipua.php';
include_once '../../sys/inc/fnc.php';
include_once '../../sys/inc/user.php';

$set['title'] = 'Мои развлечения и сервисы';
include_once '../../sys/inc/thead.php';

title();
aut(); 
err();


if (isset($_GET['id'])) {
    $sid = intval($_GET['id']);
} else {
    $sid = htmlspecialchars($user['id']);
}

$ank = get_user($sid);


echo "<div id='comments' class='menus'>";
echo "<div class='webmenu'>";
echo "<a href='user.php?id=$user[id]' class='activ'>Мои</a>";
echo "</div>"; 
echo "<div class='webmenu last'>";
echo "<a href='index.php?top'>ТОП</a>";
echo "</div>"; 
echo "<div class='webmenu last'>";
echo "<a href='index.php'>Все</a>";
echo "</div>"; 
echo "</div>";

$k_post = mysql_result(mysql_query("SELECT COUNT(id_service) FROM `user_services` WHERE `id_user` = '$ank[id]'"), 0);


$k_page = k_page($k_post,$set['p_str']);
$page = page($k_page);
$start = ($set['p_str'] * $page) - $set['p_str'];

if ($k_post == 0)
{
?>
<div class="main">Нет результатов</div>
<?
} 


$q = mysql_query("SELECT * FROM `user_services` WHERE `id_user` = '$ank[id]' ORDER BY `time` DESC LIMIT $start, $set[p_str]");

while ($post = mysql_fetch_assoc($q)) {
/*-----------зебра-----------*/
if ($num==0)
{echo "  <div class='nav1'>\n";
$num=1;
}elseif ($num==1)
{echo "  <div class='nav2'>\n";
$num=0;}
/*---------------------------*/	
	$service = mysql_fetch_assoc(mysql_query("SELECT * FROM `services` WHERE `id` = '$post[id_service]' LIMIT 1"));
	?>
	<a href="/plugins/services/info.php?id_service=<?= $service['id']?>"><?= ($service['icon_small'] ? '<img src="' . text($service['icon_small']) . '" />' : '')?> <?= text($service['name'])?></a> 
	<span style="float: right;"><a href="/plugins/services/info.php?id_service=<?= $service['id']?>&amp;act=delete"><img src="/style/icons/delete.png"></a></span> 
	</div>
	<?
}


if ($k_page > 1) {
	str('user.php', $k_page, $page);
}

include_once H . 'sys/inc/tfoot.php';
?>