<?
/*
* IMC2 Server Stats PHP file
* Ver 1.5
* By: Xorith
*
* Ver 1.6 updates by Samson
*
* Please see 'imcserverstats.class' for instructions on setup.
*
* This file is an example of how to use the class provided. Feel free to use it or create your own
* based on this file.
*
*/
include( "imcserverstats.class" );
$imcstats = new HubStats;
$imcstats->setup();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' dir='ltr'>
<head>
<meta name="description" content="Statistics for <?=$imcstats->name?>, on the <?=$imcstats->network?> Intermud Communication Network." />
<meta name="keywords" content="imc,imc2,imc3,intermud,network,<?=$imcstats->network?>,<?=$imcstats->name?>" />
<meta name="robot" content="index,follow" />
<title><?=$imcstats->network?>: <?=$imcstats->name?> Stats</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<table class='footer'>
<tr>
<td align='center'>
Below are the stats for <?=$imcstats->name?> running on the <a href="<?=$imcstats->addr?>"><?=$imcstats->network?> Intermud Communication Network.</a>
</td>
</tr>
<tr>
<td align='center'> </td>
</tr>
</table>
<table class='main'>
<tr>
<td colspan="3"><span class="sectionheader">General Information</span></td>
</tr>
<tr>
<td class='section'><span class="section">Name:</span></td>
<td colspan="2"><span class="value"><?=$imcstats->name?></span></td>
</tr>
<tr>
<td class='section'><span class="section">IMC2 Version:</span></td>
<td colspan="2"><span class="value"><?=$imcstats->vers?></span></td>
</tr>
<tr>
<td class='section'><span class="section">Server booted at:</span></td>
<td colspan="2"><span class="value"><?=$imcstats->imcboot?></span></td>
</tr>
<tr>
<td class='section'><span class="section">Server has been up for:</span></td>
<td colspan="2"><span class="value"><?=$imcstats->imc_up_for()?></span></td>
</tr>
<tr>
<td colspan="3"><hr /></td>
</tr>
<tr>
<td colspan="3"><span class="sectionheader">Network Stats</span></td>
</tr>
<tr>
<td class='section'><span class="section">Packets Received:</span></td>
<td colspan="2"><span class="value"><?=number_format($imcstats->rxpkts, 0, ' ', ',')?></span></td>
</tr>
<tr>
<td class='section'><span class="section">Bytes Received:</span></td>
<td colspan="2"><span class="value"><?=number_format($imcstats->rxbytes, 0, ' ', ',')?></span>
<span class="section"> (</span><span class="value">Avg: <?=number_format($imcstats->rxbps, 0, '.', ',')?> bytes per second</span>
<span class="section">)</span>
</td>
</tr>
<tr>
<td class='section'><span class="section">Packets Sent:</span></td>
<td colspan="2"><span class="value"><?=number_format($imcstats->txpkts, 0, ' ', ',')?></span></td>
</tr>
<tr>
<td class='section'><span class="section">Bytes Sent:</span></td>
<td colspan="2"><span class="value"><?=number_format($imcstats->txbytes, 0, ' ', ',')?></span>
<span class="section"> (</span><span class="value">Avg: <?=number_format($imcstats->txbps, 0, ' ', ',')?> bytes per second</span>
<span class="section">)</span>
</td>
</tr>
<tr>
<td class='section'><span class="section">Largest Packet:</span></td>
<td colspan="2"><span class="value"><?=number_format($imcstats->maxpktsz, 0, ' ', ',')?></span></td>
</tr>
<tr>
<td class='section'><span class="section">Events Pending:</span></td>
<td colspan="2"><span class="value"><?=number_format($imcstats->events, 0, ' ', ',')?></span></td>
</tr>
<tr>
<td class='section'><span class="section">Sequence Drops:</span></td>
<td colspan="2"><span class="value"><?=number_format($imcstats->seqdrops, 0, ' ', ',')?></span></td>
</tr>
<tr>
<td class='section'><span class="section">Connections:</span></td>
<td colspan="2"><span class="value"><?=number_format($imcstats->whototal, 0, ' ', ',')?></span></td>
</tr>
<tr>
<td colspan="3"><hr /></td>
</tr>
<tr>
<td colspan="3"><span class="sectionheader">Who's Connected</span></td>
</tr>
<tr>
<td><span class="connlisttop">Name</span></td>
<td><span class="connlisttop">Status</span></td>
<td><span class="connlisttop">Type</span></td>
</tr>
<?=$imcstats->print_wholist()?>
</table>
<hr />
<table class='main'>
<tr>
<td align='center'>
<span class="footer">Note: The server refreshes this data every 15 seconds.<br />
The server last refreshed this data: <?=$imcstats->lastdump?><br />
The current server time is: <?=strftime( "%a %b %e, %Y at %I:%M:%S%p %Z",time())?><br />
Data provided by Xorith's IMC2 Server WebStats script, version <?=$imcstats->script_ver?><br />
This script was last updated on <?=$imcstats->last_script_update?>
</span>
</td>
</tr>
</table>
<table class='footer'>
<tr>
<td align='center'>
<a href="http://validator.w3.org/check?uri=referer" onclick="window.open(this.href,'_blank');return false;">
<img style="border:0;width:88px;height:31px" src="valid-xhtml11.png" alt="Valid XHTML 1.1!" title="Valid XHTML 1.1!" />
</a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" onclick="window.open(this.href,'_blank');return false;">
<img style="border:0;width:88px;height:31px" src="valid-css.png" alt="Valid CSS!" title="Valid CSS!" />
</a>
</td>
</tr>
</table>
</body>
</html>