Initial commit
This commit is contained in:
66
actions/add-folder.php
Normal file
66
actions/add-folder.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php session_start();
|
||||
|
||||
$Benutzername = $_SESSION["Benutzername"];
|
||||
$Passwort = $_SESSION["Passwort"];
|
||||
|
||||
$_SESSION["Benutzername"] = $Benutzername;
|
||||
$_SESSION["Passwort"] = $Passwort;
|
||||
|
||||
$folderTEXT = strip_tags(htmlentities($_POST["folderTEXT"]));
|
||||
|
||||
$folderTEXT = str_replace('\'', ''', $folderTEXT);
|
||||
$folderTEXT = str_replace('\\', '\', $folderTEXT);
|
||||
|
||||
$forwarding = $_SESSION["forwarding"];
|
||||
unset($_SESSION["forwarding"]);
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<?php print("<meta http-equiv='refresh' content='1; URL=../$redirect'>"); ?>
|
||||
<link rel="stylesheet" href="../files/style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
|
||||
|
||||
require "../files/ezine_db.inc.php";
|
||||
|
||||
include "../files/loginscript.inc.php";
|
||||
|
||||
include "../files/errorcodesscript.inc.php";
|
||||
|
||||
if($LoggedIn == 'true') {
|
||||
$ID = '';
|
||||
$string = "0123456789ABCDEFGHJIKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
||||
for ($i = 1; $i <= 8; $i++)
|
||||
{
|
||||
$zufallszahl = rand(0, 62);
|
||||
$zufallszahl = substr($string, $zufallszahl, 1);
|
||||
$ID = $ID . $zufallszahl;
|
||||
}
|
||||
|
||||
if(empty($folderTEXT) || empty($Benutzername)) {
|
||||
$_SESSION["errorCode"] = 'generalError';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../$forwarding'>");
|
||||
}
|
||||
else {
|
||||
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE (`Nutzername` = '$Benutzername') AND (`Ordner` = '$folderTEXT')";
|
||||
$result_articles = $conn->query($sql);
|
||||
|
||||
if(mysqli_num_rows($result_articles))
|
||||
{
|
||||
$_SESSION["errorCode"] = 'createFolderDouble';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../$forwarding'>");
|
||||
}
|
||||
else {
|
||||
$conn->query("INSERT INTO `VokabelBoxVokabeln` (`Sprache1`,`Sprache2`,`Nutzername`,`Ordner`,`ID`) VALUES ('','','$Benutzername','$folderTEXT','$ID')");
|
||||
$_SESSION["errorCode"] = 'createFolderSuccess';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../$forwarding'>");
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
126
actions/add-item.php
Normal file
126
actions/add-item.php
Normal file
@@ -0,0 +1,126 @@
|
||||
<?php session_start();
|
||||
|
||||
$Benutzername = $_SESSION["Benutzername"];
|
||||
$Passwort = $_SESSION["Passwort"];
|
||||
|
||||
$_SESSION["Benutzername"] = $Benutzername;
|
||||
$_SESSION["Passwort"] = $Passwort;
|
||||
|
||||
$type = $_SESSION["type"];
|
||||
$item = $_SESSION["item"];
|
||||
|
||||
unset($_SESSION["type"]);
|
||||
unset($_SESSION["item"]);
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<?php print("<meta http-equiv='refresh' content='1; URL=../$redirect'>"); ?>
|
||||
<link rel="stylesheet" href="../files/style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
|
||||
|
||||
require "../files/ezine_db.inc.php";
|
||||
|
||||
include "../files/loginscript.inc.php";
|
||||
|
||||
include "../files/errorcodesscript.inc.php";
|
||||
|
||||
if($LoggedIn == 'true') {
|
||||
|
||||
if($type != 'year' && $type != 'subject' && $type != 'entry' || empty($Benutzername) || empty($item)) {
|
||||
$_SESSION["errorCode"] = 'generalError';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../marks'>");
|
||||
}
|
||||
|
||||
if($type == 'year') {
|
||||
|
||||
$Name = strip_tags(htmlentities($_POST["Name"]));
|
||||
$Name = str_replace('\'', ''', $Name);
|
||||
$Name = str_replace('\\', '\', $Name);
|
||||
|
||||
if(empty($Name)) {
|
||||
$_SESSION["errorCode"] = 'generalError';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../marks?item=$item'>");
|
||||
}
|
||||
else {
|
||||
$generiert = '';
|
||||
$string = "0123456789ABCDEFGHJIKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
||||
for ($i = 1; $i <= 8; $i++)
|
||||
{
|
||||
$zufallszahl = rand(0, 62);
|
||||
$zufallszahl = substr($string, $zufallszahl, 1);
|
||||
$generiert = $generiert . $zufallszahl;
|
||||
}
|
||||
$conn->query("INSERT INTO `VokabelBoxNoten` (`Titel`,`ID`,`Nutzername`) VALUES ('$Name','$generiert','$Benutzername')");
|
||||
$_SESSION["errorCode"] = 'createYearSuccess';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../marks?item=$generiert:1'");
|
||||
}
|
||||
}
|
||||
|
||||
if($type == 'subject') {
|
||||
|
||||
$Name = strip_tags(htmlentities($_POST["Name"]));
|
||||
$Name = str_replace('\'', ''', $Name);
|
||||
$Name = str_replace('\\', '\', $Name);
|
||||
$Color = strip_tags(htmlentities($_POST["color"]));
|
||||
|
||||
if(empty($Name) || ($Color != 'FF5E5E' && $Color != 'FF9D5E' && $Color != 'FFBB5E' && $Color != 'FFDF5E' && $Color != 'FFFA5E' && $Color != 'EBFF5E' && $Color != 'CCFF5E' && $Color != 'A5FF5E' && $Color != '87FF5E' && $Color != '5EFF5E' && $Color != '5EFFB1' && $Color != '5EFFD6' && $Color != '5EE2FF' && $Color != '5EC7FF' && $Color != '5EA5FF' && $Color != '5E83FF' && $Color != '795EFF' && $Color != 'A55EFF' && $Color != 'D85EFF' && $Color != 'FF5EFA' && $Color != 'FF5ED6' && $Color != 'FF5EB8' && $Color != 'FF5E8F' && $Color != 'FF5E79')) {
|
||||
$_SESSION["errorCode"] = 'generalError';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../marks?item=$item'>");
|
||||
}
|
||||
else {
|
||||
$generiert = '';
|
||||
$string = "0123456789ABCDEFGHJIKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
||||
for ($i = 1; $i <= 8; $i++)
|
||||
{
|
||||
$zufallszahl = rand(0, 62);
|
||||
$zufallszahl = substr($string, $zufallszahl, 1);
|
||||
$generiert = $generiert . $zufallszahl;
|
||||
}
|
||||
$conn->query("INSERT INTO `VokabelBoxNoten` (`Note`,`Fach`,`ID`,`Nutzername`,`Farbe`) VALUES ('-','$Name','$item-$generiert','$Benutzername','$Color')");
|
||||
$_SESSION["errorCode"] = 'createSubjectSuccess';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../marks?item=$item-$generiert'");
|
||||
}
|
||||
}
|
||||
|
||||
if($type == 'entry') {
|
||||
|
||||
$Name = strip_tags(htmlentities($_POST["Name"]));
|
||||
$Name = str_replace('\'', ''', $Name);
|
||||
$Name = str_replace('\\', '\', $Name);
|
||||
$Type = strip_tags(htmlentities($_POST["type"]));
|
||||
$Mark = strip_tags(htmlentities($_POST["mark"]));
|
||||
$Date = strip_tags(htmlentities($_POST["date"]));
|
||||
$Date = date("d.m.Y", strtotime($Date));
|
||||
|
||||
if(empty($Name) || empty($Type) || ($Type != '1' && $Type != '2' && $Type != '3' && $Type != '4') || empty($Mark) || ($Mark != '1' && $Mark != '1.3' && $Mark != '1.7' && $Mark != '2' && $Mark != '2.3' && $Mark != '2.7' && $Mark != '3' && $Mark != '3.3' && $Mark != '3.7' && $Mark != '4' && $Mark != '4.3' && $Mark != '4.7' && $Mark != '5' && $Mark != '5.3' && $Mark != '5.7' && $Mark != '6')) {
|
||||
$_SESSION["errorCode"] = 'generalError';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../marks?item=$item'>");
|
||||
}
|
||||
else {
|
||||
$generiert = '';
|
||||
$string = "0123456789ABCDEFGHJIKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
||||
for ($i = 1; $i <= 8; $i++)
|
||||
{
|
||||
$zufallszahl = rand(0, 62);
|
||||
$zufallszahl = substr($string, $zufallszahl, 1);
|
||||
$generiert = $generiert . $zufallszahl;
|
||||
}
|
||||
$ID = $item . '_' . $generiert;
|
||||
$conn->query("INSERT INTO `VokabelBoxNoten` (`Titel`,`Note`,`ID`,`Bezeichnung`,`Nutzername`,`Datum`) VALUES ('$Name','$Mark','$ID','$Type','$Benutzername','$Date')");
|
||||
$_SESSION["errorCode"] = 'createEntrySuccess';
|
||||
?>
|
||||
<meta http-equiv='refresh' content='0; URL=../marks?item=<?php print("$item"); ?>_<?php print("$generiert"); ?>'>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
109
actions/add-vokab.php
Normal file
109
actions/add-vokab.php
Normal file
@@ -0,0 +1,109 @@
|
||||
<?php session_start();
|
||||
|
||||
$Benutzername = $_SESSION["Benutzername"];
|
||||
$Passwort = $_SESSION["Passwort"];
|
||||
|
||||
$_SESSION["Benutzername"] = $Benutzername;
|
||||
$_SESSION["Passwort"] = $Passwort;
|
||||
|
||||
$redirect = $_SESSION["redirect"];
|
||||
$parameter = $_SESSION["parameter"];
|
||||
|
||||
$import_to = strip_tags(htmlentities($_POST["import-to"]));
|
||||
$import_from = strip_tags(htmlentities($_SESSION["import-from"]));
|
||||
unset($_SESSION["import-from"]);
|
||||
|
||||
$folderID = strip_tags(htmlentities($_SESSION["folderID"]));
|
||||
$number_rows = strip_tags(htmlentities($_POST["number-rows"]));
|
||||
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="../files/style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<div class="middle">
|
||||
<div class="bar-content">
|
||||
<div class="bar1 bar"></div>
|
||||
<div class="bar2 bar"></div>
|
||||
<div class="bar3 bar"></div>
|
||||
<div class="bar4 bar"></div>
|
||||
<div class="bar5 bar"></div>
|
||||
<div class="bar6 bar"></div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<?php
|
||||
|
||||
require "../files/ezine_db.inc.php";
|
||||
|
||||
include "../files/loginscript.inc.php";
|
||||
|
||||
include "../files/errorcodesscript.inc.php";
|
||||
|
||||
if($LoggedIn == 'true') {
|
||||
if($import_to != '' && $import_from != '') {
|
||||
|
||||
if($import_to == 'NEWFOLDER-SHARE' || $import_to == 'NEWFOLDER-LIBRARY') {
|
||||
if($import_to == 'NEWFOLDER-SHARE') {
|
||||
$_SESSION["forwarding"] = 'share?id=' . $import_from;
|
||||
print("<meta http-equiv='refresh' content='0; URL=../index?action=add-folder'>");
|
||||
}
|
||||
if($import_to == 'NEWFOLDER-LIBRARY') {
|
||||
$_SESSION["forwarding"] = 'share?id=' . $import_from;
|
||||
print("<meta http-equiv='refresh' content='0; URL=../index?action=add-folder'>");
|
||||
}
|
||||
}
|
||||
else {
|
||||
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE `ID` = '$import_from' AND `Sprache1` != ''";
|
||||
|
||||
$result_articles = $conn->query($sql);
|
||||
while ($articleDb = mysqli_fetch_object($result_articles)) {
|
||||
|
||||
$conn->query("INSERT INTO `VokabelBoxVokabeln` (`Sprache1`,`Sprache2`,`Nutzername`,`ID`) VALUES ('$articleDb->Sprache1','$articleDb->Sprache2','$Benutzername','$import_to')");
|
||||
$_SESSION["errorCode"] = 'addVokabSuccess';
|
||||
|
||||
}
|
||||
print("<meta http-equiv='refresh' content='0; URL=../index?folderID=$import_to'>");
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
if(empty($folderID)) {
|
||||
$_SESSION["errorCode"] = 'generalError';
|
||||
print("<meta http-equiv='refresh' content='1; URL=../index?folderID=$folderID'>");
|
||||
}
|
||||
else{
|
||||
|
||||
while($number_rows > '0') {
|
||||
|
||||
${'Vok'.$number_rows.'_1'} = strip_tags(htmlentities($_POST['Vok'.$number_rows.'-1']));
|
||||
${'Vok'.$number_rows.'_2'} = strip_tags(htmlentities($_POST['Vok'.$number_rows.'-2']));
|
||||
|
||||
${'Vok'.$number_rows.'_1'} = str_replace('\'', ''', ${'Vok'.$number_rows.'_1'});
|
||||
${'Vok'.$number_rows.'_2'} = str_replace('\'', ''', ${'Vok'.$number_rows.'_2'});
|
||||
|
||||
${'Vok'.$number_rows.'_1'} = str_replace('\\', '\', ${'Vok'.$number_rows.'_1'});
|
||||
${'Vok'.$number_rows.'_2'} = str_replace('\\', '\', ${'Vok'.$number_rows.'_2'});
|
||||
|
||||
if(${'Vok'.$number_rows.'_1'} != '' && ${'Vok'.$number_rows.'_2'} != '') {
|
||||
$conn->query("INSERT INTO `VokabelBoxVokabeln` (`Sprache1`,`Sprache2`,`Nutzername`,`ID`) VALUES ('${'Vok'.$number_rows.'_1'}','${'Vok'.$number_rows.'_2'}','$Benutzername','$folderID')");
|
||||
}
|
||||
|
||||
$number_rows = $number_rows - 1;
|
||||
}
|
||||
|
||||
$_SESSION["errorCode"] = 'addVokabSuccess';
|
||||
print("<meta http-equiv='refresh' content='1; URL=../index?folderID=$folderID'>");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
77
actions/change-password.php
Normal file
77
actions/change-password.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php session_start();
|
||||
require "../files/ezine_db.inc.php";
|
||||
|
||||
$Benutzername = strip_tags(htmlentities($_SESSION["Benutzername"]));
|
||||
$Verification = $_SESSION["Verification"];
|
||||
if($Verification == 'true') {
|
||||
$LoggedIn = 'true';
|
||||
$forwarding = 'reset-password';
|
||||
}
|
||||
else {
|
||||
$forwarding = 'myaccount';
|
||||
$Passwort = strip_tags(htmlentities($_POST["Passwort"]));
|
||||
$Passwort = hash('sha512',$Passwort);
|
||||
$sql = "SELECT * FROM `VokabelBoxUsers` WHERE `Benutzername` = '$Benutzername' AND `Passwort` = '$Passwort'";
|
||||
$result_articles = $conn->query($sql);
|
||||
if(!mysqli_num_rows($result_articles))
|
||||
{
|
||||
$LoggedIn = 'false';
|
||||
}
|
||||
else {
|
||||
$LoggedIn = 'true';
|
||||
}
|
||||
}
|
||||
unset($_SESSION["Verification"]);
|
||||
$Passwort1 = strip_tags(htmlentities($_POST["Passwort1"]));
|
||||
$Passwort2 = strip_tags(htmlentities($_POST["Passwort2"]));
|
||||
|
||||
|
||||
$Passwort1 = hash('sha512',$Passwort1);
|
||||
$Passwort2 = hash('sha512',$Passwort2);
|
||||
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>VokabelBox</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../files/style.css" />
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
if(empty($Passwort1) || empty($Passwort2)) {
|
||||
$_SESSION["errorCode"] = 'generalError';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../$forwarding'>");
|
||||
}
|
||||
else{
|
||||
if($LoggedIn == 'true') {
|
||||
if($Passwort1 != $Passwort2) {
|
||||
$_SESSION["errorCode"] = 'keineUebereinstimmung';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../$forwarding'>");
|
||||
}
|
||||
else {
|
||||
|
||||
$conn->query("UPDATE `VokabelBoxUsers` SET `Passwort` = '$Passwort1',`UngueltigeLogins` = '0' WHERE `Benutzername` = '$Benutzername'");
|
||||
|
||||
$_SESSION["errorCode"] = 'success';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../myaccount'>");
|
||||
|
||||
$_SESSION["Benutzername"] = $Benutzername;
|
||||
$_SESSION["Passwort"] = $Passwort1;
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
$_SESSION["errorCode"] = 'wrongLogin';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../$forwarding'>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
42
actions/delete-folder.php
Normal file
42
actions/delete-folder.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php session_start();
|
||||
|
||||
$Benutzername = $_SESSION["Benutzername"];
|
||||
$Passwort = $_SESSION["Passwort"];
|
||||
|
||||
$_SESSION["Benutzername"] = $Benutzername;
|
||||
$_SESSION["Passwort"] = $Passwort;
|
||||
|
||||
$folderID = $_SESSION["folderID"];
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
|
||||
|
||||
require "../files/ezine_db.inc.php";
|
||||
|
||||
include "../files/loginscript.inc.php";
|
||||
|
||||
include "../files/errorcodesscript.inc.php";
|
||||
|
||||
if($LoggedIn == 'true') {
|
||||
$Folder = strip_tags(htmlentities($_POST["folder"]));
|
||||
|
||||
if(empty($folderID) || empty($Benutzername)) {
|
||||
$_SESSION["errorCode"] = 'generalError';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../index'>");
|
||||
}
|
||||
else {
|
||||
$conn->query("DELETE FROM `VokabelBoxVokabeln` WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID')");
|
||||
$_SESSION["errorCode"] = 'deleteFolderSuccess';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../index'>");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
52
actions/delete-item.php
Normal file
52
actions/delete-item.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php session_start();
|
||||
|
||||
$Benutzername = $_SESSION["Benutzername"];
|
||||
$Passwort = $_SESSION["Passwort"];
|
||||
|
||||
$_SESSION["Benutzername"] = $Benutzername;
|
||||
$_SESSION["Passwort"] = $Passwort;
|
||||
|
||||
$item = $_SESSION["item"];
|
||||
|
||||
unset($_SESSION["item"]);
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<?php print("<meta http-equiv='refresh' content='1; URL=../$redirect'>"); ?>
|
||||
<link rel="stylesheet" href="../files/style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
|
||||
|
||||
require "../files/ezine_db.inc.php";
|
||||
|
||||
include "../files/loginscript.inc.php";
|
||||
|
||||
include "../files/errorcodesscript.inc.php";
|
||||
|
||||
if($LoggedIn == 'true') {
|
||||
|
||||
if($item == '') {
|
||||
$_SESSION["errorCode"] = 'generalError';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../marks?item='>");
|
||||
}
|
||||
else {
|
||||
|
||||
if(strlen($item) == '10') {
|
||||
$item = substr($item, 0, -2);
|
||||
}
|
||||
|
||||
$conn->query("DELETE FROM `VokabelBoxNoten` WHERE `Nutzername` = '$Benutzername' AND `ID` = '$item'");
|
||||
$_SESSION["errorCode"] = 'deleteItemSuccess';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../marks'>");
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
116
actions/edit-folder.php
Normal file
116
actions/edit-folder.php
Normal file
@@ -0,0 +1,116 @@
|
||||
<?php session_start();
|
||||
|
||||
$_SESSION["redirect"] = 'edit-folder';
|
||||
|
||||
$Benutzername = $_SESSION["Benutzername"];
|
||||
$Passwort = $_SESSION["Passwort"];
|
||||
|
||||
$_SESSION["Benutzername"] = $Benutzername;
|
||||
$_SESSION["Passwort"] = $Passwort;
|
||||
|
||||
|
||||
$folderTEXT = strip_tags(htmlentities($_POST["folderTEXT"]));
|
||||
$folderID = $_SESSION["folderID"];
|
||||
$gesamt_anzahl = $_SESSION["gesamtAnzahl"];
|
||||
|
||||
$folderTEXT = str_replace('\'', ''', $folderTEXT);
|
||||
$folderTEXT = str_replace('\\', '\', $folderTEXT);
|
||||
|
||||
$savechange = strip_tags(htmlentities($_GET["savechange"]));
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="../files/style.css" />
|
||||
<meta http-equiv="refresh" content="2; URL=../index?folderID=<?php print("$folderID"); ?>">
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<div class="middle">
|
||||
<div class="bar-content">
|
||||
<div class="bar1 bar"></div>
|
||||
<div class="bar2 bar"></div>
|
||||
<div class="bar3 bar"></div>
|
||||
<div class="bar4 bar"></div>
|
||||
<div class="bar5 bar"></div>
|
||||
<div class="bar6 bar"></div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<?php
|
||||
|
||||
require "../files/ezine_db.inc.php";
|
||||
|
||||
include "../files/loginscript.inc.php";
|
||||
|
||||
include "../files/errorcodesscript.inc.php";
|
||||
|
||||
if($LoggedIn == 'true') {
|
||||
|
||||
if($savechange == 'publish') {
|
||||
|
||||
$conn->query("UPDATE `VokabelBoxVokabeln` SET `Public` = '1' WHERE `ID` = '$folderID' AND `Nutzername` = '$Benutzername'");
|
||||
|
||||
$_SESSION["errorCode"] = 'publicFolderSuccess';
|
||||
print("<meta http-equiv='refresh' content='2; URL=../library'>");
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
if($savechange == 'turnoff-publish') {
|
||||
|
||||
$conn->query("UPDATE `VokabelBoxVokabeln` SET `Public` = '0' WHERE `ID` = '$folderID' AND `Nutzername` = '$Benutzername'");
|
||||
|
||||
$_SESSION["errorCode"] = 'turnoffPublicFolderSuccess';
|
||||
print("<meta http-equiv='refresh' content='2; URL=../index?folderID=$folderID'>");
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
if(empty($folderTEXT) || empty($gesamt_anzahl)) {
|
||||
$_SESSION["errorCode"] = 'generalError';
|
||||
print("<meta http-equiv='refresh' content='2; URL=../index?folderID=$folderID'>");
|
||||
}
|
||||
else {
|
||||
|
||||
$sql = "SELECT `Public` FROM `VokabelBoxVokabeln` WHERE `Nutzername` = '$Benutzername' AND `ID` = '$folderID' AND `Sprache1` = '' AND `Sprache2` = ''";
|
||||
$result_articles = $conn->query($sql);
|
||||
while ($articleDb = mysqli_fetch_object($result_articles)) {
|
||||
$Public = $articleDb->Public;
|
||||
}
|
||||
|
||||
$conn->query("DELETE FROM `VokabelBoxVokabeln` WHERE `Nutzername` = '$Benutzername' AND `ID` = '$folderID'");
|
||||
|
||||
$conn->query("INSERT INTO `VokabelBoxVokabeln` (`Sprache1`,`Sprache2`,`Nutzername`,`ID`,`Ordner`,`Public`) VALUES ('','','$Benutzername','$folderID','$folderTEXT','$Public')");
|
||||
|
||||
$loop = 1;
|
||||
|
||||
while($loop <= $gesamt_anzahl) {
|
||||
|
||||
${'Vok'.$loop.'_1'} = strip_tags(htmlentities($_POST['Vok'.$loop.'-1']));
|
||||
${'Vok'.$loop.'_2'} = strip_tags(htmlentities($_POST['Vok'.$loop.'-2']));
|
||||
|
||||
${'Vok'.$loop.'_1'} = str_replace('\'', ''', ${'Vok'.$loop.'_1'});
|
||||
${'Vok'.$loop.'_2'} = str_replace('\'', ''', ${'Vok'.$loop.'_2'});
|
||||
|
||||
${'Vok'.$loop.'_1'} = str_replace('\\', '\', ${'Vok'.$loop.'_1'});
|
||||
${'Vok'.$loop.'_2'} = str_replace('\\', '\', ${'Vok'.$loop.'_2'});
|
||||
|
||||
if(${'Vok'.$loop.'_1'} != '' && ${'Vok'.$loop.'_2'} != '') {
|
||||
|
||||
$conn->query("INSERT INTO `VokabelBoxVokabeln` (`Sprache1`,`Sprache2`,`Nutzername`,`ID`,`Ordner`,`Public`) VALUES ('${'Vok'.$loop.'_1'}','${'Vok'.$loop.'_2'}','$Benutzername','$folderID','','$Public')");
|
||||
|
||||
}
|
||||
|
||||
$loop = $loop + 1;
|
||||
}
|
||||
$_SESSION["errorCode"] = 'editFolderSuccess';
|
||||
print("<meta http-equiv='refresh' content='2; URL=../index?folderID=$folderID'>");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
101
actions/edit-item.php
Normal file
101
actions/edit-item.php
Normal file
@@ -0,0 +1,101 @@
|
||||
<?php session_start();
|
||||
|
||||
$Benutzername = $_SESSION["Benutzername"];
|
||||
$Passwort = $_SESSION["Passwort"];
|
||||
|
||||
$_SESSION["Benutzername"] = $Benutzername;
|
||||
$_SESSION["Passwort"] = $Passwort;
|
||||
|
||||
$type = $_SESSION["type"];
|
||||
$item = $_SESSION["item"];
|
||||
|
||||
unset($_SESSION["type"]);
|
||||
unset($_SESSION["item"]);
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="../files/style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
|
||||
|
||||
require "../files/ezine_db.inc.php";
|
||||
|
||||
include "../files/loginscript.inc.php";
|
||||
|
||||
include "../files/errorcodesscript.inc.php";
|
||||
|
||||
if($LoggedIn == 'true') {
|
||||
|
||||
if($type != 'year' && $type != 'subject' && $type != 'entry' || empty($Benutzername) || empty($item)) {
|
||||
$_SESSION["errorCode"] = 'generalError';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../marks?item='>");
|
||||
}
|
||||
|
||||
if($type == 'year') {
|
||||
|
||||
$Name = strip_tags(htmlentities($_POST["Name"]));
|
||||
$Name = str_replace('\'', ''', $Name);
|
||||
$Name = str_replace('\\', '\', $Name);
|
||||
$item = strstr($item, ':', true);
|
||||
|
||||
if(empty($Name)) {
|
||||
$_SESSION["errorCode"] = 'generalError';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../marks?item=$item'>");
|
||||
}
|
||||
else {
|
||||
$conn->query("UPDATE `VokabelBoxNoten` SET `Titel` = '$Name' WHERE `ID` = '$item'");
|
||||
$_SESSION["errorCode"] = 'editFolderSuccess';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../marks?item=$item:1'");
|
||||
}
|
||||
}
|
||||
|
||||
if($type == 'subject') {
|
||||
|
||||
$Name = strip_tags(htmlentities($_POST["Name"]));
|
||||
$Name = str_replace('\'', ''', $Name);
|
||||
$Name = str_replace('\\', '\', $Name);
|
||||
$Color = strip_tags(htmlentities($_POST["color"]));
|
||||
|
||||
if(empty($Name) || ($Color != 'FF5E5E' && $Color != 'FF9D5E' && $Color != 'FFBB5E' && $Color != 'FFDF5E' && $Color != 'FFFA5E' && $Color != 'EBFF5E' && $Color != 'CCFF5E' && $Color != 'A5FF5E' && $Color != '87FF5E' && $Color != '5EFF5E' && $Color != '5EFFB1' && $Color != '5EFFD6' && $Color != '5EE2FF' && $Color != '5EC7FF' && $Color != '5EA5FF' && $Color != '5E83FF' && $Color != '795EFF' && $Color != 'A55EFF' && $Color != 'D85EFF' && $Color != 'FF5EFA' && $Color != 'FF5ED6' && $Color != 'FF5EB8' && $Color != 'FF5E8F' && $Color != 'FF5E79')) {
|
||||
$_SESSION["errorCode"] = 'generalError';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../marks?item=$item'>");
|
||||
}
|
||||
else {
|
||||
$conn->query("UPDATE `VokabelBoxNoten` SET `Farbe` = '$Color', `Fach` = '$Name' WHERE `ID` = '$item'");
|
||||
$_SESSION["errorCode"] = 'editFolderSuccess';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../marks?item=$item'");
|
||||
}
|
||||
}
|
||||
|
||||
if($type == 'entry') {
|
||||
|
||||
$Name = strip_tags(htmlentities($_POST["Name"]));
|
||||
$Name = str_replace('\'', ''', $Name);
|
||||
$Name = str_replace('\\', '\', $Name);
|
||||
$Type = strip_tags(htmlentities($_POST["type"]));
|
||||
$Mark = strip_tags(htmlentities($_POST["mark"]));
|
||||
$Date = strip_tags(htmlentities($_POST["date"]));
|
||||
$Date = date("d.m.Y", strtotime($Date));
|
||||
|
||||
if(empty($Name) || empty($Type) || ($Type != '1' && $Type != '2' && $Type != '3' && $Type != '4') || empty($Mark) || ($Mark != '1' && $Mark != '1.3' && $Mark != '1.7' && $Mark != '2' && $Mark != '2.3' && $Mark != '2.7' && $Mark != '3' && $Mark != '3.3' && $Mark != '3.7' && $Mark != '4' && $Mark != '4.3' && $Mark != '4.7' && $Mark != '5' && $Mark != '5.3' && $Mark != '5.7' && $Mark != '6')) {
|
||||
$_SESSION["errorCode"] = 'generalError';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../marks?item=$item'>");
|
||||
}
|
||||
else {
|
||||
$conn->query("UPDATE `VokabelBoxNoten` SET `Titel` = '$Name',`Note` = '$Mark',`Bezeichnung` = '$Type',`Datum` = '$Date' WHERE `ID` = '$item'");
|
||||
$_SESSION["errorCode"] = 'editFolderSuccess';
|
||||
?>
|
||||
<meta http-equiv='refresh' content='0; URL=../marks?item=<?php print("$item"); ?>'>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
29
actions/logout.php
Normal file
29
actions/logout.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php session_start(); ?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="../files/style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
</main>
|
||||
<?php
|
||||
|
||||
include "../files/errorcodesscript.inc.php";
|
||||
|
||||
require "../files/ezine_db.inc.php";
|
||||
|
||||
include "../files/loginscript.inc.php";
|
||||
|
||||
if($LoggedIn == 'true') {
|
||||
|
||||
$_SESSION["Benutzername"] = '';
|
||||
$_SESSION["Passwort"] = '';
|
||||
|
||||
$_SESSION["errorCode"] = 'logoutSuccess';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../index'>");
|
||||
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
44
actions/save-accountsettings.php
Normal file
44
actions/save-accountsettings.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php session_start();
|
||||
|
||||
$_SESSION["redirect"] = 'save-accountsettings';
|
||||
|
||||
$Benutzername = $_SESSION["Benutzername"];
|
||||
$Passwort = $_SESSION["Passwort"];
|
||||
|
||||
$_SESSION["Benutzername"] = $Benutzername;
|
||||
$_SESSION["Passwort"] = $Passwort;
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="1; URL=myaccount">
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
|
||||
require "../files/ezine_db.inc.php";
|
||||
|
||||
include "../files/loginscript.inc.php";
|
||||
|
||||
include "../files/errorcodesscript.inc.php";
|
||||
|
||||
if($LoggedIn == 'true') {
|
||||
$GrossKlein = strip_tags(htmlentities($_POST["GrossKlein"]));
|
||||
$Zeit = strip_tags(htmlentities($_POST["Zeit"]));
|
||||
|
||||
if(empty($Zeit)) {
|
||||
$_SESSION["errorCode"] = 'generalError';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../myaccount'>");
|
||||
}
|
||||
else {
|
||||
$conn->query("UPDATE `VokabelBoxUsers` SET `GrossKlein`= '$GrossKlein',`Zeit`= '$Zeit' WHERE `Benutzername` = '$Benutzername'");
|
||||
$_SESSION["errorCode"] = 'saveAccountsettingsSuccess';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../myaccount'>");
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user