<?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>'.$PRETITLE.' - '.$lang_titlemytop.'</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">

	<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_titlemytop.'</h1>
		<div id="page-3">
	
			<div id="content"><div id="content-id"><!-- template header end == begin content below -->
	
		<ul id="navitems">
			<li>|<a href="'.$ROOT.'">'.$lang_main.'</a>|</li>
            <li><a href="'.$ROOT.'/forum">'.$lang_forum.'</a>|</li>
            <li><a href="'.$ROOT.'?go=stats">'.$lang_top.'</a>|</li>
            <li><a href="'.$ROOT.'?go=currentranking">'.$lang_currentranking.'</a>|</li>
            <li><a href="'.$ROOT.'?go=lastrounds">'.$lang_lastrounds.'</a>|</li>
            <li><a href="'.$ROOT.'?go=banlist">'.$lang_banlist.'</a>|</li>
            <li><a href="'.$ROOT.'monitor.php">'.$lang_monetor.'</a>|</li>
			<li><a href="'.$ROOT.'?go=faq">'.$lang_faq.'</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_search.':</label>
			<input type="text" name="searchvalue" id="pid" value="" />
			<input type="submit" class="btn" value="Go" />
		</form>
				<div id="mlb-instructions">
					'.$lang_textleader.'
					
					<p class="poof">
						This service will work for BF2 players only. They must play on leased,
						rented, or public Ranked Servers for the EA game Battlefield 2 in order
						for this gaming website to be able to track their stats.
					</p>

					<form action="'.$ROOT.'?go=my-leaderboard" method="post">
						<label>'.$lang_pidleader.': <br><input name="leaderboard" size="80" value="'.$LEADERBOARD.'" type="text"></label>
						<input name="set" value="'.$lang_saveleader.'" type="submit">
						<input name="get" value="'.$lang_getleader.'" type="submit">
					</form>

					'.$lang_textleader2.'

				</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_pl.'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a></th> <!-- colspan="2" -->
						<th><a href="#" class="sortheader" onClick="ts_resortTable(this);return false;">'.$lang_lastScore.'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a></th>
						<th><a href="#" class="sortheader" onClick="ts_resortTable(this);return false;">'.$lang_TopSPM.'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a></th>
						<th><a href="#" class="sortheader" onClick="ts_resortTable(this);return false;">'.$lang_KDRatio.'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a></th>
						<th><a href="#" class="sortheader" onClick="ts_resortTable(this);return false;">'.$lang_Total.'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a></th>
						<th class="nosort">'.$lang_LastUpdate.'</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="Remove A Player" src="'.$ROOT.'site-images/user_delete.png"></th>
					</tr>';

				foreach ($LEADER as $key => $value)
				{
				
				$value['name'] = preg_replace("/>/","&gt;",$value['name']);
				$value['name'] = preg_replace("/</","&lt;",$value['name']);
				
					$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="Remove '.$value['name'].'" href="'.$ROOT.'?go=my-leaderboard&amp;remove='.$value['id'].'">
							<img nicetitle="Remove '.$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 -->
	</div><!-- page 2 -->
	
<div id="footer"><br>
	'.$lang_footerPROCESSED.'.<br>
    '.$lang_copyrightProject.'<br/>
    <!-- Уважайте мою работу - не трогайте нижнюю строчку... (^ω^)/ -->
    '.$lang_copyrightBF2REW.'<br/>
    '.$lang_copyrightShark.'<br/></div>
	

</div><!-- page 1 -->
</body>
</html>';