<table align="center" width="908" border="0">
<tr>
<td width="256">
<?php
if(isset($_SESSION['ip'])){
echo "<font size='+1'><a href='../index.html'>Back to HomePage</a> | <a href='addnew.php'>Add New Sever</a> | <a href='editserver.php'>Server CP</a></font>";
}else{
echo "<h5><a href='../index.html'>Back to Homepage</a> | <a href='addnew.php'>Add New Sever</a> | <a href='editlogin.php'>Login</a></h5>";
}
?></td>
<td width="642"></td>
</table>
<center><div id="content">
<table width="754" cellspacing="0" cellpadding="0" class="newslist">
<tr>
<td>
<center><div class="Toplist-line-thing style7 style8"><font size="+3">Toplist</font></div></center>
<p />
</td>
</tr>
<tr>
<td id="newslist">
<?php
include('inc/open.php');
echo "
<h2><font color='#f3b13f'>Sponsored Servers</font></h2>";
$result = mysql_query("SELECT * FROM status WHERE sponsor='1' and status='1' ORDER BY votes DESC",$db);
if(isset($_SESSION['ip'])){
echo "<font color='#999999' size='+1'>Welcome </font><font color='#f3b13f'>" .$_SESSION['owner']. "</font>.<font color='#999999'> Your server IP is: </font><font color='#f3b13f'>".$_SESSION['ip']."</font><font color='#999999'>.</font>";
}else{
echo "<font color='#999999' size='+1'>You are not logged on.</font>";
}
echo "<table border='0' width='90%' align='center'>
<tr>
<td width='15%' bgcolor='#d0d0d0' align='center'><b>Server Name</b></td>
<td width='10%' bgcolor='#d0d0d0' align='center'><b>Version</b></td>
<td width='15%' bgcolor='#d0d0d0' align='center'><b>Owner</b></td>
<td width='15%' bgcolor='#d0d0d0' align='center'><b>Votes</b></td>
<td width='15%' bgcolor='#d0d0d0' align='center'><b>Uptime</b></td>
<td width='15%' bgcolor='#d0d0d0' align='center'><b>Status</b></td>
</tr>";
while ($myrow = mysql_fetch_array($result))
{
$uptime_calc = $myrow['checks'] - $myrow['down'];
$uptime = round( ($uptime_calc/$myrow['checks'])*100, 0 );
echo "
<tr>
<td align='center'><a href=viewserver.php?id=".$myrow['id'].">".$myrow['name']."</a>
<td align='center' font color='#f3b13f'>".$myrow['version']."</font>
<td align='center' font color='#f3b13f'>".$myrow['owner']."</font>
<td align='center' font color='#f3b13f'>".$myrow['votes']."</font>
<td align='center' font color='#f3b13f'>".$myrow['uptime']."%</font>";
echo "<td align='center'>";
if (! $sock = @fsockopen($myrow['ip'], $myrow['port'], $num, $error, 5))
mysql_query("UPDATE status SET online='0' WHERE id=".$myrow['id']."");//Offline status!! Wooot By Zant
else{
mysql_query("UPDATE status SET online='1' WHERE id=".$myrow['id']."");//Online status!! Wooot By Zant
$myrow['checks'] = $myrow['checks'] + 1;
fclose($sock);
}
if ($myrow['online'] == 1) {//Online status!! Wooot By Zant
echo '<font color=lime>Online</font>';
}else{
echo '<font color=red>Offline</font>';
}
}
echo "</td></table>";
echo "<br />";
echo "<br />";
echo "<br />";
echo '<hr width="100%"/>';
echo "<h2><font color='#999999'>Regular Servers</font></h2>";
$result = mysql_query("SELECT * FROM status WHERE sponsor='0' and status='1' ORDER BY votes DESC",$db);//Changed status to votes :)
echo "<table border='0' width='90%' align='center'>
<tr>
<td width='15%' bgcolor='#d0d0d0' align='center'><b>Server Name</b></td>
<td width='10%' bgcolor='#d0d0d0' align='center'><b>Version</b></td>
<td width='15%' bgcolor='#d0d0d0' align='center'><b>Owner</b></td>
<td width='15%' bgcolor='#d0d0d0' align='center'><b>Votes</b></td>
<td width='15%' bgcolor='#d0d0d0' align='center'><b>Uptime</b></td>
<td width='15%' bgcolor='#d0d0d0' align='center'><b>Status</b></td>
</tr>";
while ($myrow = mysql_fetch_array($result))
{
echo "
<tr>
<td align='center' font color='#f3b13f'><a href=viewserver.php?id=".$myrow['id'].">".$myrow['name']."</a>
<td align='center' font color='#999999'>".$myrow['version']."</font>
<td align='center' font color='#999999'>".$myrow['owner']."</font>
<td align='center' font color='#999999'>".$myrow['votes']."</font>
<td align='center' font color='#999999'>".$myrow['uptime']."%</font>";
echo "<td align='center'>";
if (! $sock = @fsockopen($myrow['ip'], $myrow['port'], $num, $error, 5))
mysql_query("UPDATE status SET online='0' WHERE id=".$myrow['id']."");
else{
mysql_query("UPDATE status SET online='1' WHERE id=".$myrow['id']."");
$myrow['checks'] = $myrow['checks'] + 1;
fclose($sock);
}
if ($myrow['online'] == 1) {
echo '<font color=lime>Online</font>';
}else{
echo '<font color=red>Offline</font>';
}
}
echo "</td></table>";
?>
</td>
</tr>
</table>
</div></center>