From: xf0r3m Date: Mon, 6 Nov 2023 08:42:58 +0000 (+0100) Subject: Zakończono rozwój głównych funkcji. Dodano obsługę sortowania oraz możliwość dodawani... X-Git-Url: https://gitweb.morketsmerke.org/?a=commitdiff_plain;h=HEAD;p=libmm.git Zakończono rozwój głównych funkcji. Dodano obsługę sortowania oraz możliwość dodawania magazynów. TODO: Wyświetlenie książek oraz czasopism dla wybranej kategorii. Design strony w CSS. --- diff --git a/dbdrop.sql b/dbdrop.sql new file mode 100644 index 0000000..2d0443a --- /dev/null +++ b/dbdrop.sql @@ -0,0 +1,3 @@ +DROP USER 'library'@'localhost'; +DROP DATABASE library; +FLUSH PRIVILEGES; diff --git a/index.php b/index.php index 4200575..7e44291 100644 --- a/index.php +++ b/index.php @@ -41,29 +41,51 @@
$value ) { + if ( empty($url) ) { + $url = $url . "?" . $key . "=" . $value; + } else { + $url = $url . "&" . $key . "=" . $value; + } + } + */ ?>
+
+Czasopismo: " . $_POST['addmagazine-title'] . " " + . $_POST['addmagazine-publishing'] . " zostało dodane"; + } else { + echo "

Nie dodano czasopisma.

"; + } + } +?> + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
diff --git a/modules/books.php b/modules/books.php index d946b59..c411df8 100644 --- a/modules/books.php +++ b/modules/books.php @@ -14,6 +14,22 @@ } else if ( isset($_GET['a']) ) { $whereValue = "author = '" . urldecode($_GET['a']) . "'"; } + switch ($_GET['o']) { + case 'author': + $whereValue = $whereValue . " ORDER BY author"; break; + case 'pubdate': + $whereValue = $whereValue . " ORDER BY pubdate"; break; + default: + $whereValue = $whereValue . " ORDER BY title"; break; + } + switch ($_GET['s']) { + case 'asc': + $whereValue = $whereValue . " ASC"; break; + case 'desc': + $whereValue = $whereValue . " DESC"; break; + default: + $whereValue = $whereValue . " ASC"; break; + } $booksQueryResult = dbQuery($connection, $tableName, $columnScheme, $whereValue) ?> diff --git a/modules/delete.php b/modules/delete.php index c8935d5..1088ca4 100644 --- a/modules/delete.php +++ b/modules/delete.php @@ -18,7 +18,7 @@ if ( $tableName == "books" ) { $columnScheme = "title,type"; } else if ( $tableName == "magazines" ) { - $columnScheme = 'title'; + $columnScheme = 'title,pubnumber'; } else { $columnScheme = 'name'; } @@ -31,7 +31,13 @@ echo "

Nie można pobrać informacji o obiekcie.

"; } ?> -

Czy jesteś pewien, że chcesz usunąć:
?

+Czy jesteś pewien, że chcesz usunąć:
" . $row[0] . " " . $row[1] . "?"; + } else { + echo "

Czy jesteś pewien, że chcesz usunąć:
" . $row[0] . "?

"; + } +?>
diff --git a/modules/editmagazine.php b/modules/editmagazine.php new file mode 100644 index 0000000..4a68981 --- /dev/null +++ b/modules/editmagazine.php @@ -0,0 +1,74 @@ + +Zamiany zostały zapisane."; + } else { + echo "

Zmiany nie zostały zapisne.

"; + } + } + $tableName = 'magazines'; + $columnScheme = '*'; + if ( ! isset($_GET['id'] ) ) { + $whereValue = 'id = ' . intval($_POST['editmag-id']); + } else { + $whereValue = 'id = ' . intval($_GET['id']); + } + $editMagResult = dbQuery($connection, $tableName, $columnScheme, $whereValue) +?> + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +
+Nie odnaleziono takiego czasopisma."; + } +?> diff --git a/modules/magazine.php b/modules/magazine.php new file mode 100644 index 0000000..9313daf --- /dev/null +++ b/modules/magazine.php @@ -0,0 +1,48 @@ + +Nie można pobrać informacji o obiekcie"; + } +?> + +

+

+
+ +

Kategoria: + + + +

+

Adnotacje:
+ +

+

Opis:
+

+Link:" . $row[4] . "

"; +} +?> +
+
+<?php echo basename($row[1]); ?> +
diff --git a/modules/magazines.php b/modules/magazines.php new file mode 100644 index 0000000..5b8720f --- /dev/null +++ b/modules/magazines.php @@ -0,0 +1,55 @@ + + + +

Czasopisma:

+Kategoria: " . $category . ""; + } + if ( mysqliResult($connection, $magsQueryResult) ) { + echo ""; + echo ""; + if ( isset($_SESSION['username']) ) { + echo ""; + } + echo ""; + while ( $row = mysqli_fetch_row($magsQueryResult) ) { + echo ""; + echo ""; + if ( isset($_SESSION['username']) ) { + echo ""; + echo ""; + } + echo ""; + } + echo "
CzasopismaEdytujUsuń
" . $row[2] . "
"; + echo "" . $row[1] . "
"; + echo ""; + echo "
"; + } +?>