== Приказ на сите книги == === Актери === * Најавен корисник === Чекор 1 === Избор на жанра/и \\ [[Image(BT-11.png)]] {{{#!sql SELECT book.bookid, book.CoverImage, book.Title, book.Genre, book.PublishedYear, author.FirstName, author.LastName FROM Book INNER JOIN Book_Author ON Book.BookID = Book_Author.BookID INNER JOIN Author ON Book_Author.AuthorID = Author.AuthorID WHERE book.genre IN ($placeholders) AND book.PublishedYear BETWEEN $query_from AND $query_to;" }}} {{{#!sql SELECT book.bookid, book.CoverImage, book.Title, book.Genre, book.PublishedYear, author.FirstName, author.LastName FROM Book INNER JOIN Book_Author ON Book.BookID = Book_Author.BookID INNER JOIN Author ON Book_Author.AuthorID = Author.AuthorID WHERE book.PublishedYear BETWEEN $query_from AND $query_to; }}} === Чекор 2 === Избор на временски период \\ [[Image(BT-12.png)]] {{{#!sql SELECT MIN(PublishedYear) as min_year, MAX(PublishedYear) as max_year FROM Book }}} === Чекор 3 === Сортирање на книгите по избор, и селектирање на "Apply Filters" \\ [[Image(BT-13.png)]] {{{#!sql function sortBooks(books, sortType) { const sortedBooks = [...books]; switch(sortType) { case 'name-asc': sortedBooks.sort((a, b) => a.title.localeCompare(b.title)); break; case 'name-desc': sortedBooks.sort((a, b) => b.title.localeCompare(a.title)); break; case 'year-desc': sortedBooks.sort((a, b) => b.publishedYear - a.publishedYear); break; case 'year-asc': sortedBooks.sort((a, b) => a.publishedYear - b.publishedYear); break; case 'relevance': default: break; } return sortedBooks; } }}} === Чекор 4 === Резултат [[Image(BT-14.png)]]