Esempio n. 1
0
<?php

require_once '../../models/book.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $book = new Book();
    $book->name = $_POST['name'];
    $book->ISBN = $_POST['ISBN'];
    $book->sunccoNo = $_POST['sunccoNo'];
    $book->price = $_POST['price'];
    $ok = BookManager::addBook($book);
    if ($ok === false) {
        echo "添加失败";
    } else {
        $js = "<script>alert('添加成功');</script>";
        echo "{$js}";
    }
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
  <?php 
require_once "../adminHead.php";
?>
</head>

<body>

  <?php 
require_once "../adminNav.html";