<?php
require'fun.php';
require'f_conectare.php';
conectare('vecinii (triburile v2)','triburile2-vecinii');
$titlu='Vecinii - Triburile V2';
$back[1]='<a href="/triburile2">'.img('triburile.gif',1).'Triburi</a>';
require'f_sus.php';
require'triburile2_nicu1.php';
require'triburile2_nicu2.php';
echo$div[1].'<a href="'.$domenii_statice[0].'triburile2-descarca-harta.gif"><img src="'.$domenii_statice[0].'triburile2-descarca-harta.gif" alt="" />Descarca harta</a>'.$div[0];
$fer=$conn->query('SELECT`corx`,`cory`,`trib`FROM`t2_membrii`WHERE`de`="'.$de.'"')->fetch_row();
$items=$conn->query('SELECT`corx`,`cory`,`sat`,`de`,`trib`FROM`t2_membrii`WHERE(`corx`>'.($fer[0]-200).'&&`corx`<'.($fer[0]+200).')&&(`cory`>'.($fer[1]-200).'&&`cory`<'.($fer[1]+200).')');
while($i=$items->fetch_row())
{
echo$div[1];
if($i[3]!=$de)
{
if($i[4]==$fer[2])
echo'Satul: <strong>'.$i[2].'</strong> aliat<br />Distanta: <strong>'.round(sqrt((abs($fer[0]-$i[0]))*2+(abs($fer[1]-$i[1]))*2),0).'</strong> unitati';
else
echo'Satul: <strong>'.$i[2].'</strong> inamic<br />Distanta: <strong>'.round(sqrt((abs($fer[0]-$i[0]))*2+(abs($fer[1]-$i[1]))*2),0).'</strong> unitati';
}
echo$div[0];
}
require'f_jos.php';