From: xf0r3m Date: Fri, 3 Nov 2023 13:16:49 +0000 (+0100) Subject: Dalszy rozwój. Dodano stronę książki, zmioniono notatki na magazyny. Usunięto posty... X-Git-Url: https://gitweb.morketsmerke.org/?a=commitdiff_plain;h=b4d973bce0e0293a93efd91b7441a2830eb88dfb;p=libmm.git Dalszy rozwój. Dodano stronę książki, zmioniono notatki na magazyny. Usunięto posty. Dodano linki do sortowania bez obsługi --- diff --git a/index.php b/index.php index fbc6acd..4200575 100644 --- a/index.php +++ b/index.php @@ -21,7 +21,7 @@
  • -
  • + -

     

    +
    + + + +
    + + Panel administracyjny:"; echo ""; } ?> @@ -60,8 +84,8 @@ switch ($_GET['p']) { case 'login': include('modules/login.php'); break; - case 'addcategorie': - include('modules/addcategorie.php'); break; + case 'addcategory': + include('modules/addcategory.php'); break; case 'addbook': include('modules/addbook.php'); break; case 'books': @@ -70,6 +94,8 @@ include('modules/editbook.php'); break; case 'delete': include('modules/delete.php'); break; + case 'book': + include('modules/book.php'); break; default: include('modules/frontpage.php'); } diff --git a/install.sql b/install.sql index a966355..231f499 100644 --- a/install.sql +++ b/install.sql @@ -25,10 +25,10 @@ CREATE TABLE books ( description text ); -CREATE TABLE notes ( +CREATE TABLE magazines ( id int AUTO_INCREMENT PRIMARY KEY, title text, - author text, + pubnumber text, source text, adnotes text, description text diff --git a/modules/addcategorie.php b/modules/addcategory.php similarity index 85% rename from modules/addcategorie.php rename to modules/addcategory.php index ede7a18..0f9ffec 100644 --- a/modules/addcategorie.php +++ b/modules/addcategory.php @@ -1,21 +1,21 @@ Dodano kategorię: " . $_POST['categorie'] . ""; + echo "

    Dodano kategorię: " . $_POST['category'] . "

    "; } else { echo "

    Nie dodano kategorii.

    "; } } ?> -
    +
    -

    +


    diff --git a/modules/book.php b/modules/book.php new file mode 100644 index 0000000..5239b2e --- /dev/null +++ b/modules/book.php @@ -0,0 +1,74 @@ + +Nie można pobrać informacji o obiekcie"; + } +?> + +

    +

    + +

    +
    +

    Rodzaj: + "; + echo "E-book"; + echo ""; + } + else { + echo ""; + echo "Książka papierowa"; + echo ""; + } + ?> +

    +

    Wydawnictwo: + + + +

    +

    Wydanie:

    +

    Rok wydania: + + + +

    + +

    Kategoria: + + + +

    +

    ISBN:

    +
    +
    +<?php basename($row[2]); ?> +
    +

    Adnotacje:
    + +

    +

    Opis:
    +

    diff --git a/modules/books.php b/modules/books.php index 25a20a9..d946b59 100644 --- a/modules/books.php +++ b/modules/books.php @@ -3,15 +3,38 @@ if ( session_status() != 2 ) { session_start(); } $tableName = "books"; $columnScheme = "id,title,author"; - $whereValue = "type = " . intval($_GET['t']); + if ( isset($_GET['t']) ) { + $whereValue = "type = " . intval($_GET['t']); + } else if ( isset($_GET['pub']) ) { + $whereValue = "publisher = '" . $_GET['pub'] . "'"; + } else if ( isset($_GET['d']) ) { + $whereValue = "pubdate = " . intval($_GET['d']); + } else if ( isset($_GET['c']) ) { + $whereValue = "category = " . intval($_GET['c']); + } else if ( isset($_GET['a']) ) { + $whereValue = "author = '" . urldecode($_GET['a']) . "'"; + } $booksQueryResult = dbQuery($connection, $tableName, $columnScheme, $whereValue) ?> E-Booki:
    "; - } else { + } else if ( isset($_GET['t']) && ( $_GET['t'] == 0 ) ) { echo "

    Książki papierowe:


    "; + } else if ( isset($_GET['pub']) ) { + echo "

    Wydawca: " . $_GET['pub'] . "

    "; + } else if ( isset($_GET['d']) ) { + echo "

    Rok wydania: " . $_GET['d'] . "

    "; + } else if ( isset($_GET['c']) ) { + $tableName = 'categories'; + $columnScheme = 'name'; + $whereValue = "id = " . intval($_GET['c']); + $booksCatResult = dbQuery($connection, $tableName, $columnScheme, $whereValue); + $category = getFieldValue($booksCatResult); + echo "

    Kategoria: " . $category . "

    "; + } else if ( isset($_GET['a']) ) { + echo "

    Autor: " . urldecode($_GET['a']) . "

    "; } if ( mysqliResult($connection, $booksQueryResult) ) { echo ""; diff --git a/modules/delete.php b/modules/delete.php index 41ee9fc..c8935d5 100644 --- a/modules/delete.php +++ b/modules/delete.php @@ -17,8 +17,10 @@ $tableName = $_GET['table']; if ( $tableName == "books" ) { $columnScheme = "title,type"; - } else { + } else if ( $tableName == "magazines" ) { $columnScheme = 'title'; + } else { + $columnScheme = 'name'; } $id = intval($_GET['id']); $whereValue = 'id = ' . $id; @@ -38,6 +40,8 @@ "; + } else if ( $tableName == "categories" ) { + echo ""; } else { echo ""; } diff --git a/style.css b/style.css index ffba53b..163e28c 100644 --- a/style.css +++ b/style.css @@ -56,3 +56,10 @@ button { .addbook-input { width: 400px; } + +.book-cover { + display: block; + width: 200px; + margin-left: auto; + margin-right: auto; +}