138 lines
3.5 KiB
PHP
138 lines
3.5 KiB
PHP
<?php
|
|
|
|
$id = '';
|
|
$string = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJLKMNOPQRSTUVW0123456789";
|
|
for ($i = 1; $i <= 64; $i++)
|
|
{
|
|
$zufallszahl = rand(0, 62);
|
|
$zufallszahl = substr($string, $zufallszahl, 1);
|
|
$id = $id . $zufallszahl;
|
|
}
|
|
|
|
$myfile = fopen("temporary/takeout-" . $id . ".html", "w") or die("Fehler beim Erstellen der Datei!");
|
|
|
|
$file = '<html><head></head><body><h1>Daten im Nutzerkonto:</h1><hr>';
|
|
fwrite($myfile, $file);
|
|
|
|
$sql = "SELECT
|
|
*
|
|
FROM
|
|
`VokabelBox2Users`
|
|
WHERE
|
|
`userid` = '$userid'";
|
|
$result_articles = mysql_query ($sql, $ezine_db);
|
|
while ($articleDb = mysql_fetch_object($result_articles))
|
|
{
|
|
$file = "<p>Benutzername: $articleDb->username</p>";
|
|
fwrite($myfile, $file);
|
|
$file = "<p>Registrierte E-Mail: $articleDb->email</p>";
|
|
fwrite($myfile, $file);
|
|
$file = "<p>Konto erstellt: $articleDb->create_date</p>";
|
|
fwrite($myfile, $file);
|
|
$file = "<p>Letzter Kontozugriff: $articleDb->lastedit</p>";
|
|
fwrite($myfile, $file);
|
|
$file = "<p>Sontige Einstellungen: $articleDb->settings</p>";
|
|
fwrite($myfile, $file);
|
|
|
|
}
|
|
|
|
$file = '<h1>Vokabellisten</h1><hr>';
|
|
fwrite($myfile, $file);
|
|
|
|
$sql = "SELECT
|
|
*
|
|
FROM
|
|
`VokabelBox2Content`
|
|
|
|
WHERE
|
|
`path` LIKE '$userid/%' AND `type` = 'lang'";
|
|
$result_articles1 = mysql_query ($sql, $ezine_db);
|
|
while ($articleDb1 = mysql_fetch_object($result_articles1))
|
|
{
|
|
|
|
$file = "<h2>Sprache:$articleDb1->value</h2>";
|
|
fwrite($myfile, $file);
|
|
|
|
$actual_lang = $articleDb1->id;
|
|
|
|
|
|
|
|
$sql2 = "SELECT
|
|
*
|
|
FROM
|
|
`VokabelBox2Content`
|
|
WHERE
|
|
`path` LIKE '$userid/$actual_lang/%' AND `type` = 'list'";
|
|
$result_articles2 = mysql_query ($sql2, $ezine_db);
|
|
while ($articleDb2 = mysql_fetch_object($result_articles2))
|
|
{
|
|
|
|
$file = "<h3>Liste:$articleDb2->value</h3>";
|
|
fwrite($myfile, $file);
|
|
|
|
|
|
|
|
$actual_list = $articleDb2->id;
|
|
|
|
|
|
|
|
$file = "<table width='100%'><tr style='font-weight:bold;'><td>Sprache 1</td><td>Sprache 2</td><td>Zul. geändert am/um</td><td>Erstellt am/um</td></tr>";
|
|
fwrite($myfile, $file);
|
|
|
|
|
|
|
|
$sql3 = "SELECT
|
|
*
|
|
FROM
|
|
`VokabelBox2Content`
|
|
WHERE
|
|
`path` = '$userid/lang/$actual_list/' AND `type` = 'voc'";
|
|
$result_articles3 = mysql_query ($sql3, $ezine_db);
|
|
while ($articleDb3 = mysql_fetch_object($result_articles3))
|
|
{
|
|
|
|
$file = "<tr>";
|
|
fwrite($myfile, $file);
|
|
|
|
|
|
$voc = json_decode($articleDb3->value, true);
|
|
|
|
$file = "<td>" . $voc[0]['1'] . "</td><td>" . $voc[0]['2'] . " </td><td> " . $articleDb3->lastedit . " </td><td> " . $articleDb3->create_timestamp . " </td></tr>";
|
|
fwrite($myfile, $file);
|
|
|
|
}
|
|
|
|
|
|
|
|
$file = "</table>";
|
|
fwrite($myfile, $file);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
$file = "</body></html>";
|
|
fwrite($myfile, $file);
|
|
|
|
|
|
fclose($myfile);
|
|
|
|
|
|
?>
|
|
|
|
<div class="fixed-title">
|
|
<h2>Datenauskunft</h2>
|
|
</div>
|
|
<div class="fixed-title-spacer" align="center">
|
|
<h4>Ihr Takeout ist fertig vorbereitet. Es wird als .html-Datei geöffnet und kann direkt in Ihrem Browser ausgewertet werden. Wenn Sie es speichern möchten, klicken Sie an einer beliebigen Stelle mit der rechten Maustaste und wählen Sie "Speichern unter...".</h4>
|
|
<div class="form">
|
|
<button class="default-button" download="takeout-<?php echo $id ?>.html" onclick="window.location.href='temporary/takeout-<?php echo $id ?>.html'">Öffnen (.html)</button>
|
|
</div>
|
|
</div>
|