<?php
header('Content-type: text/html; charset=utf-8');
$template = '<!DOCTYPE html>
<html class="inner">
<head>
<title>'.$PRETITLE.' - '.$lang['titletop'].'</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/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/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"><!-- page-1 -->
	<div id="page-2"><!-- page-2 -->
	<h1 id="page-title">'.$PRETITLE.' - '.$lang['titletop'].'</h1>
	<div id="page-3"><!-- page-3 -->
	<div id="content"><div id="content-id"><!-- content --><!-- content-id -->
		<ul id="navitems">
                    <li>|<a href="'.$ROOT.'">'.$lang['Home'].'</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['Rankings'].'</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['monitor'].'</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>

<!-- template header end == begin content below -->
<!--<center><h2>'.$lang['BBest'].'</h2></center>-->
                <table align="center" class="stat sortable" width="970">
                    <tbody>
                        <th><a href="#" class="sortheader" onclick="ts_resortTable(this);return false;">&nbsp;<span class="sortarrow">&nbsp;</span></a></th>
                        <th>&nbsp;<a href="#" class="sortheader" onclick="ts_resortTable(this);return false;"><img src="'.$ROOT.'images/game-monitor/ranked.gif"><span class="sortarrow">&nbsp;&nbsp;</th>
                        <!--<th><a href="#" class="sortheader" onclick="ts_resortTable(this);return false;">'.$lang['Prifex'].'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a></th>-->
                        <th><a href="#" class="sortheader" onclick="ts_resortTable(this);return false;">'.$lang['Nick'].'<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><a href="#" class="sortheader" onclick="ts_resortTable(this);return false;">'.$lang['Scores'].'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a></th>
                        <th><a href="#" class="sortheader" onclick="ts_resortTable(this);return false;">'.$lang['Real'].'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a></th>
                        <th><a href="#" class="sortheader" onclick="ts_resortTable(this);return false;">'.$lang['Combat'].'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a></th>
                        <th><a href="#" class="sortheader" onclick="ts_resortTable(this);return false;">'.$lang['Teamwork'].'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a></th>
                        <th><a href="#" class="sortheader" onclick="ts_resortTable(this);return false;">'.$lang['Commander'].'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a></th>
                        <th><a href="#" class="sortheader" onclick="ts_resortTable(this);return false;">'.$lang['Country'].'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a></th>';
                        
                        foreach ($topten as $key => $value)
                        {
                            $value['name'] = preg_replace("/>/","&gt;",$value['name']);
                            $value['name'] = preg_replace("/</","&lt;",$value['name']);
                        
                        // open
                        //$p_name  = $value['name'];
                        //$c_name = explode(" ", $p_name);
                        //$c_name = explode(" ", $value['name']);
                        // closed
                        $template .= '</tr>
                        <tr>
                        <td>'.($value['num']+1).'</td>
                        <td><div align="center"><img src="'.$ROOT.'images/game-images/ranks/icon/rank_'.$value['rank'].'.gif">&nbsp;</div></td>
                        <!--<td><div align="center">'.$c_name[0].'</div></td>-->
                        <td><a href="'.$ROOT.'?pid='.$value['id'].'">'.$value['name'].'</a>&nbsp;</td>
                        <!--<td><a href="'.$ROOT.'?pid='.$value['id'].'">'.$c_name[1].'</a>&nbsp;</td>-->
                        <td><div align="center">'.intToTime($value['time']).'</div></td>
                        <td>'.$value['score'].'</td>
                        <td>'.$value['real'].'</td>
                        <td>'.$value['skillscore'].'</td>
                        <td>'.$value['teamscore'].'</td>
                        <td>'.$value['cmdscore'].'</td>
                        <td><div align="center"><img src="'.$ROOT.'images/game-images/flags/'.strtoupper($value['country']).'.png" height="15" width="19"></td>
			</tr>';
                        }
$template .= '
                    </tbody>
                </table>
	<!-- end content == footer below -->	
	<hr class="clear">	
	</div></div> <!-- content-id --><!-- content -->
	</div>
	</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">'.$lang['Russian'].'</option>
                    <option value="en">'.$lang['English'].'</option>
                    </select>
                    <input type="submit" value="'.$lang['selectsave'].'" />
                    </form>
                </div><!-- / Language -->
            <div class="footer_mod_right">
    <a href="#top">'.$lang['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['BF2SCMSharK'].'<br/></div>
    </div>
        </div><!-- footer -->
</div><!-- page-1 -->';
$template .= '</body>
</html>';
?>