コード例 #1
0
    public function render()
    {
        Header::renderHeader(true);
        if (count($this->auctionDetail->imageIDs) > 0) {
            $url = "/auction/image?id=" . $this->auctionDetail->imageIDs[0];
        } else {
            $url = "/assets/img/logo.png";
        }
        echo '
          <div class="media">
             <div class="media-left">
                 <a href="#">
                    <img id="item_image" class="media-object" class="img-responsive" src="' . $url . '">
                 </a>
             </div>
             <div class="media-body">
                <h1 class="media-heading">' . $this->auctionDetail->itemName . '</h1>
                <span>Expiration time: ' . DateTimeUtils::formatDate($this->auctionDetail->endDate) . '</span>
                <div class="panel panel-default">
                     <div class="panel-body">
                        <div class="col-lg-4"> <span id="bid">Highest bid £' . $this->auctionDetail->maxBid . ' </span></div>
                        <div class="col-lg-4"><span id="number_bids">' . $this->auctionDetail->numberOfBids . ' bids</span></div>
                        <div class="col-lg-4"><span id="no_bidders">' . $this->auctionDetail->numberOfBidders . ' bidders</span></div>
                     </div>
                </div>
                <div class="panel panel-default">
                     <div class="panel-body">
                        <div class="col-lg-4"><span id="no_watchers">' . $this->auctionDetail->watchers . ' watching </span></div>
                        <div class="col-lg-4"<span id="no_views">' . $this->auctionDetail->views . ' views</span></div>


                     </div>
                </div>
             </div>
         </div>

                    </div>
                </div>
            </div>

         </div>
         <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">Item description</h3>
            </div>
            <div class="panel-body">
                ' . $this->auctionDetail->itemDescription . '
            </div>
         </div>
         <form action="" method="post">
         <button class="btn btn-primary btn-large btn-block" name="report" type="report" value="report">Email Report</button>
         </form>
         <div class="panel panel-default">

            <a href="/auction/homepage">Back to search results</a>
         </div>
        ';
    }
コード例 #2
0
    public function render()
    {
        Header::renderHeader(true);
        echo '

        <div id="uploadSuccess" class="container">
            <div class="row-fluid">

                <div class="col-lg-9 col-lg-offset-1">
                    <h1>Successfully Uploaded Item!</h1>

                    <div>
                        <div>
                            <label>Product Name</label>
                        </div>
                        <div class="form-control">' . $this->auctionDetail->itemName . '
                        </div>
                        <div><label>Product Description</label></div>
                        <div class="form-control">
                            ' . $this->auctionDetail->itemDescription . '
                        </div>
                        <div class="col-lg-4 col-lg-offset-1">
                            <div><label>Start Price</label></div>

                            <div class="form-control">

                                ' . $this->auctionDetail->startPrice . '

                            </div>
                        </div>
                        <div class="col-lg-4 col-lg-offset-2">
                            <div><label>Item condition</label></div>
                            <div class="form-control">' . $this->auctionDetail->itemCondition . '
                            </div>
                        </div>
                        <div class="col-lg-4 col-lg-offset-1">
                            <div><label>End Date</label></div>
                            <div class="form-control">

                            ' . DateTimeUtils::formatDate($this->auctionDetail->endDate) . '
                            </div>
                        </div>
                        <div class="col-lg-4 col-lg-offset-2">
                            <div><label>Start date</label></div>
                            <div class="form-control">' . DateTimeUtils::formatDate($this->auctionDetail->startDate) . '
                            </div>
                        </div>

                        <div class="col-lg-4 col-lg-offset-3" id="upload-image">';
        foreach ($this->auctionDetail->imageIDs as $image) {
            echo '<img style="width: 100%;" src="/auction/image?id=' . $image . '">';
        }
        echo '</div>
                    </div>
                </div>
            </div>
        </div>';
    }
