session_start();
isset($_SESSION["message"]) ? $bodschap = $_SESSION["message"] : ($bodschap = "");
var_dump($_GET);
unset($_SESSION["message"]);
function relocate($url)
{
    header('location: ' . $url);
}
function __autoload($class)
{
    include 'class/' . $class . '.php';
}
try {
    $db = new PDO("mysql:host=localhost;dbname=blog", "anton", "paraplu");
    $artikel = new Artikel($db);
    $alleArtikels = $artikel->get();
    $bodschap = "artiekels gevonden";
} catch (PDOException $e) {
    $bodschap = 'Er ging iets mis: ' . $e->getMessage();
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<?php 
if ($bodschap) {
    echo $bodschap;
}
define('HOST', dirname(BASE_URL) . '/');
$message = false;
if (Message::hasMessage()) {
    $message = Message::getMessage();
    Message::remove();
}
$db = new PDO('mysql:host=localhost;dbname=oplossing_file_upload', 'root', '');
// Connectie maken
$databaseWrapper = new Database($db);
$user = new User($databaseWrapper);
if (!$user->validate()) {
    new Message("U moet eerst inloggen", "error");
    relocate("oplossing-file-upload-login-form.php");
}
$artikel = new Artikel($databaseWrapper);
$artikels = $artikel->get();
?>

<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Oplossing file upload</title>
        <style>
            html
            {
                font-family:sans-serif;
            }
    $message = Message::getMessage();
    Message::remove();
}
$db = new PDO('mysql:host=localhost;dbname=oplossing_file_upload', 'root', '');
// Connectie maken
$databaseWrapper = new Database($db);
$user = new User($databaseWrapper);
if (!$user->validate()) {
    new Message("U moet eerst inloggen", "error");
    relocate("oplossing-file-upload-login-form.php");
}
$artikel = false;
if (isset($_GET['edit'])) {
    $artikelInstance = new Artikel($databaseWrapper);
    $id = $_GET['edit'];
    $artikelRaw = $artikelInstance->get($id);
    if ($artikelRaw) {
        $artikel = $artikelRaw[0];
    }
}
?>

<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Oplossing file upload</title>
        <style>
            html
<?php

include 'include-config.php';
session_start();
function __autoload($class)
{
    include 'class/' . $class . '.php';
}
try {
    $db = new PDO("mysql:host=localhost;dbname=blog", "anton", "paraplu");
    $artikel = new Artikel($db);
    if (isset($_GET["artikel"])) {
        $alleArtikels = $artikel->get(false, $_GET["artikel"], false);
    }
    if (isset($_GET["date"])) {
        $alleArtikels = $artikel->get(false, false, $_GET["date"]);
    }
} catch (PDOException $e) {
    $bodschap = 'Er ging iets mis: ' . $e->getMessage();
}
//echo $bodschap."<br>";
//var_dump($alleArtikels);
?>

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>