decode(); if(isset($_POST['addbook']) == '1') { $check = $thelibrary->checkForm(); if($check !== false) { $thelibrary->addBook(); } else { $thelibrary->showmessage(); } } if(isset($_POST['editbook'])) { $check = $thelibrary->checkForm(); if($check !== false) { $thelibrary->editBook($_POST['editbook']); } else { $thelibrary->showmessage(); } } if(isset($_GET['remove'])) { $thelibrary->deleteBook($_GET['remove']); } ?>

The BookLibrary.

decode(); if($lijst !== null) { $libraylist = usort($lijst, $thelibrary->sortISBN('isbn')); $books = array(); $heavybooks = array(); $weightplank = 0; $i = 0; foreach($lijst as $c) { if($thelibrary->tooHeavy($c['weight']) == true) { array_push($heavybooks,$c); } else { array_push($books,$c); } $thelibrary->cleanInput($c['title']); $i++; } echo ''; echo '
'; $i = count($books)-1; if($i >= 0) { while($i >= 0) { if(($weightplank + $books[$i]['weight']) > $thelibrary::MAXWEIGHT) { echo "
"; $weightplank = 0; } else { echo ""; $weightplank = ($weightplank + $books[$i]['weight']); } $i--; } } echo '
'; } else { echo "

BookLibrary is empty...

"; } ?> "; echo "edit | cleanInput(ucfirst($books[$id]['isbn']))."\" alt=\"remove book\">remove"; echo "

".$thelibrary->cleanInput(ucfirst($books[$id]['title']))."

"; echo "
"; } if(isset($_REQUEST['edit'])) { $id = (int)$_REQUEST['edit']; $thelibrary = new BookLibrary(); $books = $thelibrary->decode(); $item = $books[$id]; $title = $item['title']; $isbn = $item['isbn']; $weight = $item['weight']; $description = $item['description']; ?>

Edit book.







Add book.