Fixed queries and profile page.

This commit is contained in:
K. Nobel
2017-01-19 12:01:39 +01:00
parent b37d06e2cc
commit 84719529bb
5 changed files with 20 additions and 18 deletions

View File

@@ -13,7 +13,7 @@
$_SESSION["userID"] = 2;
// Get all the friends of a user.
$friends = selectAllFriends($db, $_SESSION["userID"]);
$friends = selectAllFriends($_SESSION["userID"]);
$i = 0;
// Print all the users.

View File

@@ -4,18 +4,19 @@
<div class="profile-button">
<p><img src="img/add-friend.png"> Als vriend toevoegen</p>
</div>
<h1 class="profile-username"><?php echo $user["username"] ?></h1>
<p><?php echo $user["bio"] ?></p>
<h1 class="profile-username"><?= $user["fname"]?> <?=$user["lname"]?> (<?=$user["username"]?>)</h1>
<p><?=$user["bio"]?></p>
</div>
<div class="item-box left platform">
<h2>Vrienden</h2>
<p>
<?php
while($friend = $friends->fetch()) {
echo "<a href='#' data-title='" . $friend["username"] . "'><img class='profile-picture' src='" . $friend["profilepicture"] . "' alt='" . $friend["username"] . "'s profielfoto></a>";
while($friend = $profile_friends->fetch()) {
echo "<a href='#' data-title='${friend["username"]}'><img class='profile-picture' src='${friend["profilepicture"]}' alt='${friend["username"]}'s profielfoto></a>";
}
if($friends->rowCount() === 0) {
echo "<p>Deze gebruiker heeft nog geen vrienden gemaakt.</p>";
}
@@ -27,7 +28,7 @@
<h2>Groepen</h2>
<p>
<?php
while($group = $groups->fetch()) {
while($group = $profile_groups->fetch()) {
echo "<a href='#' data-title='${group["name"]}'><img class='group-picture' src='${group["picture"]}' alt='${group["name"]}s logo'></a>";
}
@@ -51,4 +52,5 @@
";
}
?>
</div>
</div>