<?php
/*======================================================================*\
|| #################################################################### ||
|| # EoT-Clan BF3 Leaderboard                                         # ||
|| # ---------------------------------------------------------------- # ||
|| # Dieses Copyright darf nicht entfernet werden                     # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # -----------------BF3 Leaderboard is a free Software--------------# ||
|| #                   http://eot-clan.net                            # ||
|| #################################################################### ||
\*======================================================================*/

require_once ('inc/config.php');
require_once ('language/'.$row['language'].'.php');
	error_reporting(0);

$_GET = security::escape($_GET);
$_POST = security::escape($_POST);

 if ($row['History'] != 1){
 echo '<title>History Disabled</title>
     '.$styleSettings.'
         <table class="defaultUpdate" style="width:470px; margin-left: -250px;margin-top: -100px;position: absolute;left: 50%;top: 50%;" border="0" cellspacing="0" cellpadding="4"><td>
'.LANG_HISTORY_DISABLED.'
</td></table>';
 	exit;
}
$bListed = false;
$pid = $_GET['pid'];
$EoT = new eGamersofTomorrow;
$xajax = new xajax();
$xajax->configure('javascript URI', 'js/xajax');

$xajax->register(XAJAX_FUNCTION, 'skimHistory');

$xajax->processRequest();

if (!$pid){
   include ("error/errorHistory.html");
   exit;
 }

	$query = "SELECT * FROM ".DBPrefix."generalStats WHERE pid = {$pid}";
	$result = mysql_query($query);
	$menge = mysql_num_rows($result);
	if ($menge == 0){
   include ("error/errorHistory.html");
   exit;
 }
	
$data = mysql_fetch_assoc($result);
	
		?>
			<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
		<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="de">
		<head>
			 <title>History -<?php echo htmlspecialchars($data['soldiername']); ?></title>
			 <?php $xajax->printJavascript(); ?>
			   <meta  http-equiv="Content-Type"  content="text/html; charset=utf-8" />
			<?php echo $styleSettings; ?>
		</head>
		<body>
			
				<table id='historyTable' class="defaultUpdate" style="border-radius: 5px 5px 0px 0px; -webkit-border-radius:5px 5px 0px 0px; border-radius:5px 5px 0px 0px;" cellspacing="0" cellpadding="0">
				<?php
				echo history::createTable($pid);
				$iLastPage = history::countEntries($pid) / history::HISTORY_LINES + 1;
				?>
				 </table>
				 <table  class="defaultUpdate" style="margin-top:-11px;border-radius: 0 0 5px 5px;-webkit-border-radius:0px 0px 5px 5px; border-radius:0px 0px 5px 5px;" cellspacing="0" cellpadding="0">
				 	<td>
				<div style='width: 90%; text-align: center; margin: auto; height: 24px; padding-top: 7px;'>
					<img id="history_first" class="history_page_1" alt="first page" src="img/skip_beginn.png" style='display: none; float: left; cursor: pointer;' onclick="xajax_skimHistory(<?php echo $pid; ?>, this.className);" />
					<img id="history_prev" class="history_page_0" alt="previous page" src="img/back_h.png" style='display: none; margin-left: 10px; float: left; cursor: pointer;' onclick="xajax_skimHistory(<?php echo $pid; ?>, this.className);" />
					<?php if ($iLastPage > 2) { ?>
						<img id="history_next" class="history_page_2" alt="next page" src="img/next.png" style='margin-right: 26px; float: right; cursor: pointer;' onclick="xajax_skimHistory(<?php echo $pid; ?>, this.className);" />
						<img id="history_last" class="history_page_<?php echo floor($iLastPage); ?>" alt="last page" src="img/skip_end.png" style='margin-right: -56px; float: right; cursor: pointer;' onclick="xajax_skimHistory(<?php echo $pid; ?>, this.className);" />
					<?php } ?>
				</td></table>
				<?php

					  echo '
					</div>
			</html>
		<body>';
			
		
		?>
	