function filter_auctions_already_rated_buyer() { $temp = null; if (isset($_SESSION['userId'])) { $temp = $_SESSION['userId']; } $_SESSION['userId'] = 38; $result = retrieve_buyer_auctions(); $result = filter_auctions_already_rated($result, ROLE_BUYER); assert($result); $not_found_expected = 1; foreach ($result as $auction) { if ($auction['auctionId'] == 13) { $not_found_expected = 0; break; } } assert($not_found_expected); if ($temp) { $_SESSION['userId'] = $temp; } }
</li> <li> <a href="#awarded-auctions"> Awarded </a> </li> </ul> </div> <div class="col-md-10"> <?php $average_stars_user = getAverageStarsForUser($userId); $auction_set_unfiltered = retrieve_buyer_auctions(); $auction_set = filter_non_expired_auctions($auction_set_unfiltered); $auction_set = filter_auctions_not_won($auction_set, $_SESSION['userId']); $auction_set = filter_auctions_already_rated($auction_set, $_SESSION['role']); if ($auction_set) { $output = "\n <div class=\"alert alert-warning\" role=\"alert\">\n <button type=\"button\" class=\"close fui-cross\"\n data-dismiss=\"alert\">\n </button>\n <h4>Leave Feedback!</h4>\n <table class=\"table\" id=\"table-account-feedback\">\n <col width=\"200px\">"; foreach ($auction_set as $auction) { $encoded_seller_id = urlencode(htmlentities($auction['seller'])); $encoded_auction_id = urlencode(htmlentities($auction['auctionId'])); $imageName = htmlentities($auction['imageName']); $title = htmlentities($auction['title']); $description = htmlentities($auction['description']); $winning_price = htmlentities($auction['winning_price']); $link = "leave_feedback.php?user_id={$encoded_seller_id}"; $link .= "&auction_id={$encoded_auction_id}"; $output .= "<tr>\n <td><a href=\"{$link}\"><h7>{$title}</h7>\n <img src=\"img/auctions/{$imageName}\"\n title=\"{$title}\">\n </a></td>\n <td>\n {$auction['description']}\n </td>\n <td>\n <Strong>Bought!</strong><br/>\n £{$auction['winning_price']}\n </td>\n </tr>";