예제 #1
0
<?php

session_start();
require_once 'models/database.php';
require_once 'models/vocable.php';
require_once 'models/lesson.php';
$db = new DatabaseConnector($_SESSION['user_id']);
$voc = $db->getNextVocable();
if (!$voc) {
    die("Keine Vokabeln für heute übrig. Zurück zur <a href='index.php' target='_top'>Startseite</>.");
}
$_SESSION['current_id'] = $voc->getId();
//Init the count variables from db if continuing with old query. Allows cross-device querys.
if (isset($_POST['continue'])) {
    $_SESSION['count'] = $db->getCount();
    $prev_results = $db->getResultCount();
    $_SESSION['right_c'] = $prev_results['right_c'];
    $_SESSION['wrong_c'] = $prev_results['wrong_c'];
    $_SESSION['mastered_c'] = $prev_results['mastered_c'];
    $_SESSION['direction'] = $_POST['direction'];
    $_SESSION['plan'] = $_POST['plan'];
}
?>
<!DOCTYPE html>
<html>
	<head>
		<?php 
include 'head_tag.html';
?>
		<title>Lernen</title>
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>