Пример #1
0
				<th>Description</th>
				<td><textarea name="descr" cols="40" rows="5"><?php 
echo $row['book_descr'];
?>
</textarea>
			</tr>
			<tr>
				<th>Price</th>
				<td><input type="text" name="price" value="<?php 
echo $row['book_price'];
?>
" required></td>
			</tr>
			<tr>
				<th>Publisher</th>
				<td><input type="text" name="publisher" value="<?php 
echo getPubName($conn, $row['publisherid']);
?>
" required></td>
			</tr>
		</table>
		<input type="submit" name="save_change" value="Change" class="btn btn-primary">
		<input type="reset" value="cancel" class="btn btn-default">
	</form>
	<br/>
	<a href="admin_book.php" class="btn btn-success">Confirm</a>
<?php 
if (isset($conn)) {
    mysqli_close($conn);
}
require "./template/footer.php";
Пример #2
0
<?php

session_start();
require_once "./functions/database_functions.php";
// get pubid
if (isset($_GET['pubid'])) {
    $pubid = $_GET['pubid'];
} else {
    echo "Wrong query! Check again!";
    exit;
}
// connect database
$conn = db_connect();
$pubName = getPubName($conn, $pubid);
$query = "SELECT book_isbn, book_title, book_image FROM books WHERE publisherid = '{$pubid}'";
$result = mysqli_query($conn, $query);
if (!$result) {
    echo "Can't retrieve data " . mysqli_error($conn);
    exit;
}
if (mysqli_num_rows($result) == 0) {
    echo "Empty books ! Please wait until new books coming!";
    exit;
}
$title = "Books Per Publisher";
require "./template/header.php";
?>
	<p class="lead"><a href="publisher_list.php">Publishers</a> > <?php 
echo $pubName;
?>
</p>