if (isset($_GET['sid']) && intval($_GET['sid']) > 0) { $sid = intval($_GET['sid']); } else { exit("Invalid submission!"); } $submission = new Submission($sid); foreach ($submission->getReview() as $key => $value) { // Get the last id in the array $id = $submission->getLatestReview($key); if ($id > -1) { // Get review $review = new Review($id); // If comment form was submitted add the comment $commentSubmitId = 'comment' . $review->id; if (key_exists($commentSubmitId, $_POST)) { $review->addComment($_POST[$commentSubmitId]); } echo '<div class="review_box">'; echo '<p>'; // Link to review if (get_class($review->data) == "TE") { echo '<a class="bold" href="?view=reviewthesis&sid=' . $submission->id . '&uid=' . $review->user . '">'; } elseif (get_class($review->data) == "PP") { echo '<a class="bold" href="?view=reviewplan&sid=' . $submission->id . '&uid=' . $review->user . '">'; } // Is it your review or someone elses? if ($review->user == $GLOBALS['user']->id) { echo '<h4 style="margin-bottom: 0em;">Your review</h4>'; } else { echo '<h4 style="margin-bottom: 0em;">Read this review</h4>'; }