<?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:
$media_id = $post->getMediaIdByTitle($_POST['title']); $watchlist->storeListMedia($_SESSION['authenticated_user'], $media_id); } } else { if ($_SERVER['REQUEST_METHOD'] === 'GET') { if (!empty($_GET['remove_media'])) { $media_id = $_GET['remove_media']; $watchlist->removeMediaFromWatchlist($_SESSION['authenticated_user'], $media_id); } } } $list_items = $watchlist->getWatchlistForUser($_SESSION['authenticated_user']); if ($list_items) { while ($list_item = $list_items->fetch_object()) { echo '<div class="well"><div class="page-header"><h3>'; $media = $post->getMediaById($list_item->media); echo $media->title; echo "</h3>"; echo "<a class='btn btn-danger btn-sm' href='user_watchlist.php?remove_media="; echo $media->id; echo "'>Remove from Watchlist</a>"; echo "</div></div>"; } } if ($list_items->num_rows === 0) { ?> <div class="well"> <div class="page-header"> <h3>No Items in Watchlist</h3> </div> </div>
<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
$other_name = $user->getFullNameById($other_user); $messages = $message_object->getAllMessages($this_user, $other_user); $recommendations = $message_object->getAllRecommendationsForConversation($this_user, $other_user); echo "<h1>"; echo $other_name; echo "</h1>"; $recommendation = null; if ($recommendations) { $recommendation = $recommendations->fetch_object(); } if ($messages) { while ($message = $messages->fetch_object()) { if ($recommendation && $recommendation->date_created < $message->date_created) { do { if ($recommendation->to_user === $this_user) { $title = $mediapost->getMediaById($recommendation->media)->title; ?> <div class="well" style="text-align:left;"> <h3><?php echo $title; ?> </h3> <p><?php echo $recommendation->comment; ?> </p> <p> <?php //show rating in stars for ($i = 0; $i < $recommendation->rating; $i++) { echo '<span class="glyphicon glyphicon-star"></span>';