rendered paste body<?
ob_start();
include "functions.php";
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Battle Wars</title>
<style type="text/css">
<!--
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
color: #FFFFFF;
}
body {
background-color: #000000;
}
a {
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
color: #FFFF00;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #FFFF00;
}
a:hover {
text-decoration: underline;
color: #FF0000;
}
a:active {
text-decoration: none;
color: #FFFF00;
}
td {
border: 1px #cccccc solid;
}
th.b{
border-bottom: 1px #cccccc solid;
}
-->
</style></head>
<body>
<center><img src="/images/bw.gif" width="500" height="208" />
</center>
<table width="102%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="65%" align="center" valign="top"><p>
<form action="login.php" method="post">
Username:
<input name="luser" type="text" id="luser" />
Password:
<input name="lpass" type="password" id="lpass" />
<input name="login" type="submit" id="login" value="Login" />
<input name="reset" type="reset" id="reset" value="Reset" /></form>
<br />
<a href="register.php"> Register</a><a href="forgotpass.php"> | Forgot Password?</a></p>
</td></tr>
</table><br />
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<th style="background-color:#151B8D; color:white; border: 1px solid #3BB9FF;" align="center"><a href="index.php">Home</a>
| <a href="ranks.php">Rankings</a> | <a href="help.php">Help</a> | <a href="forumlink">Forums</a> |
<a href="chatlink">Chat</a> | <a href="cheaters.php">Cheaters</a> | <a href="awards.php">Awards</a> |
<a href="donate.php">Donate</a> | <a href="aboutus.php">About us</a> | <a href="bugfixes.php">Latest Bug Fixes</a>
| <a href="reportspam.php">Report Spam</a> | <a href="contactus.php">Contact Us</a></th></tr></table><br><br>
<center><?php include "stats.php"; ?><br />
<br />
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<table width="100%" cellpadding="0" cellspacing="0">
<tr><td style="background-color:#006600; color:#FFFFFF; border:solid 1px #00FF33;" align="center">Name</th>
<th style="background-color:#006600; color:#FFFFFF; border:solid 1px #00FF33;" align="center">Rank</th>
<th style="background-color:#006600; color:#FFFFFF; border:solid 1px #00FF33;" align="center">Army Size</th>
<th style="background-color:#006600; color:#FFFFFF; border:solid 1px #00FF33;" align="center">Gold</th>
<th style="background-color:#006600; color:#FFFFFF; border:solid 1px #00FF33;" align="center">Alliance</th>
</tr>
<?php
include_once "class.php";
mysql_connect('localhost','eric_db', 'smokey67');
mysql_select_db('eric_db');
$amount = mysql_fetch_array(mysql_query("SELECT COUNT(id)AS count FROM users"));
$amount = $amount[0];
$per_page = 25;
$pages = ceil( $amount / $per_page );
$page = min( max(1, intval( $_GET['page'] )), $pages );
$start_at = ( $page - 1 ) * $per_page;
$crit = '';
if (!empty($_GET['mode'])) {
$crit = mysql_real_escape_string($_GET['criterium']);
if ($_GET['mode'] == 'e') $crit = '%' . $crit;
elseif ($_GET['mode'] == 'c') $crit.= '%' . $crit . '%';
else $crit .= '%';
$crit = 'AND username LIKE ' . $crit;
}
$query = 'SELECT * FROM users WHERE rank > 0 ' . $crit . ' ORDER BY rank LIMIT ' . $start_at . ',' . $per_page;
$links = 2;
$query1 = mysql_query($query)or die(mysql_error());
$start = max( 1, $page - $links );
$end = $start + 2 * $links;
if( $end > $pages ) {
$end = $pages;
$start = max( 1, $end - 2 * $links );
}
$bar = array();
for( $i = $start; $i <= $end; ++$i ) {
$bar[] = '<a href=?page=' . $i . '>' . $i . '</a>';
}
while($row = mysql_fetch_array($query1)){
echo "<tr><td class='b' align='center'><a href=stats.php?id={$row['id']}>{$row['username']}</a></td>";
echo "<td class='b' align='center'>{$row['rank']}</td>";
$row['total'] = $row['asold'] + $row['dsold'] + $row['untrained'];
echo "<td class='b' align='center'>{$row['total']} {$row['race']}</td>";
$row['cash'] = number_format($row['gold']);
echo "<td class='b' align='center'>{$row['cash']}</td>";
echo "<td class='b' align='center'>{$row['alliance']}</td></tr>";
}
?>
</table>
<?php echo join( ' ', $bar );?><br>
<center><form action="" method="GET">
Search by username: <select name="mode">
<option name="s">Starts With</option>
<option name="c">Contains</option>
<option name="e">Ends With</option></select><input name="criterium" type="text"><input name="find" type="submit" value="GO"></form>
<br><table width="104%" border="0">
<tr>
<td align="center" valign="top">Created By: Eric<br />© 2007-2008 Battlewars, All right Reserved.</td>
</tr>
</table>
<p> </p>
</body>
</html>