<? require("counterstrike.php"); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=ISO-8859-1">
<title>Counterstrike status</title>
<script type="text/javascript">
function player_popup(serveraddress,serverport) {
    window.open('showplayers.php?serveradr=' + serveraddress + '&serverport=' + serverport ,'','width=325,height=450,left=100,top=100,resizable=1,scrollbars=yes');
}
function rules_popup(serveraddress,serverport) {
    window.open('showrules.php?serveradr=' + serveraddress + '&serverport=' + serverport ,'','width=400,height=450,left=450,top=100,resizable=1,scrollbars=yes');
}
</script>
</head>
<body>
<div align="center">
<table>
<?
  $serveradr 
="213.8.254.142";
  
$serverport="27091";
  
$csinfo=new CounterStrike;
  
$status=$csinfo->getServerInfo($serveradr,$serverport,3000);
  if (
$status) {
?>
<tr>
<td>
  <table>
  <tr>
    <td>Servername : </td><td><?=$csinfo->m_servervars["servername"?></td>
  </tr>
  <tr>
    <td>Serveraddress : </td><td><?=$csinfo->m_servervars["serveraddress"?></td>
  </tr>
  <tr>
    <td>Players : </td><td><?=$csinfo->m_servervars["currentplayers"?> af <?=$csinfo->m_servervars["maxplayers"]?></td>
  </tr>
  <tr>
    <td>Map : </td><td><?=$csinfo->m_servervars["mapname"]?></td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2" align="center">
    <IMG SRC="/images/csmaps/<?=$csinfo->m_servervars["mapname"]?>.jpg" width="218" height="163" ALT="<?=$csinfo->m_servervars["mapname"]?>">
    </td>
  </tr>
  <tr>
    <td valign="top" align="center"><font size="1">
        <a href="javascript:player_popup('<?=$serveradr?>','<?=$serverport?>');" onMouseOver="window.status='Show Playerinfo'; return true;" onMouseOut="window.status=' ';return true;">Players</a></font>
    </td>
    <td valign="top" align="center"><font size="1">
      <A HREF="javascript:rules_popup('<?=$serveradr?>','<?=$serverport?>');" onMouseOver="window.status='Show serverrules'; return true;" onMouseOut="window.status=' ';return true;">Rules</a></font>
    </td>
  </tr>
  </table>    
</td>
</tr>
<? } else { ?>
<tr>
  <td colspan="2">Error communicating with server</td>
</tr>
<? ?>
<tr>
  <td colspan="2"><hr></td>
</tr>
<tr>
  <td colspan="2" align="center">Sourcefiles</td>
</tr>
<tr>
  <td colspan="2" align="center"><a href="show_csstatus.php">csstatus.php</a></td>
</tr>
<tr>
  <td colspan="2" align="center"><a href="show_showplayers.php">showplayers.php</a></td>
</tr>
<tr>
  <td colspan="2" align="center"><a href="show_showrules.php">showrules.php</a></td>
</tr>
<tr>
  <td colspan="2" align="center"><a href="show_showcounterstrike.php">counterstrike.php</a></td>
</tr>
</table>
</div>    
</body>
</html>