<?require 'header.php';

if(!(isset($_SESSION["username"]) && isset($_SESSION["password"])))
{
	?>
	<script type="text/javascript">
	location.replace("login.php");
	</script>
	<noscript>
	<meta http-equiv="refresh" content="0; url=login.php">
	</noscript>
	<?
	exit();
}?>
<div class="menucenter">
<fieldset class='green'><font-size: 16px>В списке отображаются последние 20 операция с баллами.</font></fieldset>
<table class='reyt' width='100%' border='0' cellpadding='0' cellspacing='0' align='center'>
<thead><tr>
<tr><th class="top"></th>
<th class="top"><b>
Сообщение
</b></th>
<th class="top"><b>
Сумма
</b></th>
<th class="top"><b>
Дата
</b></th>
</tr>

<?

$lole=text($_SESSION["username"]);

$tabla = mysql_query("SELECT * FROM tb_infoball where user='$lole' ORDER BY id DESC limit 20");

while ($row = mysql_fetch_assoc($tabla)) {

echo "<tr><td align='center' width='24px'><img src='images/083.png' align='absmiddle'></td><td align='center'>";
echo $row["mesage"];
echo "</td><td align='center'><font color='red'>";
echo $row["ball"];
echo " балл.</font></td><td align='center'>";
?>
<?=date("H:i d.m.Y", $row["date"]); ?>
<?
echo "</td></tr>";
}

echo "</table>";

?><br />
<fieldset class='green'><font-size: 16px>Баллы связанные с WebMoney</font></fieldset>
<table class='reyt' width='100%' border='0' cellpadding='0' cellspacing='0' align='center'>
<thead><tr>
<tr><th class="top"></th>
<th class="top"><b>
Сообщение
</b></th>
<th class="top"><b>
Сумма
</b></th>
<th class="top"><b>
Дата
</b></th>
</tr>
<?

$res=mysql_query("select * from tb_users where username='$lole'");
$row=mysql_fetch_assoc($res);
$wmid=$row["wmid"];
$tabla = mysql_query("SELECT * FROM tb_infoball where user='$wmid' ORDER BY id DESC limit 20");

while ($row = mysql_fetch_assoc($tabla)) {

echo "<tr><td align='center' width='24px'><img src='images/wmr.png' align='absmiddle'></td><td align='center'>";
echo $row["mesage"];
echo "</td><td align='center'><font color='red'>";
echo $row["ball"];
echo " балл.</font></td><td align='center'>";
?>
<?=date("H:i d.m.Y", $row["date"]); ?>
<?
echo "</td></tr>";
}

echo "</table>";
require 'footer.php'; ?>
