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

132 lines
5.9 KiB
PHP

<?php session_start();
$sitename = 'export';
$folderID = $_SESSION["folderID"];
?>
<!DOCTYPE html>
<html>
<head>
<title>Importieren | 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 &ouml;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>
<main>
<div class="middle">
<?php
require "files/ezine_db.inc.php";
include "files/loginscript.inc.php";
include "files/errorcodesscript.inc.php";
if($LoggedIn == 'true') {
$myfile = fopen("temporary/" . $folderID . ".csv", "w") or die("Fehler beim Erstellen der Datei!");
$sql = "SELECT `Ordner` FROM `VokabelBoxVokabeln` WHERE `Nutzername` = '$Benutzername' AND `ID` = '$folderID' AND `Sprache1` = ''";
$result_articles = $conn->query($sql);
while ($articleDb = mysqli_fetch_object($result_articles)) {
$file = $articleDb->Ordner . '
Sprache 1 (Muttersprache),Sprache 1 (Fremdsprache)
';
fwrite($myfile, $file);
}
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE `Nutzername` = '$Benutzername' AND `ID` = '$folderID' AND `Sprache1` != ''";
$result_articles = $conn->query($sql);
while ($articleDb = mysqli_fetch_object($result_articles)) {
$Sprache1 = html_entity_decode($articleDb->Sprache1);
$Sprache2 = html_entity_decode($articleDb->Sprache2);
htmlspecialchars_decode($Sprache1);
htmlspecialchars_decode($Sprache2);
$file = str_replace(",", "\",", "$Sprache1") . ',' . str_replace(",", "\",", "$Sprache2");
fwrite($myfile, $file);
fwrite($myfile, "\r\n");
}
?>
<?php
fclose($myfile);
?>
<p>Bitte beachte, dass du beim &Ouml;ffnen der CSV-Datei m&ouml;glicherweise die Codierung &auml;ndern musst. Bitte stelle sicher, dass Du als Trennung der Datens&auml;tze "Tabulator", bzw. "Zeilenumbruch" und als Trennung der Spalten "Komma" ausgew&auml;hlt hast.<br>Ob du alles richtig gemacht hast, merkst du sp&auml;testens dann, wenn die Tabelle v&ouml;llig durchschossen ist :)</p>
<p><br>Beispiel: OpenOffice Calc</p>
<img src="files/open-office-export-beispiel.png">
<form method="get" action="temporary/<?php print("$folderID"); ?>.csv">
<input type='hidden' name='foo' value='bar'/>
<input type='hidden' name='john' value='doe'/>
<button class='classic-button classic-button-grey'>
<i class='fas fa-download'> </i>
Herunterladen
</button>
</form>
<?php
}
?>
</div>
<a class="no-formatting impressum" href="https://www.timvandenboom.de/impressum">Impressum</a>
</main>
<a id='back-arrow' class='fas fa-arrow-left back no-formatting' href='index?folderID=<?php print("$folderID") ?>'></a>
</body>
</html>