<?php
function lvlpct($de)
{
global$conn;
$lmp=1;
$items=$conn->query('SELECT`pct`,`de`FROM`t2_membrii`ORDER BY`pct`DESC');
while($rf=$items->fetch_row())
{
if($de==$rf[1])
return$lmp;
$lmp++;
}
}
$if=$conn->query('SELECT`lvlarg`,`lvllmn`,`lvlptr`,`lvlarm`,`lvlmag`,`lvlfrm`,`lvlasc`,`lvlzid`,`lvlcal`,`lmn`,`ptr`,`arg`,`lvlfer`,`premiu`,`lanc`,`lpsp`,`lptp`,`spio`,`cvus`,`cvgr`,`lvlprin`,`trib`,`sat`,`pct`,`corx`,`cory`,`pop`,`lvllmn`FROM`t2_membrii`WHERE`de`="'.$de.'"')->fetch_row();
$foy=$conn->query('SELECT`id`FROM`t2_triburi`WHERE`nume`="'.$if[21].'"')->fetch_row();
if($if[21]=='')
$trib='Momentan nu faci parte din nici un trib';
else
$trib='Faci parte din tribul <a href="/triburile2-trib/la/'.$foy[0].'-'.seo(nume($foy[0],1)).'">'.$if[21].'</a>';
$ferma=$conn->query('SELECT`cant`FROM`t2_magazie`WHERE`lvl`="'.$if[4].'"')->fetch_row();
$totpop=$conn->query('SELECT`cant`FROM`t2_ferma`WHERE`lvl`="'.$if[5].'"')->fetch_row();
echo$div[10].'Satul <a href="/triburile2-sat">'.$if[22].'</a><br />Esti pe locul <a href="/triburile2-sate">'.lvlpct($de).'</a><br />Cu '.$if[23].' puncte<br />'.$trib.'<br />Coordonate sat (X: '.$if[24].' Y: '.$if[25].')<br /><img src="'.$domenii_statice[2].'triburile2/lemne.png" alt="lemn" />'.$if[9].'<img src="'.$domenii_statice[1].'triburile2/argila.png" alt="argile" />'.$if[11].'<img src="'.$domenii_statice[1].'triburile2/piatra.png" alt="piatra" />'.$if[10].' din <img src="'.$domenii_statice[2].'triburile2/res.png" alt="capacitate" width="16" height="16" />'.$ferma[0].'<img src="'.$domenii_statice[2].'triburile2/populatie.png" alt="populatie" />'.$if[26].' din '.$totpop[0].$div[0];