<?php
$i=0;
for ($i=0; $i<count($servers); $i++)
{
$rowdata = $servers[$i];
$server_id = $rowdata['serverId'];
$c = ($i % 2) + 1;
if ($rowdata["statusurl"])
{
$addr = $rowdata["addr"];
#$addr = "<a href=\"" . $rowdata["statusurl"] . "\">"
# . $rowdata["addr"] . "</a>";
}
else
{
$addr = $rowdata["addr"];
}
$kills = $rowdata['kills'];
$headshots = $rowdata['headshots'];
$player_string = $rowdata['act_players']."/".$rowdata['max_players'];
$map_teama_wins = $rowdata['map_ct_wins'];
$map_teamb_wins = $rowdata['map_ts_wins'];
?>
<table width="95%" align="center" border=0 cellspacing=1 cellpadding=2 bgcolor="<?php echo $g_options["table_border"]; ?>">
<tr valign="bottom" bgcolor="<?php echo $g_options["table_head_bgcolor"]; ?>">
<td style="padding:4px;" width="37%"><?php echo $g_options["font_small"]; ?><font color="<?php echo $g_options["table_head_text"]; ?>"> Server</font><?php echo $g_options["fontend_small"]; ?></td>
<td style="padding:4px;" width="23%"><?php echo $g_options["font_small"]; ?><font color="<?php echo $g_options["table_head_text"]; ?>"> Address</font><?php echo $g_options["fontend_small"]; ?></td>
<td style="padding:4px;" width="6%" align="center"><?php echo $g_options["font_small"]; ?><font color="<?php echo $g_options["table_head_text"]; ?>"> Map</font><?php echo $g_options["fontend_small"]; ?></td>
<td style="padding:4px;" width="6%" align="center"><?php echo $g_options["font_small"]; ?><font color="<?php echo $g_options["table_head_text"]; ?>"> Played</font><?php echo $g_options["fontend_small"]; ?></td>
<td style="padding:4px;" width="10%" align="center"><?php echo $g_options["font_small"]; ?><font color="<?php echo $g_options["table_head_text"]; ?>"> Players</font><?php echo $g_options["fontend_small"]; ?></td>
<td style="padding:4px;" width="6%" align="center"><?php echo $g_options["font_small"]; ?><font color="<?php echo $g_options["table_head_text"]; ?>"> Kills</font><?php echo $g_options["fontend_small"]; ?></td>
<td style="padding:4px;" width="6%" align="center"><?php echo $g_options["font_small"]; ?><font color="<?php echo $g_options["table_head_text"]; ?>"> Headshots</font><?php echo $g_options["fontend_small"]; ?></td>
<td style="padding:4px;" width="6%" align="center"><?php echo $g_options["font_small"]; ?><font color="<?php echo $g_options["table_head_text"]; ?>"> Hpk</font><?php echo $g_options["fontend_small"]; ?></td>
</tr>
<tr valign="middle" bgcolor="<?php echo $g_options["table_bgcolor$c"]; ?>">
<td align="left" style="background:white;color:black"><?php
echo $g_options["font_normal"];
$imgfile = $g_options["imgdir"] . "/game-$game.gif";
echo "<img style=\"vertical-align:middle;\"src=\"";
if (file_exists($imgfile))
echo $imgfile;
else
echo $g_options["imgdir"] . "/game.gif";
echo "\"> ";
echo "<b><a href=\"".$g_options["scripturl"]."?mode=servers&server_id=$server_id&game=$game\" style=\"color:black;text-decoration:none;\">".$rowdata["name"]."</a></b>";
echo $g_options["fontend_normal"]; ?></td>
<td align="left" style="background:white;color:black"><?php
echo $g_options["font_normal"];
echo "<a href=\"hlsw://$addr\" style=\"color:black\">$addr</a>";
echo $g_options["fontend_normal"];
?></td>
<td align="center" style="background:white;color:black"><?php
echo $g_options["font_normal"];
echo $rowdata['act_map'];
echo $g_options["fontend_normal"];
?></td>
<td align="center" style="background:white;color:black"><?php
$stamp = time()-$rowdata['map_started'];
$hours = sprintf("%02d", floor($stamp / 3600));
$min = sprintf("%02d", floor(($stamp % 3600) / 60));
$sec = sprintf("%02d", floor($stamp % 60));
echo $g_options["font_normal"];
echo $hours.":".$min.":".$sec;
echo $g_options["fontend_normal"];
?></td>
<td align="center" style="background:white;color:black"><?php
echo $g_options["font_normal"];
echo $player_string;
echo $g_options["fontend_normal"];
?></td>
<td align="center" style="background:white;color:black"><?php
echo $g_options["font_normal"];
echo number_format($kills);
echo $g_options["fontend_normal"];
?></td>
<td align="center" style="background:white;color:black"><?php
echo $g_options["font_normal"];
echo number_format($headshots);
echo $g_options["fontend_normal"];