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

199 lines
7.5 KiB
PHP

<?php session_start();
$sitename = 'result';
?>
<!DOCTYPE html>
<html>
<head>
<title>Mein Ergebnis | 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>
<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>
<br>
<div onclick="window.location.href='index?folderID=<?php print("$folderID"); ?>'" title="Aktuelle Lern-Session beenden und zur &Uuml;bersicht zur&uuml;ckkehren"><i class="fas fa-chevron-left"></i>Beenden</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') {
$folderID = $_SESSION["folderID"];
$_SESSION["folderID"] = $folderID;
$trainFirstTime = $_SESSION["trainFirstTime"];
if($trainFirstTime == '') {
$_SESSION["trainFirstTime"] = '1';
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Session` = '2')";
$result_articles = $conn->query($sql);
$true = mysqli_num_rows($result_articles);
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID') AND (`Session` = '3')";
$result_articles = $conn->query($sql);
$false = mysqli_num_rows($result_articles);
$total = $false + $true;
$_SESSION["action"] = '2';
$_SESSION["total"] = $false;
$true_p = ('100' * $true) / $total;
$false_p = ('100' * $false) / $total;
$true_p = number_format($true_p, 0);
$false_p = number_format($false_p, 0);
print(
"<p>Dein Ergebnis:<br><span class='green'>$true</span> | <span class='red'>$false</span>
<div class='full'>
<div class='true'></div>
<div class='false'></div>
</div><br>
<p class='percent'>$true_p&#37;</p><br><br>");
$_SESSION["total"] = $false;
if($false != '0') {
?>
<button onclick="window.location.href='learn'" class='classic-button classic-button-grey'>
<i class='fas fa-graduation-cap'> </i>
Trainieren
</button>
<?php
}
?>
<button onclick="window.location.href='index?folderID=<?php print("$folderID"); ?>'" class='classic-button classic-button-grey'>
<i class='fas fa-check'> </i>
Fertig
</button>
<?php
}
else {
$true = $_SESSION["true"];
$false = $_SESSION["false"];
$total = $false + $true;
$_SESSION["total"] = $total;
$conn->query("UPDATE `VokabelBoxVokabeln` SET `Session` = '3' WHERE (`Session` = '4') AND (`Nutzername` = '$Benutzername') AND (`ID` = '$folderID')");
$true_p = ('100' * $true) / $total;
$false_p = ('100' * $false) / $total;
$true_p = number_format($true_p, 0);
$false_p = number_format($false_p, 0);
print(
"<p>Dein Ergebnis:<br><span class='green'>$true</span> | <span class='red'>$false</span>
<div class='full'>
<div class='true'></div>
<div class='false'></div>
</div><br>
<p class='percent'>$true_p&#37;</p><br><br>");
$_SESSION["true"] = '0';
$_SESSION["false"] = '0';
$_SESSION["action"] = '2';
$_SESSION["total"] = $false;
if($false != '0') {
?>
<button onclick="window.location.href='learn'" class='classic-button classic-button-grey'>
<i class='fas fa-graduation-cap'> </i>
Trainieren
</button>
<?php
}
?>
<button onclick="window.location.href='index?folderID=<?php print("$folderID"); ?>'" class='classic-button classic-button-grey'>
<i class='fas fa-check'> </i>
Fertig
</button>
<?php
}
}
?>
</div>
</main>
<a class="no-formatting impressum" href="https://www.timvandenboom.de/impressum">Impressum</a>
</body>
</html>
<style>
.full {
width: 200px;
height: 50px;
position: relative;
margin: 10px auto;
border-radius: 15px;
overflow: hidden;
}
.true {
width: <?php print("$true_p"); ?>%;
height: 50px;
background-color: #A9F5A9;
position: absolute;
top: 0px;
left: 0px;
z-index: -1;
}
.false {
width: <?php print("$false_p"); ?>%;
height: 50px;
background-color: #F78181;
position: absolute;
top: 0px;
right: 0px;#
z-index: -1;
}
.percent {
background-color: #424242;
color: #fff;
border-radius: 10px;
padding: 10px;
display: inline;
font-size: 25px;
}
</style>