-
Notifications
You must be signed in to change notification settings - Fork 0
/
friend_reviews.php
98 lines (93 loc) · 3.78 KB
/
friend_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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!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
if(isset($_SESSION['authenticated_user'])) {
require_once 'mediapost.php';
$post = new MediaPost();
$user_object = new User();
$recommendations = $post->getRecommendationsForUser($_SESSION['authenticated_user']);
if ($recommendations && $recommendations->num_rows > 0) {
while ($recommendation = $recommendations->fetch_object()) {
$full_user_name = $user_object->getFullNameById($recommendation->from_user);
$url_link = "conversation.php?friend_id=" . $recommendation->from_user;
$media = $post->getMediaById($recommendation->media);
$user = $post->getUserById($recommendation->from_user);
?>
<div class="well">
<div class="page-header">
<div class="row">
<div class="col-md-8">
<h3><?php echo $media->title; ?></h3>
<h5><a href="<?php echo $url_link; ?>" >Ya Boy:
<?php
echo $full_user_name;
?>
</a>
(
<?php
echo $user->email;
?>
)
</h5>
<h5>
written on:
<?php
echo $recommendation->date_created;
?>
</h5>
<?php
for ($i = 0; $i < $recommendation->rating; $i++)
echo '<span class="glyphicon glyphicon-star"></span>';
?>
<p>
<?php echo $recommendation->comment; ?>
</p>
</div>
<div class="col-md-4">
<form action="recommend.php" method="POST">
<div class="form-group">
<label for="recommend-back">
<input type="hidden" name="holla_id" value="<?php echo $user->email; ?>">
<input type="submit" class="btn btn-success btn-lg" style="margin-top:10%;" value="Holla Back" />
</label>
</div>
</form>
</div>
</div>
</div>
</div>
<?php
}
}
else {
?>
<div class="well">
<div class="page-header">
<h3>No personal recommendaions yet. Tell your boys to hit you up!</h3>
</div>
</div>
<?php
}
?>
<?php
}
else{
?>
<div class="page-header">
<span><strong>You must <a href="signin.php">sign in </a>to view this content</strong></span>
</div>
<?php
}
?>
</div>
</body>
</html>