<?php
require'config.php';
$align='left';
$title='Рефералы';
aut();
head();
who_add(0,'enter');
if (!ctype_digit($_GET['nk'])){header('Location: index?'.SID);die;}
$nk = intval($_GET['nk']);
$select = @$db->sql_query ("Select * from users where id='".$nk."'");
$inf = $db->sql_fetchrow ($select);
switch($mod) {
default:
if ($inf[id]==$user[id]){
if (empty($user['max']))
$user['max']=10;
$max = $user['max'];
$k_post=$db->sql_fetchfield($db->sql_query("select count(id) as num from users where invite = '".(int)$nk."'"), 0);
$k_page=k_page($k_post,$max);
$page=page($k_page);
$start=$max*$page-$max;
if($k_post==0)
{
echo 'Пока никого.<br/>';
}
$r = mysql_query("SELECT id, user FROM users WHERE invite = '".(int)$nk."' ORDER BY id DESC LIMIT $start, $max");
$num_k=$start+1;
while($q = $db->sql_fetchrow($r))
{
echo $num_k++.') <a href="info?nk='.$q['id'].'">'.$q['user'].'</a><br/>';
}
if ($k_page>1)
{
echo '<dl><dt></dt></dl>'.str('privel?&nk='.$inf['id'].'&',$k_page,$page).'<dl><dt></dt></dl>';
}
break;
###########а то сплывается уже гг#############
}else{
###########а то сплывается уже гг#############
if (empty($user['max']))
$user['max']=10;
$max = $user['max'];
$k_post=$db->sql_fetchfield($db->sql_query("select count(id) as num from users where invite = '".(int)$nk."'"), 0);
$k_page=k_page($k_post,$max);
$page=page($k_page);
$start=$max*$page-$max;
if($k_post==0)
{
echo 'Пользователь никого не приглашал.<br/>';
}
$r = mysql_query("SELECT id, user FROM users WHERE invite = '".(int)$nk."' ORDER BY id DESC LIMIT $start, $max");
$num_k=$start+1;
while($q = $db->sql_fetchrow($r))
{
echo $num_k++.') <a href="info?nk='.$q['id'].'">'.$q['user'].'</a><br/>';
}
if ($k_page>1)
{
echo '<dl><dt></dt></dl>'.str('privel?&nk='.$inf['id'].'&',$k_page,$page).'<dl><dt></dt></dl>';
}
break;
}
}
echo gb.'<a href ="'.$inf['id'].'">анкета</a><br/>'.div;
echo gb.'<a href ="enter">прихожая</a><br/>'.div;
foot();
?>