$sth->bindParam(":lastid", $lastInsertId);
         $sth->bindParam(":ProductID", $productid);
         $sth->bindParam(":Aantal", $aantal);
         $sth->bindParam(":Verkoopprijs", $VerkoopPrijs);
         $sth->bindParam(":Totaalprijs", $Totaal);
         $sth->execute();
     }
     $gebruiker = Gebruiker::get($_SESSION['GebruikerID']);
     $gebruikerCash = $gebruiker->getProperty("Budget");
     $eindCash = $gebruikerCash - $_SESSION['Winkelwagen']['Totaal'];
     $cash = array('Budget' => $eindCash);
     $gebruiker->update($cash);
     $properties_values = array('Datum' => curDate(), 'Titel' => 'Nieuwe bestelling', 'Bericht' => 'Bestelling door de heer/mevrouw ' . substr(Gebruiker::get($_SESSION['GebruikerID'])->getProperty('Voornaam'), 0, 1) . '. ' . Gebruiker::get($_SESSION['GebruikerID'])->getProperty('Achternaam'), 'OntvangerID' => Gebruiker::get($_SESSION['GebruikerID'])->getProperty('Aanmaker'), 'AuteurID' => $_SESSION['GebruikerID']);
     Nieuwsitem::create($properties_values);
     $properties_values = array('Datum' => curDate(), 'Titel' => 'Nieuwe bestelling', 'Bericht' => 'Bestelling door de heer/mevrouw ' . substr(Gebruiker::get($_SESSION['GebruikerID'])->getProperty('Voornaam'), 0, 1) . '. ' . Gebruiker::get($_SESSION['GebruikerID'])->getProperty('Achternaam'), 'OntvangerID' => Gebruiker::get(Gebruiker::get($_SESSION['GebruikerID'])->getProperty('Aanmaker'))->getProperty('Aanmaker'), 'AuteurID' => $_SESSION['GebruikerID']);
     Nieuwsitem::create($properties_values);
     unset($_SESSION['Winkelwagen']);
     header("location: index.php?c=product&p=winkelwagen&success=true");
 } else {
     if (isset($_POST['table_length'])) {
         if (!isset($_POST['submit'])) {
             unset($_POST['table_length']);
             foreach ($_POST as $key => $value) {
                 $_SESSION['Winkelwagen'][$key]['Aantal'] = $value;
             }
         }
     }
 }
 if (isset($_POST['submit'])) {
     unset($_POST['example_length']);
     unset($_POST['table_length']);