<?php
session_start();
if(!isset($_SESSION['MM_Username']))
{
header("Location: secured.php" );
}
if(isset($_GET['uitlog']))
{
unset($_SESSION['MM_Username']);
header("location:index.php");
}
//Alles van de gebruiker ophalen
mysql_select_db($database_connect, $connect);
$query_Recordset1 = "SELECT * FROM user WHERE username = '".$_SESSION['MM_Username']."'";
$Recordset1 = mysql_query($query_Recordset1, $connect) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
//Profiel foto van de gebruiker
mysql_select_db($database_connect, $connect);
$query_Recordset2 = "SELECT * FROM photo WHERE username = '".$_SESSION['MM_Username']."' AND profiel = '1'";
$Recordset2 = mysql_query($query_Recordset2, $connect) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
//Fotos van de gebruiker ophalen
mysql_select_db($database_connect, $connect);
$query_Recordset3 = "SELECT * FROM photo WHERE username = '".$_SESSION['MM_Username']."'";
$Recordset3 = mysql_query($query_Recordset3, $connect) or die(mysql_error());
$row_Recordset3 = mysql_fetch_assoc($Recordset3);
$totalRows_Recordset3 = mysql_num_rows($Recordset3);
//Bereken leeftijd gebruiker
error_reporting(E_ALL);
function leeftijd($dag, $maand, $jaar)
{
if( $dag <= date('d') AND $maand <= date('m') )
{
$leeftijd = date('Y') - $jaar;
return $leeftijd;
}
else
{
$leeftijd = date('Y') - $jaar - 1;
return $leeftijd;
}
}
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>profiel.nl - <?php echo $_SESSION['MM_Username'];?>'s pagina </title>
<link rel="stylesheet" type="text/css" href="includes/style.css"/>
</head>
<body>
<center>
<div id="container">
<!-------------------- Header --------------------->
<div id="header">
<div id="useri">
<table align="right">
<tr>
<td>
<a href="mhome.php">
<img class="profimg" src="<?php echo $row_Recordset2['pad']; ?>" />
</a>
</td>
</tr>
</table>
<table align="right">
<tr>
<td><a href="mhome.php?uitlog=true">Uitloggen</a></td>
<td>|</td>
<td><a href="mhome.php"><?php echo $row_Recordset1['voornaam']; ?></a></td>
</tr>
</table>
</div>
<img src="includes/images/logo.png" alt="Logo" />
</div>
<!-------------------- Menu ----------------------->
<?php
include("includes/menu.php");
?>
<!-------------------- Content -------------------->
<div id="content">
<h1><?php echo $row_Recordset1['voornaam'];?></h1>
<div id="profielColOne">
<img class="profimggroot" src="<?php echo $row_Recordset2['pad']; ?>" height="90px" width="120px" />
<a href="edit.php">
Wijzig foto
</a>
</div>
<div id="profielColTwo">
try?
</div>
<div id="profielColThree">
try2?
</div>
</div>
<?php include("includes/footer.php");?>
</div>
</center>
</body>
</html>