</p> </div> <div class="col-xs-5"> <div class="col-xs-8"><p class="p-info bid-price" style="margin-top: 0">£ <?php $bid = null; if (empty($bids)) { $bid = $auction->getStartPrice(); if (!$isMyAuction) { $bid .= "<br><small>Enter £" . $auction->getStartPrice() . " or more</small>"; } } else { $bid = $bids[0]->getBidPrice(); if (!$isMyAuction) { $bid .= "<br><small>Enter £ " . ($bid + HelperOperator::getIncrement($bid)) . " or more</small>"; } } echo $bid; ?> </p> </div> <div class="col-xs-4"> <p class="p-info text-info" style="padding-top:4px;"><?php echo count($bids); ?> bids</p> </div> <?php if (!$isMyAuction) { ?>
public static function checkBidPrice($input, $auctionId) { $currentHighestBid = QueryOperator::getAuctionBids($auctionId, 1); // There exists a highest bid if (!empty($currentHighestBid)) { $currentHighestBid = $currentHighestBid[0]->getBidPrice(); $currentHighestBid += HelperOperator::getIncrement($currentHighestBid); } else { $currentHighestBid = -1; } // Invalid bid price if ($input < $currentHighestBid) { SessionOperator::setInputErrors(["bidPrice" => self::PRICES[self::INVALID_BID] . $currentHighestBid]); return false; } // No error return true; }