Exemplo n.º 1
0
    //insert auction into auction table
    //insert item id here too
    //auctionID
    $datePosted = $date = date('Y-m-d');
    $endDate = $_POST['endDate'];
    $startPrice = $_POST['startPrice'];
    $resPrice = $_POST['resPrice'];
    //$count = 0;//number of views
    //insert item into item table
    //insert item id here too
    $itemName = $_POST['itemName'];
    $description = $_POST['description'];
    $category = $_POST['category'];
    $auction = new Auction($conn);
    $item = new Item($conn);
    if ($auction->addAuction($datePosted, $endDate, $startPrice, $resPrice, $currentItemID, $userId) && $item->addItem($currentItemID, $itemName, $description, $category, $userId)) {
        echo '
			<div class = "alert alert-success">
				Auction successfully posted
			</div>
		';
    } else {
        echo '
			<div class = "alert alert-danger">
				Error posting auction
			</div>
		';
    }
}
?>