<?php
//Создàем нàчàло тàблèцы
echo "<table><thead><tr><th>Rank</th><th>Face</th><th><center>Nom</center></th><th>Level</th><th> <center>Metier</center></th><th><center>Clan</center></th><th>Pvp/PK</th><th><center>No-Life</center></th><th>Status</th><tr></thead>\n";
//Выводèм содержèмое тàблèцы
$result2 = mysql_query("SELECT clan_id,clan_name FROM clan_data", $link)
or die ("Error: ".mysql_error());
while ($row2=mysql_fetch_row($result2))
$clans_array[$row2[0]]=$row2[1];
$clans_array[0]="";
$n=1;
while ($top=mysql_fetch_array($data))
{
$onlinetimeH=round(($top[onlinetime]/60/60)-0.5);
$onlinetimeM=round(((($top[onlinetime]/60/60)-$onlinetimeH)*60)-0.5);
$clan=mysql_fetch_array(mysql_query("select * from clan_data where clan_id=$top[clanid]"));
if ($clan[clan_name]=='') { $clan[clan_name]="No Clan"; }
if ($top['sex']==0) { $name='<font color=#8080FF>'.$top[char_name].'</font>'; } else { $name='<font color=#FF8080>'.$top[char_name].'</font>'; }
$class=mysql_fetch_array(mysql_query("select ClassName from char_templates where ClassId=$top[classid]"));
if (($top['sex']==0) && ($top['race']==5)) { $img='./module/face/kameal_M.gif'; }
if (($top['sex']==1) && ($top['race']==5)) { $img='./module/face/kameal_V.gif'; }
if (($top['sex']==0) && ($top['race']==4)) { $img='./module/face/Dwarf_M.gif'; }
if (($top['sex']==1) && ($top['race']==4)) { $img='./module/face/Dwarf_V.gif'; }
if (($top['sex']==0) && ($top['race']==2)) { $img='./module/face/Delf_M.gif'; }
if (($top['sex']==1) && ($top['race']==2)) { $img='./module/face/Delf_V.gif'; }
if (($top['sex']==0) && ($top['race']==0)) { $img='./module/face/Human_M.gif'; }
if (($top['sex']==1) && ($top['race']==0)) { $img='./module/face/Human_V.gif'; }
if (($top['sex']==0) && ($top['race']==1)) { $img='./module/face/elf_M.gif'; }
if (($top['sex']==1) && ($top['race']==1)) { $img='./module/face/elf_V.gif'; }
if (($top['sex']==0) && ($top['race']==3)) { $img='./module/face/Orc_M.gif'; }
if (($top['sex']==1) && ($top['race']==3)) { $img='./module/face/Orc_V.gif'; }
if ($top['online']==1) {$online='<font color=green>Online</font>'; }
else {$online='<font color=red>Offline</font>'; }
echo "<tr><td><b><center>$n</center></b></td><td><img src='$img'></td><td> $name</td><td><center> $top[level]</center></td><td><center>$class[ClassName]</center></td><td><center><a href=index.php?d=module&p=clantop>$clan[clan_name]</a></center> </td><td><center><b>$top[pvpkills]</b>/<b><font color=red>$top[pkkills]</font></b></center></td><td><center>$onlinetimeH Hours $onlinetimeM min.</center></td><td>$online</td></tr>\n";
$n++;
}
//Зàкрывàем тàблèцу
echo '</table>';
?>
|