<?php
// Profil
include "config.php";
include "sus.php";
if ($loged == "true") {

    $link = mysql_connect($baza['host'], $baza['user'], $baza['pass'])
        or die("Could not connect : " . mysql_error());
    mysql_select_db($baza['nume']) or die("Error! DataBase Name Incorrect!");
$r = mysql_query("SELECT * FROM utiliz WHERE login = '$login'") or die("Error! DataBase Name Incorrect!");;
$a = mysql_fetch_assoc($r);

$email = $a['email'];
$ip = $a['ip'];
$u_id = $a['id'];
?>
<center><h1>Hi, <?php echo $login; ?> !</h1>
<br/><table<table width="100%" border="2" cellspacing="0" cellpadding="0" align=""><tbody> <tr><td> <b>IP: </b> <?php echo $ip; ?>  <b> E-Mail: </b> <?php echo $email; ?></td></tr></tbody></table>
</center>

<br/><br/>
<center><a href='/add' ><img src='img/add.png' border=0></a>     <a href='/browse'><img src='img/all.png' border=0></a>   
 
<h2> Мои Битвы:</h2> 
<ul class="battle-list">
<?php
    $link = mysql_connect($baza['host'], $baza['user'], $baza['pass'])
        or die("Could not connect : " . mysql_error());
    mysql_select_db($baza['nume']) or die("Eroare!, nume baza de date incoreta");
$table = $baza['table'];
$r = mysql_query("SELECT * FROM $table");

while ($a = mysql_fetch_assoc($r)) {
$intrebare = $a['intrebare'];
$nume = $a['nume'];
$oponent1 = $a['oponent1'];
$oponent2 = $a['oponent2'];
$img1 = $a['img1'];
$img2 = $a['img2'];
$com1 = $a['com1'];
$com2 = $a['com2'];
$email = $a['email'];
$pass = $a['pass'];
$vote1 = $a['votes1'];
$vote2 = $a['votes2'];
$id = $a['id'];
$date = $a['date'];

$ar1 = explode('|-|', $img1);
$ar2 = explode('|-|', $img2);

$img1 = $ar1[0];
$img2 = $ar2[0];

$stroy = <<<HTML
	
		<li id="battle62" class="clr ">

	<div class="pics">
		<div class="pic1">
			
							<img width='40' height='40' src="$img1" />
						
			<div class="vote-1">
				$vote1			</div>

		</div>
		<div class="vs">
			vs		</div>

		<div class="pic2">
			
							<img width='40' height='40' src="$img2" />
							
			<div class="vote-2">
				$vote2			</div>
		</div>

	</div>
	
	<div class="title">
		<h2>

			<a href="/view_$nume">
				$intrebare		</a>
		</h2>
		

				<small>$oponent1 vs $oponent2</small>

			
	</div>
	

<br><br><br>	
</li>

HTML;

if ($a['user'] == $u_id) {
echo $stroy;
}
}

echo "</ul>";

} else {
echo "Вы Не вошли В Систему!!!";
}

include "jos.php";
?>