{ public function getTitel() { $titel = "Handleiding HTML"; return $titel; } } ?> <!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <meta charset="UTF-8"> <title>Boeken</title> </head> <body> <h1> <?php $boek = new Boek(); print $boek->getTitel(); ?> </h1> </body> </html>
require_once $serverpath['objects'] . '/boek.php'; require_once $serverpath['objects'] . '/bestelling.php'; $klant = new Klant('*****@*****.**', 'password'); print_r($klant); //$klant->setLeverAdres("trammezandlei 44 shoten"); echo "nieuwe klant: " . (string) $klant->getKlantId() . "<br>"; echo "adres klant: " . $klant->getLeverAdres() . "<br>"; // $boek10 = new Boek("test","12345",25,'test','uitgever'); $boek1 = new Boek('AJAX and PHP: Building Modern Web Applications 2nd Edition Paperback', '978-1847197726', 24, 'B Brinzarea-Iamani', 'pact publishing ltd'); $boek2 = new Boek('jQuery in Action, Second Edition', '978-1935182320', 15, 'Bear Bibeault', 'Manning publications'); $boek3 = new Boek('Mijn eigen testboek', '123-1234567', 55, 'krisg', 'kweetniet'); $klant->login('*****@*****.**', 'password'); //try to comment it to see the error //$titel=$boek1->getTitel(); //echo $titel ; echo "twee nieuwe boeken in stock;<br> boek 1 heeft als titel :" . $boek1->getTitel() . " en boek 2:" . $boek2->getTitel(); $bestelling = Nieuwebestelling($klant); // $bestelling = new Bestelling($klant); $bestelling->voegBoekToe($boek1); print_r($bestlling); // $bestelling->voegBoekToe($boek2); alterbestelling($bestelling, $boek2, true); // $bestelling->sluitOrderAf(); to test if I get the exception thrown alterbestelling($bestelling, $boek3, true); //$bestelling->printboeken(); echo "<h3> boeken uit bestelling :</h3>" . $bestelling->getBoeken(); $bestelling->verwijderBoek($boek3); echo "<hr><br>Na verwijdering boek 3<br>"; echo "<h3> boeken uit bestelling :</h3>" . $bestelling->getBoeken(); //$bestelling->printboeken(); // wil nu een object maken zonder klant