<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<? require("counterstrike.php");?>
<HTML>
<HEAD>
<TITLE>Players on <?=$_GET["serveradr"]?></TITLE>
</HEAD>
<BODY BGCOLOR="#C0C0C0">
<?
  $csinfo
=new CounterStrike;
  
$status=$csinfo->getServerPlayers($_GET["serveradr"],$_GET["serverport"],1000);
  if (
$status) {
?>
<TABLE>
<TR>
    <TD ALIGN="CENTER" VALIGN="TOP">
    <TABLE>
    <TR>
        <TD WIDTH="150"><STRONG>Name</STRONG></TD><TD><STRONG>Frags</STRONG></TD><TD><STRONG>Time</STRONG></TD>
    </TR>
    <TR>
        <TD COLSPAN="3"><HR></TD>
    </TR>
    <? if (is_array($csinfo->m_playerinfo)) { ?>
    <? while (list(,$player) = each ($csinfo->m_playerinfo)) { ?>
    <TR>
        <TD><?=$player["name"]?>&nbsp;</TD><TD>&nbsp;<?=$player["frags"]?></TD><TD><?=$player["time"]?></TD>
    </TR>
    <? ?>
    <? } else { ?>
    <TR>
        <TD COLSPAN="3">No players on server right now</TD>
    </TR>
    <? ?>    
    <TR>
        <TD COLSPAN="3"><HR></TD>
    </TR>
    <TR>
        <TD COLSPAN="3" ALIGN="CENTER"><FONT SIZE="1"><A HREF="showplayers.php?serveradr=<?=$serveradr?>&serverport=<?=$serverport?>">Refresh</A></FONT></TD>
    </TR>
    <TR>
        <TD COLSPAN="3">&nbsp;</TD>
    </TR>
    <TR>
        <TD COLSPAN="3" ALIGN="CENTER"><FONT SIZE="1"><A HREF="javascript:window.close()">Close window</A></FONT></TD>
    </TR>
    </TABLE>
    </TD>
</TR>
</TABLE>
<? } else { ?>
<DIV ALIGN="CENTER">Error communicating with server</DIV>
<BR>
<DIV ALIGN="CENTER"><FONT SIZE="1"><A HREF="javascript:window.close()">Close window</A></FONT></DIV>
<? ?>    
</BODY>
</HTML>