コード例 #3
0
    public function render()
    {
        //Echo the view
        //renders the header automatically
        Header::renderHeader();
        $auctionManager = new AuctionManager();
        $sortSelected = isset($_POST['sort']) ? $_POST['sort'] : "";
        echo '
        <div id="searchresults" class="container">

            <h1>BidBucket</h1>
            <h6 id="homeSubheader">Where cool items hang out</h6>

        <div class="surroundss">

        <div class="menu">
            <h3>Categories</h3>
            <ul>
            ';
        foreach ($auctionManager->getAllCategories() as $category) {
            echo '<a href ="/auction/homepage?searchTerm=&categoryID=' . $category->id . '"><li>' . $category->name . '</li></a>';
        }
        echo '
            </ul>
       </div>
        <div class="main">
            <p id="currentAuctionsHeader">Current Auctions</p>
            <form name="sortform" method="post" class="form-inline">
                <div class="form-group">
                    <label for="sort">Sort:</label>
                        <select class="form-control" name="sort" onchange="this.form.submit()">';
        foreach (AuctionManager::$sorts as $sort) {
            $selected = $sortSelected == $sort ? "selected" : "";
            echo '<option ' . $selected . ' value="' . $sort . '">' . $sort . '</option>';
        }
        echo '
                        </select>
                        <noscript><input type="submit" value="Submit"></noscript>
                </div>
            </form>
            <br>';
        foreach ($this->auctionDetails as $auction) {
            if (count($auction->imageIDs) > 0) {
                $url = "/auction/image?id=" . $auction->imageIDs[0];
            } else {
                $url = "/assets/img/logo.png";
            }
            $watching = "Not watching";
            if ($auction->isWatching == 1) {
                $watching = "Watching";
            }
            echo '
                <table>
                    <tr>
                      <td rowspan="8"><img src="' . $url . '" align="left" width="120" alt="logo"></td>
                      <td><a href="/auction/auction?id=' . $auction->auctionId . '"><h3>' . $auction->itemName . '</h3></a></td>
                    </tr>
                    <tr><td><b>Current price</b>: £ ' . $auction->maxBid . ' </td></tr>
                    <tr><td><b>Number of bids</b>: ' . $auction->numberOfBids . '</td></tr>
                    <tr><td><b>Condition</b>: ' . $auction->itemCondition . '</td></tr>
                    <tr><td><b>Starting price</b>: £ ' . $auction->startPrice . '</td></tr>
                    <tr><td><b>Start date</b>: ' . DateTimeUtils::formatDate($auction->startDate) . '</td></tr>
                    <tr><td><b>End date</b>: ' . DateTimeUtils::formatDate($auction->endDate) . '</td></tr>
                    <tr><td>' . $watching . '</td></tr>
                </table>
                <br><br>';
        }
        echo '</div>
  </div>
</div>';
    }
コード例 #4
0
    public function render()
    {
        //Echo the view
        //renders the header automatically
        Header::renderHeader();
        $auctionSellerManager = new AuctionSellerManager();
        $auctionManager = new AuctionManager();
        $sortSelected = isset($_POST['sort']) ? $_POST['sort'] : "";
        echo '
        <div id="searchresults" class="container">
        <div class="surroundss">
        <div class="menu">
            <h3>Categories</h3>
            <ul>
            ';
        // change this to output the seller items
        foreach ($auctionManager->getAllCategories() as $category) {
            echo '<a href ="/auction/homepage?searchTerm=&categoryID=' . $category->id . '"><li>' . $category->name . '</li></a>';
        }
        echo '
            </ul>
       </div>
        <div class="main">
            <h1>Welcome to BidBucket</h1>
            <p>Here is a list of all of your auctions</p>
            <form name="sortform" method="post" class="form-inline">
                <div class="form-group">
                    <label for="sort">Sort:</label>
                        <select class="form-control" name="sort" onchange="this.form.submit()">';
        foreach (AuctionSellerManager::$sorts as $sort) {
            $selected = $sortSelected == $sort ? "selected" : "";
            echo '<option ' . $selected . ' value="' . $sort . '">' . $sort . '</option>';
        }
        echo '
                        </select>
                </div>
            </form>';
        foreach ($this->auctionReport as $auction) {
            if (count($auction->imageIDs) > 0) {
                $url = "/auction/image?id=" . $auction->imageIDs[0];
            } else {
                $url = "/assets/img/logo.png";
            }
            echo '
                <table>
                    <tr>
                      <td rowspan="7"><img src="' . $url . '" align="left" width="120" alt="logo"></td>
                      <td><a href="/auction/auctionseller?id=' . $auction->auctionId . '"><h3>' . $auction->itemName . '</h3></a></td>
                    </tr>
                    <tr><td><b>Current price</b>: £ ' . $auction->maxBid . ' </td></tr>
                    <tr><td><b>Number of bids</b>: ' . $auction->numberOfBids . '</td></tr>
                    <tr><td><b>No of unique bidders</b>: ' . $auction->numberOfBidders . '</td></tr>
                    <tr><td><b>No of watchers</b>: ' . $auction->watchers . '</td></tr>
                    <tr><td><b>No of views</b>: ' . $auction->views . '</td></tr>
                    <tr><td><b>End date</b>: ' . DateTimeUtils::formatDate($auction->endDate) . '</td></tr>
                </table>
                <br><br>';
        }
        echo '</div>
</div>
</div>';
    }
