예제 #1
0
		';
    } else {
        //get starting price, if bidprice<starting price then show error.
        //$bidQuery = "INSERT INTO `bids` (`auctionID`, `userId`, `bidPrice`, `bidDate`) VALUES ('$auctionID', '$userId', '$bidPrice', '$bidDate')";
        //update auction bid count
        //$updateQuery = "UPDATE `auction` SET bids = bids+1 WHERE auctionID='$auctionID'";
        //auction manager
        $auction = new Auction($conn);
        if ($auction->addBid($auctionID, $userId, $bidPrice, $bidDate)) {
            echo '
				<div class = "alert alert-success">
					Bid successful
				</div>
			';
            //notifyBidders($auctionID, $bidPrice, $bidDate, $userId)
            $auction->notifyBidders($auctionID, $bidPrice, $bidDate, $userId);
        } else {
            echo '
				<div class = "alert alert-danger">
					Error bidding
				</div>
			';
        }
    }
}
?>


	<form role = "form" method = "post" action = "placeBid.php?auctionID=<?php 
echo $auctionID;
?>