本文整理汇总了PHP中Library::updateBook方法的典型用法代码示例。如果您正苦于以下问题:PHP Library::updateBook方法的具体用法?PHP Library::updateBook怎么用?PHP Library::updateBook使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Library
的用法示例。
在下文中一共展示了Library::updateBook方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Library
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>Ubah Data Buku</h2>
<form action="edit.php" method="POST" class="form-group">
Kode Buku: <input type="text" name="no_data" value="' . $edit->no_data . '" class="form-control"><br>
Judul Buku: <input type="text" name="nama" value="' . $edit->nama_data . '" class="form-control"><br>
Pengarang Buku: <input type="text" name="matkul" value="' . $edit->mata_kuliah . '" class="form-control"><br>
Penerbit Buku: <input type="text" name="semester" value="' . $edit->semester . '" class="form-control"><br>
<input type="submit" name="updateBook" value="Update" class="btn btn-info">
</form>
</div>
</body>
</html>
';
}
if (isset($_POST['updateBook'])) {
$kode = $_POST['no_data'];
$judul = $_POST['nama'];
$pengarang = $_POST['matkul'];
$penerbit = $_POST['semester'];
$Lib = new Library();
$upd = $Lib->updateBook($no_data, $nama, $matkul, $semester);
if ($upd == "Success") {
header('Location: list.php');
}
}
?>
</body>
</html>
示例2: elseif
// search on title
$title = $_POST["titleSearch"];
$library->searchTitle($title);
} elseif (isset($_POST["startGenreSearch"])) {
// search on genre
$genre = $_POST["genreSearch"];
$library->searchGenre($genre);
} elseif (isset($_POST["updateBook"])) {
// user wants to update a book: show update form
$ident = $_POST["ident"];
$library->setIdent($ident);
include "update.php";
} elseif (isset($_POST["update"])) {
// update the book
$ident = $_POST["ident"];
$author = $_POST["author"];
$title = $_POST["title"];
$genre = $_POST["genre"];
$library->updateBook($ident, $author, $title, $genre);
}
}
?>
</div>
<div id="images">
<img src="images/fantasylibrary3.jpg" alt="Library"/>
</div>
</body>
</html>