コード例 #5
0
 public function render()
 {
     Header::renderHeader(true);
     $userManager = new UserManager();
     $isCurrentUserHighestBidder = $userManager->getLoggedInUser()->userID == $this->auctionDetail->highestBidderID;
     $step = round($this->auctionDetail->maxBid * 0.05, 2);
     $minValue = $this->auctionDetail->maxBid + $step;
     if (count($this->auctionDetail->imageIDs) > 0) {
         $url = "/auction/image?id=" . $this->auctionDetail->imageIDs[0];
     } else {
         $url = "/assets/img/logo.png";
     }
     $loggedInUser = $userManager->getLoggedInUser();
     /**
      * Search - needs to be abstracted
      */
     echo '
     <div class="container">
       <div class="media">
          <div class="media-left">
              <a href="#">
                 <img id="item_image" class="media-object" class="img-responsive" src="' . $url . '">
              </a>
          </div>
          <div class="media-body">
             <h1 class="media-heading">' . $this->auctionDetail->itemName . '</h1>
             <div class="panel panel-default">
                  <div class="panel-body">';
     if ($this->auctionDetail->isAuctionExpired) {
         echo '
                 <span><b>Item expired!</b></span><br><br>';
     }
     if (!$this->auctionDetail->isAuctionStarted) {
         echo '
                 <span><b>Item is not on auction yet!</b></span><br><br>';
     }
     echo '
                 <p><b>Auction start time</b>: ' . DateTimeUtils::formatDate($this->auctionDetail->startDate) . '</p>
                 <p><b>Expiration time</b>   : ' . DateTimeUtils::formatDate($this->auctionDetail->endDate) . '</p>';
     if (!$this->auctionDetail->isAuctionExpired && $this->auctionDetail->isAuctionStarted) {
         echo '
                      <span id="bid_price">£ ' . $this->auctionDetail->maxBid . '</span>
                      <a href="/auction/bidHistory?id=' . $this->auctionDetail->auctionId . '"><span id="bid_number">  ' . $this->auctionDetail->numberOfBids . '  bids</span></a>
                     <div><i>' . ($isCurrentUserHighestBidder ? "You are the current highest bidder!" : "") . '</i></div>
     ';
         //if the user is a buyer, they can bid on or watch an item
         if ($loggedInUser->roleID == 1) {
             echo '
                  <form method="post">
                     <input type="hidden" value="' . $this->auctionDetail->auctionId . '" name="id">
                     <input type="hidden" value="' . $this->auctionDetail->itemName . '" name="itemName">
                     <div class="form-group">
                         <input type="number" min="' . $minValue . '" class="form-control" placeholder="Enter your max. bid" name="newBid" value="' . $this->auctionDetail->maxBid . '">
                     </div>
                     <button type="submit" class="btn btn-default" id="submitBid">Submit</button>
                     <span>';
             if (!$this->auctionDetail->isWatching) {
                 echo '<a href="/auction/auction?id=' . $this->auctionDetail->auctionId . '&isWatching=1"><br><i class="glyphicon glyphicon-eye-open"></i>' . ' ' . ' Start watching </a>';
             } else {
                 echo '<a href="/auction/auction?id=' . $this->auctionDetail->auctionId . '&isWatching=0"><br><i class="glyphicon glyphicon-eye-close"></i> Unwatch </a>';
             }
             echo '
                     </span>
                  </form>
                  ';
         }
     }
     echo '
             </div>
          </div>
      </div>';
     echo '<div class="panel panel-default">
         <div class="panel-heading">
             <a href="/auction/profile?id=' . $this->auctionDetail->sellerID . '"><h3 class="panel-title">' . $this->auctionDetail->sellerName . '</h3></a>
             <div class="star-rating">
                 <div>';
     for ($x = 1; $x < 6; $x++) {
         if ($x > round($this->auctionDetail->sellerRating)) {
             echo '<i class="glyphicon glyphicon-star-empty"></i>';
         } else {
             echo '<i class="glyphicon glyphicon-star"></i>';
         }
     }
     echo '(' . $this->auctionDetail->numberOfRatings . ')';
     echo '
                 </div>
             </div>
         </div>
         <div class="panel-body">
             <a href="/auction/feedback?id=' . $this->auctionDetail->sellerID . '">View detailed feedback</a>
         </div>
      </div>
      <div class="panel panel-default">
         <div class="panel-heading">
             <h3 class="panel-title">Item description</h3>
         </div>
         <div class="panel-body">
             ' . $this->auctionDetail->itemDescription . '
         </div>
      </div>
      <div class="panel panel-default">
         <div class="panel-heading">
             <h3 class="panel-title">Item condition</h3>
         </div>
         <div class="panel-body">
             ' . $this->auctionDetail->itemCondition . '
         </div>
         <a href="/auction/homepage">Back to search results</a>
      </div>
      </div>
     ';
 }