<?php
include("module/stat-menu.php");
?> 

<center><br><b>..:: Состав клана ::..</b><br><br><hr></center>
<table><body><tr><td>
<?php
  $result = mysql_query("SELECT clan_data.*,char_name FROM clan_data,characters WHERE clan_name='".@mysql_escape_string($_REQUEST["clan_name"])."' AND leader_id=obj_Id", $link)
    or die ("Error: ".mysql_error());
$show=mysql_fetch_array($result);
$result = mysql_query("SELECT characters.*,classname FROM characters,char_templates WHERE clanid='".$show['clan_id']."' AND char_templates.ClassId=characters.classid AND clanid ORDER BY exp DESC", $link)
    or die ("Error: ".mysql_error());
    
  switch ($show["hasCastle"])
  {
    case 1: $show["hasCastle"]=$L2JBS_lang["clantop_gludiocastle"]; break;
    case 2: $show["hasCastle"]=$L2JBS_lang["clantop_dioncastle"]; break;
    case 3: $show["hasCastle"]=$L2JBS_lang["clantop_girancastle"]; break;
    case 4: $show["hasCastle"]=$L2JBS_lang["clantop_orencastle"]; break;
    case 5: $show["hasCastle"]=$L2JBS_lang["clantop_adencastle"]; break;
    case 6: $show["hasCastle"]=$L2JBS_lang["clantop_innadrilcastle"]; break;
    default: $show["hasCastle"]=$L2JBS_lang["clantop_nocastle"];
  }

  @eval('print "<table border="1">\n<caption>".'.$L2JBS_lang["clanview_captiontemplate"].'."</caption>";');
 





 $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]="";

print '
<thead>
<tr style="vertical-align: bottom;">
 <th class="sortedColumn">'.$L2JBS_lang["_table_position"].' </th>
 

<th>Имя</th>
 <th>Уровень</th>
 <th>Пол</th>
 <th>Раса</th>
 <th>Класс</th>
 <th>ПвП</th>
 <th>ПК</th>
 <th>Клан</th>

</tr>

</thead>
<tfoot>
 <tr><td colspan="8" style="text-align:right;"><br>Игроков в этом клане: '.mysql_num_rows($result).'</td></tr>
</tfoot>
<tbody id="TblBdy">
';

$i=1;
while ($row=mysql_fetch_array($result))
{
  $row["sex"] = ($row["sex"]) ? Ж : М;
  switch ($row["race"])
  {
    case 1: $row["race"]=єльф; break;
    case 2: $row["race"]=дарк; break;
    case 3: $row["race"]=орк; break;
    case 4: $row["race"]=гном; break;
    default: $row["race"]=чел;
  }

  if ($i%2)
  {
    $rowstyle='';
    if (@$row["online"])
      $rowstyle=' class="online"';
  }

  else
  {
    $rowstyle=' class="alternateRow"';
    if (@$row["online"])
      $rowstyle=' class="alternateRow online"';
  }
  print ' <tr'. $rowstyle .'><td class="numeric sortedColumn">'. $i++ . '</td><td>'. $row["char_name"].'</td><td>'. $row["level"]. '</td><td>'. $row["sex"]. '</td><td>'.$row["race"]. '</td><td>'.$row["classname"]. '</td><td class="numeric">'.$row["pvpkills"]. '</td><td class="numeric">
'.$row["pkkills"].'
</td><td>
  ';
  if ($clan=$clans_array[$row["clanid"]])
    print '<a href="index.php?id=clantop">'.$clan.'</a>';
  print "</td></tr>\n";
}
print "</tbody>\n</table>\n";
mysql_close($link);
?>
