Working Item Record Page.
This commit is contained in:
@ -5,16 +5,22 @@ $ItemID = htmlspecialchars($_GET["itemid"]);
|
||||
|
||||
// -------------------- END DATABASE QUERIES --------------------
|
||||
|
||||
// Establish atabase connection
|
||||
$db = new SQLite3('metadata.sqlite');
|
||||
|
||||
$book = $db->query("SELECT id, title, pubdate FROM books WHERE id = '$ItemID'");
|
||||
// ---------- Pull data from books table ----------
|
||||
$book = $db->query("SELECT id, title, date(timestamp), author_sort, strftime('%Y',pubdate) AS pubyear, date(last_modified) FROM books WHERE id = '$ItemID'");
|
||||
|
||||
while ($row = $book->fetchArray()) {
|
||||
$row_id = $row['id'];
|
||||
$row_title = $row['title'];
|
||||
$row_pubdate = $row['pubdate'];
|
||||
$row_created = $row['date(timestamp)'];
|
||||
$row_author_sort = $row['author_sort'];
|
||||
$row_pubdate = $row['pubyear'];
|
||||
$row_modified = $row['date(last_modified)'];
|
||||
}
|
||||
|
||||
// ---------- Pull data from authors table ----------
|
||||
$author = $db->query("SELECT name FROM authors
|
||||
INNER JOIN books_authors_link
|
||||
ON books_authors_link.author = authors.id
|
||||
@ -24,6 +30,43 @@ while ($row = $author->fetchArray()) {
|
||||
$row_creator = $row['name'];
|
||||
}
|
||||
|
||||
// ---------- Pull data from comments table ----------
|
||||
$summary = $db->query("SELECT text FROM comments WHERE book = '$ItemID'");
|
||||
|
||||
while ($row = $summary->fetchArray()) {
|
||||
$row_summary = $row['text'];
|
||||
}
|
||||
|
||||
// ---------- Pull data from publishers table ----------
|
||||
|
||||
$publisher = $db->query("SELECT name from publishers
|
||||
INNER JOIN books_publishers_link
|
||||
ON books_publishers_link.publisher = publishers.id
|
||||
WHERE books_publishers_link.book = '$ItemID'");
|
||||
|
||||
while ($row = $publisher->fetchArray()) {
|
||||
$row_publisher = $row['name'];
|
||||
}
|
||||
|
||||
// ---------- Pull data from tags table ----------
|
||||
|
||||
$tags = $db->query("SELECT name FROM tags
|
||||
INNER JOIN books_tags_link
|
||||
ON books_tags_link.tag = tags.id
|
||||
WHERE books_tags_link.book = '$ItemID'");
|
||||
|
||||
// ---------- Pull data from identifiers table ----------
|
||||
|
||||
$identifiers = $db->query("SELECT type, val FROM identifiers WHERE book = '$ItemID'");
|
||||
|
||||
// ---------- Pull data from languages table ----------
|
||||
|
||||
$languages = $db->query("SELECT languages.lang_code AS lang_code FROM languages
|
||||
INNER JOIN books_languages_link
|
||||
ON books_languages_link.lang_code = languages.id
|
||||
WHERE book = '$ItemID'
|
||||
ORDER BY books_languages_link.item_order");
|
||||
|
||||
|
||||
// -------------------- END DATABASE QUERIES --------------------
|
||||
|
||||
@ -162,6 +205,58 @@ while ($row = $author->fetchArray()) {
|
||||
</figure>
|
||||
<?php echo '<h2 class="fh5co-article-title animate-box">'.$row_title.'</h2>';?>
|
||||
<?php echo '<span class="fh5co-meta fh5co-date animate-box">'.$row_creator.'</span>';?>
|
||||
|
||||
<div class="col-lg-12 col-lg-offset-0 col-md-12 col-md-offset-0 col-sm-12 col-sm-offset-0 col-xs-12 col-xs-offset-0 text-left content-article">
|
||||
<div class="row">
|
||||
<div class="col-lg-7 cp-r animate-box">
|
||||
<?php echo $row_summary;?>
|
||||
</div>
|
||||
<div class="col-lg-5 animate-box">
|
||||
<div class="fh5co-highlight right">
|
||||
<h4>Metadata</h4>
|
||||
<p>
|
||||
<?php
|
||||
echo '<strong>Item Control Number: </strong>'.$ItemID.'<br />';
|
||||
echo '<strong>Title:</strong> '.$row_title.'<br />';
|
||||
echo '<strong>Creator:</strong> '.$row_author_sort.'<br />';
|
||||
echo '<strong>Publisher:</strong> '.$row_publisher.'<br />';
|
||||
echo '<strong>Date: </strong>'.$row_pubdate.'<br />';
|
||||
echo '<strong>Subjects: </strong>';
|
||||
while ($row = $tags->fetchArray()) {
|
||||
$row_tags = $row['name'];
|
||||
echo '['.$row_tags.'] ';
|
||||
}
|
||||
echo '<br/ ><strong>Identifiers: </strong><br />';
|
||||
while ($row = $identifiers->fetchArray()) {
|
||||
$row_id_type = $row['type'];
|
||||
$row_id_val = $row['val'];
|
||||
echo '<span style="margin-left: 10px;">'.$row_id_type.': ' .$row_id_val.'</span><br />';
|
||||
}
|
||||
echo '<strong>Language(s): </strong>';
|
||||
while ($row = $languages->fetchArray()) {
|
||||
$row_lang_code = $row['lang_code'];
|
||||
echo '[ '.$row_lang_code.' ] ';
|
||||
}
|
||||
echo '<br /><strong>Created: </strong>'.$row_created.'<br />';
|
||||
echo '<strong>Last Modified: </strong>'.$row_modified;
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--<div class="row rp-b">
|
||||
<div class="col-md-12 animate-box">
|
||||
<blockquote>
|
||||
<p>“She packed her seven versalia, put her initial into the belt and made herself on the way. When she reached the first hills of the Italic Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove ” <cite>— Jean Smith</cite></p>
|
||||
</blockquote>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user