<?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(); // форма авторизации

 if (mysql_result(mysql_query("SELECT COUNT(*) FROM `build` WHERE `active` = '1' AND `id` = '".intval($_GET['id'])."' LIMIT 1"), 0)==0){
header("Location: index.php?".SID);
exit;
} 

$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `build_user` WHERE `id_build` = '".intval($_GET['id'])."' AND `man` = '1'"),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)
{
echo "  <div class='mess'>\n";
echo "Нет участников\n";
echo "  </div>\n";
}

$q=mysql_query("SELECT * FROM `build_user` WHERE `id_build` = '".intval($_GET['id'])."' AND `man` = '1' LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_assoc($q))
{

$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $post[id_user] LIMIT 1"));
/*-----------зебра-----------*/ 
	if ($num==0){
		echo '<div class="nav1">';
		$num=1;
	}
	elseif ($num==1){
		echo '<div class="nav2">';
		$num=0;
	}
/*---------------------------*/

echo group($ank['id'])." <a href='/info.php?id=$ank[id]'>$ank[nick]</a> ";
echo "".medal($ank['id'])." ".online($ank['id'])."<br />";

echo "</div>";

}


if ($k_page>1)str('?id='.$_GET['id'].'&',$k_page,$page); // Вывод страниц

echo "<div class='foot'><a href='/build/'>Назад к стройке</a></div>";

include_once '../sys/inc/tfoot.php';


?>