public function render()
    {
        //Echo the view
        //renders the header automatically
        Header::renderHeader();
        $bidManager = new BidManager();
        $auctionId = (int) $_GET['id'];
        ?>

  <div id="bidHistory" class="container">
    <div class="well well-small">
    	<?php 
        ?>
      <h2><?php 
        echo $bidManager->getAuctionTitle($auctionId);
        ?>
's Bid History Page</h2>
      <br>
      <table>
        <tr>
          <th>Amount</th>
          <th>Time of bid</th> 
          <th>Username</th>
          <th>First Name</th>
          <th>Last Name</th>
        </tr>

      <?php 
        foreach ($bidManager->getBidHistory($auctionId) as $history) {
            echo "<tr>";
            echo "<td>" . $history->amount . "</td>";
            echo "<td>" . $history->time_of_bid . "</td>";
            echo "<td>" . $history->username . "</td>";
            echo "<td>" . $history->first_name . "</td>";
            echo "<td>" . $history->last_name . "</td>";
            echo "</tr>";
        }
        echo "</table>";
        ?>
                   

    </div>
  </div>

<?php 
    }
use Models\BidManager;
use Models\LoginManager;
use Models\UserManager;
use Views\AuctionDetailView;
LoginManager::startSessionAndRedirectIfNotLoggedIn();
$auctionManager = new AuctionManager();
$userManager = new UserManager();
$currentUser = $userManager->getLoggedInUser()->userID;
// get the auction id
$auctionId = (int) $_REQUEST['id'];
if ($auctionId) {
    if ($_SERVER['REQUEST_METHOD'] === 'POST') {
        $id = $_POST['id'];
        $amount = $_POST['newBid'];
        $itemName = $_REQUEST['itemName'];
        $bidManager = new BidManager();
        $bid = new Bid($amount, new DateTime(), $id, $currentUser, $itemName);
        $bidManager->updateBid($bid);
        $auctionDetail = $auctionManager->getAuctionDetail($auctionId);
        $auctionDetailView = new AuctionDetailView($auctionDetail);
        $auctionDetailView->render();
    } elseif ($_SERVER['REQUEST_METHOD'] === 'GET') {
        $auctionManager->incrementViews($auctionId, $currentUser);
        $updateWatching = null;
        if (isset($_REQUEST["isWatching"])) {
            $updateWatching = (int) $_REQUEST["isWatching"] == 1;
        }
        if ($updateWatching !== null) {
            if ($updateWatching === true) {
                $auctionManager->startWatching($userManager->getLoggedInUser()->userID, $auctionId);
            } else {