Files
vokspace/marks2.php
2026-01-02 21:00:45 +01:00

577 lines
19 KiB
PHP

<?php session_start();
$item = strip_tags(htmlentities($_GET["item"]));
?>
<!DOCTYPE html>
<html>
<head>
<title>Meine Noten | 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='myaccount'" title="Mein Account"><i class="far fa-user-circle"></i>Mein Account</div>
<div onclick="window.location.href='index'" title="Meine Noten"><i class="fas fa-table"></i>Meine Noten</div>
<div onclick="openWindowLayer(4)" title="Meine VokabelBox durchsuchen"><i class="fas fa-search"></i>Suchen</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>
<main id="main">
<div class="middle">
<?php
require "files/ezine_db.inc.php";
include "files/loginscript.inc.php";
include "files/errorcodesscript.inc.php";
if($LoggedIn == 'true') {
$action = strip_tags(htmlentities($_GET["action"]));
if($action == 'add-subject' || $action == 'edit-item' || $action == 'add-vokab' || $action == 'edit-folder') {
$item = $_SESSION["item"];
$_SESSION["item"] = $item;
if($action == 'add-subject') {
$arrow_nav = 'marks';
print(
" <form action='/actions/add-subject' method='post'>
<input type='text' autofocus required name='folderTEXT' maxlength='30' placeholder='Fachname'><br>
<div class='color-select-box'>
<input type='radio' name='color' value='FF5E5E' required>
<input type='radio' name='color' value='FF9D5E' required>
<input type='radio' name='color' value='FFBB5E' required>
<input type='radio' name='color' value='FFDF5E' required>
<input type='radio' name='color' value='FFFA5E' required>
<input type='radio' name='color' value='EBFF5E' required>
<input type='radio' name='color' value='CCFF5E' required>
<input type='radio' name='color' value='A5FF5E' required>
<input type='radio' name='color' value='87FF5E' required>
<input type='radio' name='color' value='5EFF5E' required>
<input type='radio' name='color' value='5EFFB1' required>
<input type='radio' name='color' value='5EFFD6' required>
<input type='radio' name='color' value='5EE2FF' required>
<input type='radio' name='color' value='5EC7FF' required>
<input type='radio' name='color' value='5EA5FF' required>
<input type='radio' name='color' value=5E83FF'' required>
<input type='radio' name='color' value='795EFF' required>
<input type='radio' name='color' value='A55EFF' required>
<input type='radio' name='color' value='D85EFF' required>
<input type='radio' name='color' value='FF5EFA' required>
<input type='radio' name='color' value='FF5ED6' required>
<input type='radio' name='color' value='FF5EB8' required>
<input type='radio' name='color' value='FF5E8F' required>
<input type='radio' name='color' value='FF5E79' required>
</div>
<input value='Fach erstellen' class='classic-button classic-button-grey' type='submit'>
</form>
");
}
if($action == 'delete-subject') {
$_SESSION["redirect"] = 'index';
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE `Nutzername` = '$Benutzername' AND `ID` = '$folderID' AND `Sprache1` = ''";
$result_articles = $conn->query($sql);
while ($articleDb = mysqli_fetch_object($result_articles)) {
$folderTEXT = $articleDb->Ordner;
}
print(
" <h2>Bist du dir sicher? Es werden alle Vokabeln mitgel&ouml;scht!</h2>
<p>Ordnername: <b>$folderTEXT</b></p>
<form action='actions/delete-folder' method='post'>
<input value='L&ouml;schen' class='classic-button classic-button-red' type='submit'>
</form>
");
}
if($action == 'add-item') {
$_SESSION["redirect"] = 'index';
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE `Nutzername` = '$Benutzername' AND `ID` = '$folderID' AND `Sprache1` = ''";
$result_articles = $conn->query($sql);
while ($articleDb = mysqli_fetch_object($result_articles)) {
$folderTEXT = $articleDb->Ordner;
}
if($number_rows == '') {
$number_rows = '10';
}
if($number_rows <= '0' || $number_rows > '100' && $number_rows < '500') {
print("<script> alert('Ungueltiger Wert.'); </script>");
print("<meta http-equiv='refresh' content='0; URL=index?action=add-vokab&number-rows=10'>");
}
else {
if($number_rows >= '500') {
print("<script> alert('Sach mal, willst du, dass mir der Server abraucht?!'); </script>");
print("<meta http-equiv='refresh' content='0; URL=index?action=add-vokab&number-rows=10'>");
}
else {
print(
" <p>Ordner: <b>$folderTEXT</b></p>
<p>Anzahl Reihen:</p>
<form action='index' method='get'>
<input type='hidden' name='action' value='add-vokab'>
<input type='number' value='$number_rows' step='5' max='100' min='0' name='number-rows'>
<button type='submit'>&Uuml;bernehmen</button>
</form>
<p><i class='fas fa-exclamation-triangle'> </i>Vorsicht! Es werden alle Eintr&auml;ge entfernt!</p>
<form action='actions/add-vokab' method='post'>
<input type='hidden' name='number-rows' value='$number_rows'>
<table class='vok-table'>
<tr>
<td><b>Muttersprache</b></td>
<td><b>Sprache 2</b></td>
</tr>");
while($number_rows > '0') {
print(
"<tr>
<td><input maxlength='100' type='text' name='Vok$number_rows-1'></td>
<td><input maxlength='100' type='text' name='Vok$number_rows-2'></td>
</tr>");
$number_rows = $number_rows - 1;
}
print("
</table>
<p>Nur vollst&auml;ndige Zeilen werden hinzugef&uuml;gt.</p>
<input value='Hinzuf&uuml;gen' class='classic-button classic-button-grey' type='submit'>
</form>
");
}
}
}
if($action == 'edit-item') {
$_SESSION["redirect"] = 'index';
$sql = "SELECT * FROM `VokabelBoxNoten` WHERE `Nutzername` = '$Benutzername' AND `ID` = '$item'";
$result_articles = $conn->query($sql);
if(!mysqli_num_rows($result_articles))
{
$arrow_nav = 'marks?item=' . $item;
print("<h3>Das hat nicht geklappt...</h3>
<p style='font-size: 70px; margin-top: 25px;' class='fas fa-bug'></p>");
}
else {
while ($articleDb = mysqli_fetch_object($result_articles)) {
print(
" <h2>$articleDb->Titel</h2>
<h4>Zensur</h4>
<select>
");
if($articleDb->Note == '1') {
print(
" <option value='1.0' name='zensur' selected>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1</option>
");
}
else {
print(
" <option value='1.0' name='zensur'>1</option>
");
}
if($articleDb->Note == '1.3') {
print(
" <option value='1.3' name='zensur' selected>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1-</option>
");
}
else {
print(
" <option value='1.3' name='zensur'>1-</option>
");
}
if($articleDb->Note == '1.7') {
print(
" <option value='1.7' name='zensur' selected>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2+</option>
");
}
else {
print(
" <option value='1.7' name='zensur'>2+</option>
");
}
if($articleDb->Note == '2') {
print(
" <option value='2.0' name='zensur' selected>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2</option>
");
}
else {
print(
" <option value='2.0' name='zensur'>2</option>
");
}
if($articleDb->Note == '2.3') {
print(
" <option value='2.3' name='zensur' selected>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2-</option>
");
}
else {
print(
" <option value='2.3' name='zensur'>2-</option>
");
}
if($articleDb->Note == '2.7') {
print(
" <option value='2.7' name='zensur' selected>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3+</option>
");
}
else {
print(
" <option value='2.7' name='zensur'>3+</option>
");
}
if($articleDb->Note == '3.0') {
print(
" <option value='3.0' name='zensur' selected>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3</option>
");
}
else {
print(
" <option value='3.0' name='zensur'>3</option>
");
}
if($articleDb->Note == '3.3') {
print(
" <option value='3.3' name='zensur' selected>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3-</option>
");
}
else {
print(
" <option value='3.3' name='zensur'>3-</option>
");
}
if($articleDb->Note == '3.7') {
print(
" <option value='3.7' name='zensur' selected>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4+</option>
");
}
else {
print(
" <option value='3.7' name='zensur'>4+</option>
");
}
if($articleDb->Note == '4.0') {
print(
" <option value='4.0' name='zensur' selected>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4</option>
");
}
else {
print(
" <option value='4.0' name='zensur'>4</option>
");
}
if($articleDb->Note == '4.3') {
print(
" <option value='4.3' name='zensur' selected>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4-</option>
");
}
else {
print(
" <option value='4.3' name='zensur'>4-</option>
");
}
if($articleDb->Note == '4.7') {
print(
" <option value='4.7' name='zensur' selected>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5+</option>
");
}
else {
print(
" <option value='4.7' name='zensur'>5+</option>
");
}
if($articleDb->Note == '5.0') {
print(
" <option value='5.0' name='zensur' selected>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5</option>
");
}
else {
print(
" <option value='5.0' name='zensur'>5</option>
");
}
if($articleDb->Note == '5.3') {
print(
" <option value='5.3' name='zensur' selected>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5-</option>
");
}
else {
print(
" <option value='5.3' name='zensur'>5-</option>
");
}
if($articleDb->Note == '6.0') {
print(
" <option value='6.0' name='zensur' selected>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6</option>
");
}
else {
print(
" <option value='6.0' name='zensur'>6</option>
");
}
print(
" </select>
");
}
}
}
}
else {
$_SESSION["redirect"] = 'index';
if($item == '') {
$sql = "SELECT DISTINCT * FROM `VokabelBoxNoten` WHERE `Nutzername` = '$Benutzername' AND `Titel` = ''";
$result_articles = $conn->query($sql);
print(
" <select>
<option disabled>--Schuljahr w&auml;hlen--</option>");
while ($articleDb = mysqli_fetch_object($result_articles)) {
print(
" <option value='NEWYEAR'>$article</option>");
}
print(
" <option value='NEWYEAR'>--Neues Schuljahr erstellen--</option>
</select>");
$sql = "SELECT DISTINCT * FROM `VokabelBoxNoten` WHERE `Nutzername` = '$Benutzername' AND `Titel` = ''";
$result_articles = $conn->query($sql);
if(!mysqli_num_rows($result_articles))
{
print(
" <p>Du hast keine F&auml;cher</p>
<a class=\"fas fa-folder-plus no-formatting icon\" href=\"index?action=add-folder\"></a>
");
}
else {
while ($articleDb = mysqli_fetch_object($result_articles)) {
print(
" <div class='subject-select' style='border-left: 6px solid #$articleDb->Farbe' onclick=\"window.location.href='marks?item=$articleDb->ID'\">
<span>$articleDb->Fach</span>
<h3>3-</h3>
</div>
");
}
}
print(
' <a class="far fa-plus-square no-formatting icon" href="marks?action=add-subject"></a>
');
}
if($item != '' && strpos($item, "-") != '0') {
$arrow_nav = 'marks?item=' . strstr($item, '-', true);
$sql = "SELECT * FROM `VokabelBoxNoten` WHERE `Nutzername` = '$Benutzername' AND `ID` = '$item'";
$result_articles = $conn->query($sql);
if(!mysqli_num_rows($result_articles))
{
print(" <p><i>Fehler</i></p>
");
}
else {
$gesamt_anzahl = mysqli_num_rows($result_articles);
while ($articleDb = mysqli_fetch_object($result_articles)) {
$mark_non_decimal = $articleDb->Note;
$mark_non_decimal = str_replace(".3", "-", "$mark_non_decimal");
$mark_non_decimal = str_replace(".7", "+", "$mark_non_decimal");
if($mark_non_decimal == '1+') {
$mark_non_decimal = '2+';
}
else {
if($mark_non_decimal == '2+') {
$mark_non_decimal = '3+';
}
else {
if($mark_non_decimal == '3+') {
$mark_non_decimal = '4+';
}
else {
if($mark_non_decimal == '4+') {
$mark_non_decimal = '5+';
}
else {
if($mark_non_decimal == '5+') {
$mark_non_decimal = '6+';
}
}
}
}
}
print(" <h2>$articleDb->Titel</h2>
<h4>Zensur: $mark_non_decimal ($articleDb->Note)</h4>
<h4>Fach: -err-</h4>
");
if($articleDb->Bezeichnung == '1') {
print(" <h4>Typ: Hausaufgaben&uuml;berp&uuml;fung</h4>
<h4>Wertung: 10% d. Gesamtnote</h4>
");
}
if($articleDb->Bezeichnung == '3') {
print(" <h4>Typ: Arbeit</h4>
<h4>Wertung: 30% d. Gesamtnote</h4>
");
}
if($articleDb->Bezeichnung == '2') {
print(" <h4>Typ: Test</h4>
<h4>Wertung: 20% d. Gesamtnote</h4>
");
}
if($articleDb->Bezeichnung == '4') {
print(" <h4>Typ: Epochalnote</h4>
<h4>Wertung: 40% d. Gesamtnote</h4>
");
}
print(" <h4>Geschrieben am: $articleDb->Datum</h4>
");
}
$_SESSION["item"] = $item;
print(
" <button onclick=\"window.location.href='marks?action=edit-item'\" class='classic-button classic-button-grey'>
<i class='fas fa-pen'> </i>
Bearbeiten
</button>
<br>
");
}
}
else {
if(strpos($item, "-") == '0' && $item != '') {
$sql = "SELECT * FROM `VokabelBoxNoten` WHERE `Nutzername` = '$Benutzername' AND `ID` = '$item' AND `Titel` = ''";
$result_articles = $conn->query($sql);
while ($articleDb = mysqli_fetch_object($result_articles)) {
$subjectTEXT = $articleDb->Fach;
}
$arrow_nav = 'marks';
$sql = "SELECT * FROM `VokabelBoxNoten` WHERE `Nutzername` = '$Benutzername' AND `ID` LIKE '%$item%' AND `Titel` != ''";
$result_articles = $conn->query($sql);
if(!mysqli_num_rows($result_articles))
{
print(" <h2><b>$subjectTEXT</b></h2>
<p><i>Keine eingetragenen Noten</i></p>
");
}
else {
print(
" <h2><b>$subjectTEXT</b></h2>
");
while ($articleDb = mysqli_fetch_object($result_articles)) {
$mark_non_decimal = $articleDb->Note;
$mark_non_decimal = str_replace(".3", "-", "$mark_non_decimal");
$mark_non_decimal = str_replace(".7", "+", "$mark_non_decimal");
if($mark_non_decimal == '1+') {
$mark_non_decimal = '2+';
}
else {
if($mark_non_decimal == '2+') {
$mark_non_decimal = '3+';
}
else {
if($mark_non_decimal == '3+') {
$mark_non_decimal = '4+';
}
else {
if($mark_non_decimal == '4+') {
$mark_non_decimal = '5+';
}
else {
if($mark_non_decimal == '5+') {
$mark_non_decimal = '6+';
}
}
}
}
}
print(" <div class='subject-item-list' onclick='window.location.href=\"marks?item=$articleDb->ID\"'>
<div>
<h4>$articleDb->Titel</h4>
<h3>$mark_non_decimal</h3>
</div>
</div>
");
}
print(
" </table>
<br>
");
print(
" <a href='index?action=add-vokab' class='no-formatting icon fas fa-plus-circle'></a>
");
}
}
}
}
}
?>
<p class="impressum"><a class="no-formatting" href="https://www.timvandenboom.de/impressum">Impressum</a><p>
</div>
</main>
<a id='show-not-arrow' class='fas fa-arrow-left back no-formatting' onclick='closeWindowLayer()'></a>
<?php
if($LoggedIn == 'true') {
if(isset($arrow_nav)) {
print(
" <a id='back-arrow' class='fas fa-arrow-left back no-formatting' href='$arrow_nav'></a>
");
}
}
?>
</body>
</html>