<?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><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"/>

<title>'.$PRETITLE.' - '.$lang_titlesearch.'</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/footer.css">
<link rel="stylesheet" type="text/css" media="screen" href="'.$ROOT.'css/inner.css">
<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_titlesearch.'</h1>

	<div id="page-3">
	
		<ul id="navitems">
			<li>|<a href="'.$ROOT.'">'.$lang_main.'</a>|</li>
            <li><a href="'.$ROOT.'forum.php">'.$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_searchline1.'


		<form action="?go=search" method="post">
			<label>'.$lang_search.': <br>
			<input class=input name="searchvalue" size="50" value="';
			if ($SEARCHVALUE)
				$template .= $SEARCHVALUE;
			$template .= '" type="text"></label> 
			<input class=button name="search" value="Go" type="submit">
		</form>
	</div>';
if ($SEARCHVALUE)
{
	$template .= '
	<!-- RESULTS START HERE -->
		<table width=99% id="searchresults" class="stat sortable" border="0" cellpadding="0" cellspacing="0">
			<tbody><tr>
				<th><a href="#" class="sortheader" onclick="ts_resortTable(this);return false;">'.$lang_searchresults.'<span class="sortarrow"></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_Time.'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a></th>
				<th><a href="#" class="sortheader" onclick="ts_resortTable(this);return false;">PID<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a></th>

			</tr>
	<tr>';
		for ($i=0; $i<=count($searchresults)-1; $i++){
$searchresults[$i]['name'] = preg_replace("/>/","&gt;",$searchresults[$i]['name']);
$searchresults[$i]['name'] = preg_replace("/</","&lt;",$searchresults[$i]['name']);
			$template .= '
		<td><img src="'.$ROOT.'game-images/ranks/icon/rank_'.$searchresults[$i]['rank'].'.gif" alt="" style="border: 0pt none ;"> <a href="'.$ROOT.'?pid='.$searchresults[$i]['id'].'"> '.$searchresults[$i]['name'].'</a>&nbsp;<img src="'.$ROOT.'game-images/flags/'.strtoupper($searchresults[$i]['country']).'.png" height="12" width = "16"></td>
						<td>'.$searchresults[$i]['score'].'</td>
						<td>'.$searchresults[$i]['spm'].'</td>
						<td>';
			if ($searchresults[$i]['kdr'])
				$template .= $searchresults[$i]['kdr'];
			else
				$template .= 'N/A';
			$template .= '</td>
						<td title="'.$searchresults[$i]['time'].'">'.intToTime($searchresults[$i]['time']).'</td>
						<td>'.$searchresults[$i]['id'].'</td>
		</td></tr>';
		}
	$template .= '
			    </tbody></table>
	<!-- END OF RESULT TABLE -->';
}
$template .= '
</form>
	

	<!-- end content == footer below -->
	
	<hr class="clear">
	
	</div>

<div id="footer"><!-- footer -->
<div class="footer_mod">
    <div class="footer_mod_left"><!-- Language -->
        <form method="post" id="content">
            '.$lang_select.'
            <select name="lang">
            <option value="ru">Russian</option>
            <option value="en">English</option>
            <option value="jp">Japanese</option>
            </select>
            <input type="submit" value="'.$lang_selectsave.'" />
        </form>
    </div><!-- / Language -->
    <div class="footer_mod_right">
    <a href="#top">'.$UpPage.'</a><br/>
    <!--&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<br/>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp-->
    </div>
    <div class="footer_mod_center">'.$lang_footerLASTUPDATE.'. '.$lang_footerNEXTUPDATE.'.<br>
	'.$lang_footerPROCESSED.'.<br><br/>
    '.$lang_copyrightProject.'<br/>
    <!-- Уважайте мою работу - не трогайте нижнюю строчку... (^?^)/ -->
    '.$lang_copyrightBF2REW.'<br/>
    '.$lang_copyrightShark.'<br/></div>
</div>
</div><!-- footer -->

</div>';
$template .= '	</body></html>';
?>