本文整理汇总了PHP中Books::getBookByID方法的典型用法代码示例。如果您正苦于以下问题:PHP Books::getBookByID方法的具体用法?PHP Books::getBookByID怎么用?PHP Books::getBookByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Books
的用法示例。
在下文中一共展示了Books::getBookByID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionBook
public function actionBook()
{
$model = new Books();
$book = $model->getBookByID($_GET['id']);
$this->render('book', array('book' => $book));
}
示例2:
$book['publisher'] = $_POST['publisher'];
$book['published_year'] = $_POST['published_year'];
$book['subjects'] = $_POST['subjects'];
$book['lang'] = $_POST['lang'];
$book['series'] = $_POST['series'];
$book['pages'] = $_POST['pages'];
$bks->updateBook($book);
}
}
// DELETE Book
if(isset($_POST['BtnDeleteBook'])){
$bid = $_POST['bid'];
$book = $bks->getBookByID($bid);
$bks->deleteBook($book);
}
// Update book /////////////////////////////////////////////////////
if(isset($_POST['BtnUpdateBook'])){
$book['bid'] = $_POST['bid'];
$book['isbn'] = $_POST['isbn'];
$book['class'] = $_POST['class'];
$book['location'] = $_POST['location'];
$book['title'] = $_POST['title'];
$book['authors'] = $_POST['authors'];
$book['edition'] = $_POST['edition'];
$book['publisher'] = $_POST['publisher'];
$book['published_year'] = $_POST['published_year'];
$book['subjects'] = $_POST['subjects'];
示例3: include
$msg = "The barcode must start with the letter 'A'<hr>" .
$bks->toStringCopy($copy) . '<hr>' .
"<a href='book_copy_edit.php?ID=$cid'>Edit This Copy Again</a> | <a href='book_edit.php?ID=$bid'>Edit the Associated Book</a> | <a href='book_search.php'>Browse Books</a>";
$title = 'No Changes Made';
displayMsg($msg, $title);
}
$bks->changeBarcode($copy, $barcode1);
}
/// Get copy details into $row2 ////////////////////////////////////////////
$id = $_REQUEST['ID'];
$row2 = $bks->getCopyByID($id);
/// Get book details into $row ////////////////////////////////////////////
$row = $bks->getBookByID($row2['bid']);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>ULMS: Update Copy</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="css/styles.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="js/gen_validatorv2.js" type="text/javascript"></script>
</head>
<body>
<?php include("../inc/top.php"); ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="margin"><table width="100%" border="0">
示例4: CancelReservation
function CancelReservation($rid){ // returns a status message
$sql = sprintf("UPDATE reservation SET status='Cancelled' WHERE rid=%d",$rid);
$a = executeSqlNonQuery($sql);
$rows_updated = $a['rows'];
if($rows_updated != 1){
return "ERROR: couldn't cancel reservation";
} else{ // Cancelled, update other reservations
$reservation = $this->GetByID($rid);
require_once('Members.php'); $clsM = new Members;
$rowMember = $clsM->getByID($reservation['mid']);
require_once('Books.php'); $clsB = new Books;
$rowBook = $clsB->getBookByID($reservation['bid']);
$des = '[' . $rowBook['title'] . ' by ' . $rowBook['authors'] . ']' .
' <== [' . $rowMember['mid'] . '] ' . $rowMember['title'] . ' ' . $rowMember['firstnames'] . ' ' . $rowMember['surname'];
logEvent('RESERVATION_CANCELLED', $_SESSION['CurrentUser']['mid'], $rowMember['mid'], addslashes($des));
$sql = "SELECT * FROM reservation WHERE rid=" . $rid;
$rs = executeSqlQuery($sql);
$r = mysql_fetch_assoc($rs);
$cid = $r['cid'];
if($cid>0){
$sql = sprintf("select c.*, b.* FROM (copy c LEFT JOIN book b ON c.bid = b.bid) WHERE c.cid=%d", $cid);
$rs = executeSqlQuery($sql);
$rowCopy = mysql_fetch_assoc($rs);
return $this->updateReservations($rowCopy);
}
return "Reservation cancelled";
}
}