211 lines
8.1 KiB
PHP
211 lines
8.1 KiB
PHP
<?php session_start();
|
|
|
|
$sitename = 'library';
|
|
|
|
$page = strip_tags(htmlentities($_GET["p"]));
|
|
$folderID = strip_tags(htmlentities($_GET["folderID"]));
|
|
|
|
$sitename = 'library?folderID=' . $folderID;
|
|
|
|
require "files/ezine_db.inc.php";
|
|
include "files/loginscript.inc.php";
|
|
|
|
if($LoggedIn == 'true') {
|
|
|
|
|
|
|
|
if($page == '') {
|
|
$page = '1';
|
|
}
|
|
$showResults = $page * 10 - 10;
|
|
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Bibliothek | Vokabelbox</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="stylesheet" href="files/style.css" />
|
|
<script language="javascript" type="text/javascript" src="files/scripts.js"></script>
|
|
<meta name="google-site-verification" content="zP1CNCQcUP1lr3cYAUMljl5D-GqiUphk-1NdrFS5g6g" />
|
|
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
|
|
<link rel="apple-touch-icon" sizes="57x57" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-57x57.png">
|
|
<link rel="apple-touch-icon" sizes="60x60" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-60x60.png">
|
|
<link rel="apple-touch-icon" sizes="72x72" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-72x72.png">
|
|
<link rel="apple-touch-icon" sizes="76x76" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-76x76.png">
|
|
<link rel="apple-touch-icon" sizes="114x114" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-114x114.png">
|
|
<link rel="apple-touch-icon" sizes="120x120" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-120x120.png">
|
|
<link rel="apple-touch-icon" sizes="144x144" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-144x144.png">
|
|
<link rel="apple-touch-icon" sizes="152x152" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-152x152.png">
|
|
<link rel="apple-touch-icon" sizes="180x180" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-180x180.png">
|
|
<link rel="icon" type="image/png" sizes="192x192" href="https://www.timvandenboom.de/Favicons/VokabelBox/android-icon-192x192.png">
|
|
<link rel="icon" type="image/png" sizes="32x32" href="https://www.timvandenboom.de/Favicons/VokabelBox/favicon-32x32.png">
|
|
<link rel="icon" type="image/png" sizes="96x96" href="https://www.timvandenboom.de/Favicons/VokabelBox/favicon-96x96.png">
|
|
<link rel="icon" type="image/png" sizes="16x16" href="https://www.timvandenboom.de/Favicons/VokabelBox/favicon-16x16.png">
|
|
<meta name="msapplication-TileColor" content="#ffffff">
|
|
<meta name="msapplication-TileImage" content="https://www.timvandenboom.de/Favicons/VokabelBox/ms-icon-144x144.png">
|
|
<meta name="theme-color" content="#ffffff">
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<p onclick="window.location.href='index'"></p>
|
|
<div class="more-menu">
|
|
<button class="fas fa-ellipsis-v"></button>
|
|
<div class="more-menu-content">
|
|
<div onclick="window.location.href='index'" title="VokabelBox"><i class="fas fa-home"></i>VokabelBox</div>
|
|
<div onclick="window.location.href='myaccount'" title="Mein Account"><i class="far fa-user-circle"></i>Mein Account</div>
|
|
<div onclick="window.location.href='marks'" title="Meine Noten"><i class="fas fa-table"></i>Meine Noten</div>
|
|
<div onclick="window.location.href='search'" title="Meine VokabelBox durchsuchen"><i class="fas fa-search"></i>Suchen</div>
|
|
<div onclick="window.location.href='help'" title="Hilfecenter öffnen"><i class="fas fa-question-circle"></i>Hilfe</div>
|
|
<div onclick="window.location.href='actions/logout'" title="Von VokabelBox abmelden"><i class="fas fa-sign-out-alt"></i>Ausloggen</div>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<?php
|
|
|
|
$_SESSION["import-from"] = $folderID;
|
|
|
|
print(
|
|
" <form action='actions/add-vokab' method='post' id='window-6' class='window'>
|
|
<select name='import-to'>
|
|
<option disabled>---Bitte Ordner waehlen---</option>
|
|
<option disabled></option>
|
|
");
|
|
|
|
$sql = "SELECT DISTINCT `Ordner`,`ID` FROM `VokabelBoxVokabeln` WHERE `Nutzername` = '$Benutzername' AND `Ordner` != ''";
|
|
|
|
$result_articles = $conn->query($sql);
|
|
|
|
if(!mysqli_num_rows($result_articles))
|
|
{
|
|
print(
|
|
" <option disabled>---Keine Ordner gefunden---</option>");
|
|
}
|
|
else {
|
|
while ($articleDb = mysqli_fetch_object($result_articles)) {
|
|
print(
|
|
" <option selected value='$articleDb->ID'>$articleDb->Ordner</option>
|
|
");
|
|
}
|
|
}
|
|
|
|
print(
|
|
" <option disabled></option>
|
|
<option value='NEWFOLDER-LIBRARY'>(Oder: neuen Ordner erstellen)</option>
|
|
</select>
|
|
<br>
|
|
<button type='submit' class='classic-button classic-button-grey'><i class='fas fa-file-download'></i> Importieren</button>
|
|
</form>
|
|
");
|
|
|
|
?>
|
|
<main id="main">
|
|
<div class="middle">
|
|
<?php
|
|
|
|
include "files/errorcodesscript.inc.php";
|
|
|
|
if($folderID == '') {
|
|
|
|
print(
|
|
" <h2>Bibliothek</h2>
|
|
");
|
|
|
|
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE `Public` = '1' AND `Sprache1` = '' AND `Sprache2` = ''";
|
|
$result_articles = $conn->query($sql);
|
|
$gesamt_anzahl = mysqli_num_rows($result_articles);
|
|
|
|
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE `Public` = '1' AND `Sprache1` = '' AND `Sprache2` = '' LIMIT $showResults,10";
|
|
$result_articles = $conn->query($sql);
|
|
|
|
if(!mysqli_num_rows($result_articles))
|
|
{
|
|
print(
|
|
" <h4>Hmm... Recht still hier. Sei Du der erste, der einen Ordner freigibt!</h4>
|
|
");
|
|
}
|
|
else {
|
|
while ($articleDb = mysqli_fetch_object($result_articles)) {
|
|
print(
|
|
" <div onclick=\"window.location.href='?folderID=$articleDb->ID'\" class='library-folder'>
|
|
<span>$articleDb->Ordner</span>
|
|
</div>
|
|
");
|
|
}
|
|
if($page > '1') {
|
|
$pageMINUS = $page - 1;
|
|
print(
|
|
"<button class='list-page-nav fas fa-caret-left' onclick='window.location.href=\"library?p=$pageMINUS\"' class='fas fa-caret-right'></button>
|
|
");
|
|
}
|
|
print(
|
|
"<span class='list-page-nav'>$page</span>
|
|
");
|
|
if($gesamt_anzahl > $page * 10) {
|
|
$pagePLUS = $page + 1;
|
|
print(
|
|
"<button class='list-page-nav fas fa-caret-right' onclick='window.location.href=\"library?p=$pagePLUS\"' class='fas fa-caret-right'></button>
|
|
");
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
|
|
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE `ID` = '$folderID' AND `Sprache1` = '' AND `Public` = '1'";
|
|
$result_articles = $conn->query($sql);
|
|
while ($articleDb = mysqli_fetch_object($result_articles)) {
|
|
$folderTEXT = $articleDb->Ordner;
|
|
$Nutzername = $articleDb->Nutzername;
|
|
}
|
|
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE `ID` = '$folderID' AND `Sprache1` != '' AND `Public` = '1'";
|
|
$result_articles = $conn->query($sql);
|
|
if(!mysqli_num_rows($result_articles))
|
|
{
|
|
print(
|
|
" Es gibt keinen Ordner unter dieser ID, oder er beinhaltet keine Vokabeln.");
|
|
}
|
|
else {
|
|
print(
|
|
" <h2>$folderTEXT</h2>
|
|
<p>von $Nutzername</p>
|
|
<table class='vok-table'>
|
|
<tr>
|
|
<td><b>Sprache 1</b></td>
|
|
<td><b>Sprache 2</b></td>
|
|
</tr>
|
|
");
|
|
while ($articleDb = mysqli_fetch_object($result_articles)) {
|
|
print(
|
|
" <tr>
|
|
<td>$articleDb->Sprache1</td>
|
|
<td>$articleDb->Sprache2</td>
|
|
</tr>
|
|
");
|
|
}
|
|
|
|
|
|
print(
|
|
" </table>
|
|
<button onclick=\"openWindow(6)\" class='classic-button classic-button-grey'><i class='fas fa-file-download'></i> Importieren</button>
|
|
");
|
|
|
|
}
|
|
}
|
|
|
|
?>
|
|
<p class="impressum"><a class="no-formatting" href="https://www.timvandenboom.de/impressum">Impressum</a><p>
|
|
</div>
|
|
</main>
|
|
<a id="back-arrow-window" class="fas fa-arrow-left back no-formatting" onclick="closeWindow(4)"></a>
|
|
<?php
|
|
|
|
if($folderID != '') {
|
|
?>
|
|
<a id='back-arrow' class='fas fa-arrow-left back no-formatting' href='library'></a>
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
</body>
|
|
</html>
|