Esempio n. 1
0
$classLoader = new ClassLoader("BroodjesProject", "src");
$classLoader->register();
session_start();
if (TijdService::checkTijd()) {
    header("Location: buitentijd.php");
    exit(0);
}
if ($_SESSION["aangemeld"]) {
    header("Location: bestellen.php");
    exit(0);
}
if (isset($_GET["action"])) {
    if ($_GET["action"] == "registreren") {
        if ($_POST["wachtwoord"] == $_POST["wachtwoordCheck"] && $_POST["voornaam"] != null && $_POST["achternaam"] != null && $_POST["email"] != null && $_POST["wachtwoord"] != null && $_POST["wachtwoordCheck"] != null) {
            /* Geen controle of klant bestaat! */
            CustomerService::VoegNieuweKlantToe($_POST["voornaam"], $_POST["achternaam"], $_POST["email"], $_POST["wachtwoord"]);
            header("Location: aanmelden.php");
            exit(0);
        } else {
            if ($_POST["voornaam"] == null || $_POST["achternaam"] == null || $_POST["email"] == null || $_POST["wachtwoord"] == null || $_POST["wachtwoordCheck"] == null) {
                header("Location: registreren.php?error=veldleeg");
                exit(0);
            }
            if ($_POST["wachtwoord"] != $_POST["wachtwoordCheck"]) {
                header("Location: registreren.php?error=wachtwoord");
                exit(0);
            }
        }
    }
}
if (isset($_GET["error"])) {