<?php
$template = '<!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" class="inner">
<head>
	<title>'.$lang['MyLeaderBoard'].', '. $TITLE .'</title>

	<link rel="icon" href="'.$ROOT.'favicon.ico" type="image/x-icon">
	<link rel="shortcut icon" href="'.$ROOT.'favicon.ico" type="image/x-icon">
	<link rel="stylesheet" type="text/css" media="screen" href="'.$ROOT.'css/two-tiers.css">
	<link rel="stylesheet" type="text/css" media="screen" href="'.$ROOT.'css/nt.css">
	<link rel="stylesheet" type="text/css" media="print" href="'.$ROOT.'css/print.css">
	<link rel="stylesheet" type="text/css" media="screen" href="'.$ROOT.'css/default.css">
	<!-- Snow effect. | START |
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
	<script type="text/javascript" src="jsnow.js"></script>
	<script type="text/javascript">
		$(function() {
			$().jSnow();
		});
	</script>
	Snow effect. |  END  | -->
	<!-- my-leaderboard.php -->

	<script type="text/javascript">/* no frames */ if(top.location != self.location) top.location.replace(self.location);</script>
	<script type="text/javascript" src="'.$ROOT.'js/nt2.js"></script>
</head>

<body class="inner">
<div id="page-1">
	<div id="page-2">
		<h1 id="page-title">'.$lang['MyLeaderBoard'].'</h1>
		<div id="page-3">
			<div id="content"><div id="content-id"><!-- template header end == begin content below -->
				<!-- 
                <ul>
					<li><a href="'.$ROOT.'">'.$lang['Home'].'</a></li>
					<li><a href="'.$ROOT.'?go=search">'.$lang['SearchStats'].'</a></li>
					<li><a href="'.$ROOT.'?go=currentranking">'.$lang['CRanking'].'</a></li>
					<li class="current"><a href="'.$ROOT.'?go=my-leaderboard">'.$lang['MyLeaderBoard'].'</a></li>
				</ul>
				-->
				<div id="mlb-instructions">
					<p>
                    '.$lang['myleadertxt1'].'

					</p>
					<p class="poof">
					'.$lang['myleadertxt2'].'
					</p>

					<form action="'.$ROOT.'?go=my-leaderboard" method="post">
						<label>'.$lang['myleadertid'].': <br><input name="leaderboard" size="80" value="'.$LEADERBOARD.'" type="text"></label>
						<input name="set" value="'.$lang['myleadersave'].'" type="submit">
						<input name="get" value="'.$lang['myleaderget'].'" type="submit">
					</form>

					<p>
						'.$lang['myleadertid2'].'
					</p>

				</div>

				<form action="/compare.php" method="get">
				<table border="0" align="center" cellpadding="0" cellspacing="0" class="stat sortable" id="myleaderboard">
				<tbody>
					<tr>
						<th><a href="#" class="sortheader" onClick="ts_resortTable(this);return false;">'.$lang['myleaderpl'].'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a></th> <!-- colspan="2" -->
						<th><a href="#" class="sortheader" onClick="ts_resortTable(this);return false;">'.$lang['myleaderScore'].'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a></th>
						<th><a href="#" class="sortheader" onClick="ts_resortTable(this);return false;">'.$lang['myleaderSPM'].'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a></th>
						<th><a href="#" class="sortheader" onClick="ts_resortTable(this);return false;">'.$lang['myleaderRKD'].'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a></th>
						<th><a href="#" class="sortheader" onClick="ts_resortTable(this);return false;">'.$lang['myleadertime'].'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a></th>
						<th class="nosort">'.$lang['myleaderLUpdate'].'</th>
						<th><a href="#" class="sortheader" onClick="ts_resortTable(this);return false;">PID<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a></th>
						<th class="nosort"><img nicetitle="'.$lang['myleaderrem1'].'" src="'.$ROOT.'site-images/user_delete.png"></th>
					</tr>';

				foreach ($LEADER as $key => $value)
				{
					$template .= '		
					<tr>
						<td>
							<img src="'.$ROOT.'game-images/ranks/icon/rank_'.$value['rank'].'.gif" alt="" style="border: 0pt none ;"> 
							<a href="'.$ROOT.'?pid='.$value['id'].'">&nbsp;'.$value['name'].'&nbsp;<img src="'.$ROOT.'game-images/flags/'.$value['country'].'.png" width="16" height="12"></a>
						</td>
						<td>'.$value['score'].'</td>
						<td>'.$value['spm'].'</td>
						<td>';
							if ($value['kdr'])
								$template .= $value['kdr'];
							else
								$template .= $value['kills'];
							$template .= '
						</td>
						<td title="'.$value['time'].'">'.intToTime($value['time']).'</td>
						<td>';
							if (getLastUpdate(getcwd().'/cache/'.$value['id'].'.cache')>0)
								$template .= intToTime(getLastUpdate(getcwd().'/cache/'.$value['id'].'.cache'));
							else
								$template .=  'N/A';
							$template .= '
						</td>
						<td>'.$value['id'].'</td>
						<td>
							<a nicetitle="'.$lang['myleaderrem2'].' '.$value['name'].'" href="'.$ROOT.'?go=my-leaderboard&amp;remove='.$value['id'].'">
							<img nicetitle="'.$lang['myleaderrem2'].' '.$value['name'].'" src="'.$ROOT.'site-images/user_delete.png"></a>
						</td>
					</tr>';
				}			
			
				$template .= '
				</tbody>
				</table>
				</form>

				<div style="margin: 20px auto 0pt; text-align: center;"></div>
				<!-- end content == footer below -->
	
				<hr class="clear">
	
			</div></div> <!-- content-id --><!-- content -->
			<a id="secondhome" href="'.$ROOT.'"> </a>

		</div><!-- page 3 -->

		<ul id="navitems">
			<li><a href="'. $ROOT .'">'.$lang['Home'].'</a></li>
			<li><a href="'. $ROOT .'?go=my-leaderboard">'.$lang['MyLeaderBoard'].'</a></li>
			<li><a href="'. $ROOT .'?go=currentranking">'.$lang['Rankings'].'</a></li>
			<li><a href="'. $ROOT .'?go=ubar">'.$lang['UBAR'].'</a></li>
			<li><a href="http://wiki.bf2s.com/">'.$lang['Wiki'].'</a></li>
		</ul>
		
		<form action="'.$ROOT.'?go=search" method="post" id="getstats">
			<label for="pid">'.$lang['GetStats'].'</label>
			<input type="text" name="searchvalue" id="pid" value="" />
			<input type="submit" class="btn" value="Go" />
		</form>

	</div><!-- page 2 -->
    <div id="footer">'.$lang['generation2'].'
            <div><!-- Language -->
            <form method="post" id="content">
            <select name="lang">
            <option value="ru">'.$lang['Russian'].'</option>
            <option value="en">'.$lang['English'].'</option>
            <option value="jp">Japanese</option>
            </select>
            <input type="submit" value="'.$lang['selectsave'].'" />
            </form>
        </div><!-- / Language -->
    </div>
</div><!-- page 1 -->
</body>
</html>';