public function bestellingDoorvoeren($arrBestelRegel, $datum, $prijs, $KlantID) { // Voert een bestelling door naar DB $albestelddiedag = bestellingService::alBesteldDieDag($datum, $KlantID); if (!$albestelddiedag) { $BestelID = BestellingDAO::createBestelling($KlantID, $datum, $arrBestelRegel, $prijs); foreach ($arrBestelRegel as $regel) { $Aantal = $regel->aantal; if ($Aantal) { $ProductID = $regel->productID; $product = productService::getProductFromId($ProductID); $productPrijs = $product->prijs; $Prijs = $Aantal * $productPrijs; BestelRegelDAO::createBestelRegel($BestelID, $ProductID, $Aantal, $Prijs); $Aantal = 0; } } unset($_SESSION['bestelregelarray']); return TRUE; } if ($albestelddiedag) { return FALSE; } }