-
Notifications
You must be signed in to change notification settings - Fork 0
/
public_reviews.php
56 lines (52 loc) · 1.76 KB
/
public_reviews.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html>
<head>
<title>Friend Reviews</title>
<?php include_once 'header.php'; ?>
</head>
<body>
<section id="head-bar">
<?php include_once 'navbar.php'; ?>
</section>
<div class="container">
<?php
require_once 'mediapost.php';
require_once 'user.php';
$user_object = new User();
$post = new MediaPost();
$reviews = $post->getAllReviews();
while ($review = $reviews->fetch_object()) {
$media = $post->getMediaById($review->media);
$user = $post->getUserById($review->user);
$full_user_name = $user_object->getFullNameById($review->user);
$url_link = "conversation.php?friend_id=" . $review->user;
?>
<div class="well">
<div class="page-header">
<h3><?php echo $media->title; ?></h3>
<h5><a href="<?php echo $url_link; ?>" >from:
<?php
echo $full_user_name;
?>
</a></h5>
<h5>
written on:
<?php
echo $review->date_created;
?>
</h5>
<?php
for ($i = 0; $i < $review->rating; $i++)
echo '<span class="glyphicon glyphicon-star"></span>';
?>
<p>
<?php echo $review->comment; ?>
</p>
</div>
</div>
<?php
}
?>
</div>
</body>
</html>