$classLoader = new ClassLoader("BroodjesProject", "src");
$classLoader->register();
session_start();
if (TijdService::checkTijd()) {
    /* Checkt of voor 10u is (tussen 6 en 10u) */
    header("Location: buitentijd.php");
    exit(0);
}
if (!isset($_SESSION["aangemeld"]) || $_SESSION["aangemeld"] == false) {
    /* Checkt of je aangemeld bent */
    header("Location: aanmelden.php");
    exit(0);
} else {
    if (isset($_GET["wijzig"])) {
        if ($_GET["wijzig"]) {
            $klant = CustomerService::haalKlantOp($_SESSION["klant"]);
            if (!empty($_POST["huidig"]) && !empty($_POST["nieuw1"]) && !empty($_POST["nieuw2"])) {
                if ($klant->getWachtwoord() == $_POST["huidig"]) {
                    if ($_POST["nieuw1"] == $_POST["nieuw2"] && $_POST["nieuw1"] != null) {
                        CustomerService::wijzigWachtwoord($_SESSION["klant"], $_POST["nieuw1"]);
                        $gelijk = true;
                        header("Location: bestellen.php");
                        exit(0);
                    }
                    $gelijk = false;
                    $leeg = false;
                    $wachtwoord = true;
                } else {
                    $wachtwoord = false;
                }
            } else {