Front page

Story 01 · Science fair · The British School of Kosova

PanairBSK

School library system


A full library web app, built with a teammate for the science fair at The British School of Kosova, my school. We won.

Sign up and log in, browse and search books, see book details, borrow, return and track each book’s journey, plus an admin panel for uploading and deleting books.

The app is available in both Albanian and English, with GSAP animations on the front end.

Stack
PHP, MySQL, JavaScript, GSAP, CSS
Team
Leart Obërtinca and Mendimish1 ↗
Result
Won the science fair
Languages
Albanian, English

Borrowing a book

details.php · lines 22 to 60

A signed-in reader picks a pickup date; the hold is saved with a prepared statement and the book’s available copies go down by one. The messages are in Albanian.

details.phpPanairBSK
// Handle hold requestif (isset($_POST['hold_book'])) {    // Check if the user is logged in    if (!isset($_SESSION['user_id'])) {        header('Location: login.php');        exit;    }     $user_id = $_SESSION['user_id'];    $pickup_date = isset($_POST['pickup_date']) ? trim($_POST['pickup_date']) : null;     if (!$pickup_date) {        echo "<p style='color: red;'>Pickup date is required.</p>";        exit;    }     if (demo_is_id($id)) {        // Demo books keep their reservations in a local file, not the database        if (demo_place_hold($user_id, $id, $pickup_date)) {            $book = demo_find_book($id);            $success_message = "Libri u rezervua me sukses!";        } else {            $error_message = "Rezervimi i librit dështoi. Ju lutem provoni përsëri.";        }    } else {        // Insert into `book_holds` table        $stmt = $db->prepare("INSERT INTO book_holds (user_id, book_id, hold_date, pickup_date) VALUES (?, ?, CURDATE(), ?)");        $stmt->bind_param('iis', $user_id, $id, $pickup_date);         if ($stmt->execute()) {            // Decrease available_books in `librat` table            $db->query("UPDATE librat SET available_books = available_books - 1 WHERE id = $id");            $book['available_books'] -= 1;             // Display success message            $success_message = "Libri u rezervua me sukses!";        } else {            $error_message = "Rezervimi i librit dështoi. Ju lutem provoni përsëri.";        }

The book journey layer

book_journey.php · lines 1 to 9

A decorative layer of three books that GSAP animates on the home pages. It stays hidden unless the animation runs, and it is ignored by clicks and screen readers.

book_journey.phpPanairBSK
<?php// Decorative layer for the home pages, animated by buildBookJourney() in motion.js.// It stays hidden unless that function runs, and it is ignored by clicks and screen readers.$journeyBooks = [    ['cover' => '#14305c', 'band' => '#f2cf85'],    ['cover' => '#c8952e', 'band' => '#14305c'],    ['cover' => '#a8322b', 'band' => '#f2cf85'],];?>