213 lines
10 KiB
PHP
213 lines
10 KiB
PHP
<?php
|
||
session_start();
|
||
require('anmeldesystem.php');
|
||
require('connect_db.php');
|
||
if(isset($_POST['Registrieren'])){
|
||
$vorname = $_POST["vorName"];
|
||
$nachname = $_POST['nachName'];
|
||
$strasse = $_POST['strasse'];
|
||
$hausnummer = $_POST['hausnummer'];
|
||
$plz = $_POST['postleitzahl'];
|
||
$ort = $_POST['ort'];
|
||
$emailrep = $_POST['emailRep'];
|
||
$email = $_POST['email'];
|
||
$passwort = $_POST['passwort'];
|
||
$passwortrep = $_POST['passwortRep'];
|
||
if(empty($vorname) || empty($nachname) || empty($strasse) ||
|
||
empty($hausnummer) || empty($plz) || empty($ort) ||
|
||
empty($emailrep) || empty($email) || empty($passwort) || empty($passwortrep))
|
||
{
|
||
header("Location: registrierung_wiederholen.html");
|
||
|
||
}elseif (!preg_match("/^[A-Za-zÄÖÜäöüß -]*$/", $vorname)
|
||
|| !preg_match("/.{2,}/", $vorname)
|
||
|| preg_match("/(?:([- ])\1{1,}|( -)|(- ))/", $vorname)
|
||
|| !preg_match("/^([A-ZÄÖÜa-zäöüß]{2,}[ -]?)+$/", $vorname)
|
||
|| !preg_match("/[a-zäöüß]$/", $vorname)
|
||
|| !preg_match("/^[A-ZÄÖÜ][a-zäöüß]+([- ][A-ZÄÖÜ][a-zäöüß]+)*$/", $vorname)
|
||
|| preg_match("/(\w)\1{2,}/", $vorname)) {
|
||
|
||
|
||
header("Location: registrierung_wiederholen.html");
|
||
|
||
}elseif (!preg_match("/^[A-Za-zÄÖÜäöüß -]*$/", $nachname)
|
||
|| !preg_match("/.{2,}/", $nachname)
|
||
|| preg_match("/([-])\1{1,}/", $nachname)
|
||
|| !preg_match("/^([A-ZÄÖÜa-zäöüß]{2,}[ -]?)+$/", $nachname)
|
||
|| !preg_match("/[a-zäöüß]$/", $nachname)
|
||
|| preg_match("/[A-ZÄÖÜ][a-zäöüß]+[ ]+[A-ZÄÖÜ][a-zäöüß]+/", $nachname)
|
||
|| !preg_match("/^(von( der)?|zu)[ ][A-ZÄÖÜ]|^[A-ZÄÖÜ]/", $nachname)
|
||
|| !preg_match("/(^(von( der)?|zu)[ ][A-ZÄÖÜ][a-zäöüß]+|^[A-ZÄÖÜ][a-zäöüß]+)([-][A-ZÄÖÜ][a-zäöüß]+)?$/", $nachname)
|
||
|| preg_match("/(\w)\1{2,}/", $nachname)) {
|
||
header("Location: registrierung_wiederholen.html");
|
||
|
||
}elseif ( !preg_match("/.{2,}/", $strasse)
|
||
|| !preg_match("/^[^0-9]*$|[0-9]$/", $strasse)
|
||
|| !preg_match("/^[A-Za-z0-9ÄÖÜäöüß' -]+$/", $strasse)
|
||
|| !preg_match("/^[A-ZÄÖÜ][ -]?[a-zäöü0-9ß']+([ -]?[A-ZÄÖÜ0-9][A-Za-z0-9ÄÖÜäöüß']+)*$/", $strasse)
|
||
|| !preg_match("/[0-9]$|[a-zäöüß]$/", $strasse)) {
|
||
|
||
header("Location: registrierung_wiederholen.html");
|
||
}elseif ( !preg_match("/^[0-9]/", $hausnummer)
|
||
|| preg_match("/^0/", $hausnummer)
|
||
|| !preg_match("/^[1-9][0-9]{0,3}[a-z]?$/", $hausnummer)){
|
||
header("Location: registrierung_wiederholen.html");
|
||
}elseif ( !preg_match("/^(0100[1-9]|010[1-9][0-9]|01[1-9][0-9]{2}|0[2-9][0-9]{3}|[1-9][0-9]{4})$/", $plz)){
|
||
header("Location: registrierung_wiederholen.html");
|
||
}elseif ( !preg_match("/.{2,}/", $ort)
|
||
|| preg_match("/[ \/-][ \/-]/", $ort)
|
||
|| !preg_match("/^[A-ZÄÖÜa-zäöüß \/-]+$/", $ort)
|
||
|| preg_match("/(\w)\1{2,}/", $ort)
|
||
|| !preg_match("/^[A-ZÄÖÜ]/", $ort)
|
||
|| !preg_match("/[a-zäöüß]$/", $ort)
|
||
|| !preg_match("/^[A-ZÄÖÜ][a-zäöüß]+([ -\/][A-ZÄÖÜa-zäöü][a-zäöüß]+)*$/", $ort)){
|
||
header("Location: registrierung_wiederholen.html");
|
||
}elseif ( !preg_match("/[A-Za-z0-9_!#$%&'*+-\/=?^_`.{|}~]+[@][A-Za-z0-9-]+[.][A-Za-z]{2,}/", $email)){
|
||
header("Location: registrierung_wiederholen.html");
|
||
}elseif($email != $emailrep){
|
||
header("Location: registrierung_wiederholen.html");
|
||
}elseif (!preg_match("/^(?=.*[A-ZÄÖÜ])(?=.*[a-zäöüß])(?=.*[0-9])(?=.*[!°`´@#$%^&*()_+\-=\[\]{};':\"\\|,.<>\/?]).{6,}$/", $passwort)
|
||
|| !preg_match("/.{6,}/", $passwort)){
|
||
header("Location: registrierung_wiederholen.html");
|
||
}elseif($passwort != $passwortrep){
|
||
header("Location: registrierung_wiederholen.html");
|
||
}else{
|
||
|
||
|
||
echo '<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<meta lang="de"/>
|
||
<meta charset="utf-8"/>
|
||
<meta name="viewport" content="device=device-width, initial-scaling=1"/>
|
||
<link rel="Stylesheet" type="text/css" href="style.css"/>
|
||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||
<title>Candle Bibliothek | Erfolgreich Registriert</title>
|
||
<link rel="icon" href="pictures/candle.png">
|
||
</head>
|
||
|
||
<body>
|
||
<header>
|
||
<h1 class="kopf" >
|
||
<br><br>
|
||
Bibliothek <a href="index.html" id="bildID"> <img id="CandleID" src="pictures/candle.png" alt="Bild von einer Kerze"
|
||
width="200" height="192"/> </a>
|
||
<br><br> Candle
|
||
</h1>
|
||
<div>
|
||
<a id="uberuns" href="uberuns.html">Über Uns</a>
|
||
<a id="buecher" href="buecher.html">Bücher</a>
|
||
<a id="meinebuecher" href="anmelden_meinebuecher.php">Meine Bücher</a>
|
||
<a id="abmelden" href="abmelden.php">Abmelden</a>
|
||
<form action="">
|
||
<input class="suchleiste" type="search" placeholder="Suche..." >
|
||
<button type="submit" id="buttonID" class="searchButton"><i class="fa fa-search"></i> </button>
|
||
</form>
|
||
<a id="erweitertesuche" href="erweitertesuche.html">Erweiterte Suche</a>
|
||
<a href="anmelden.php" id="warenKorbID"> <img id="shoppingCard" src="pictures/einkaufswagen.png" alt="Bild von einem Wagen"
|
||
width="50" height="50"/> </a>
|
||
</div>
|
||
</header>
|
||
|
||
<!--------------------------------------------------------------------->
|
||
|
||
<div class="mainContentContainer">
|
||
<div class="titleContainer">
|
||
<h1 id="registeredTitle">Erfolgreich registriert</h1>
|
||
</div>
|
||
<div class="mainContent">
|
||
<p id="textFirstHalf">
|
||
Sie wurden erfolgreich registriert.
|
||
<br><br>Ihre Karten-ID ist</p>
|
||
<!--TODO: Placeholder entfernen
|
||
und durch ID aus Datenbank ersetzen-->
|
||
<p id="cardID">XXXXXX.</p>
|
||
<br><br>
|
||
<p id="textLastHalf">
|
||
Mit dieser ID und Ihrem Passwort
|
||
können Sie sich direkt auf unserer Website anmelden und,
|
||
bei Bedarf, bereits Bücher für eine Ausleihe reservieren.
|
||
<br><br>Die Karten-ID findet sich auf Ihrem
|
||
Bibliotheksausweis wieder, welchen Sie bei Ihrem ersten
|
||
Besuch in unserer Bibliothek erhalten.
|
||
<br>Der Bibliotheksausweis kostet 10€ und muss jedes Jahr
|
||
vor Ort für den gleichen Preis verlängert werden.
|
||
<br>Bitte beachten Sie, dass ohne Vorlage eines
|
||
gültigen Ausweises, keine Bücher abgeholt werden können.
|
||
</p>
|
||
<br>
|
||
<!--TODO: Event für den Button befindet sich momentan
|
||
noch hier in der Datei. Soll die Funktion in eine
|
||
andere Datei verschoben werden, da sich eigentlich keine
|
||
EventListener in der HTML-Datei befinden sollen?-->
|
||
<input type="button" id="loginNowButton" value="Jetzt anmelden"
|
||
onclick="linkToLoginPage()">
|
||
|
||
<script>
|
||
function linkToLoginPage() {
|
||
window.location.replace("anmelden_meinebuecher.php");
|
||
}
|
||
</script>
|
||
|
||
<br><br><br>
|
||
</div>
|
||
</div>
|
||
|
||
<!--------------------------------------------------------------------->
|
||
|
||
<!--Link JS file-->
|
||
<script src="burgerIcon.js"></script>
|
||
<script>
|
||
var widthissue = false;
|
||
window.addEventListener("resize", function(event) {
|
||
if(window.innerWidth > 800 && widthissue) {
|
||
widthissue = false
|
||
unset()
|
||
}
|
||
else if(window.innerWidth < 800) widthissue = true;
|
||
})
|
||
|
||
</script>
|
||
|
||
<nav id="activeid" class="active">
|
||
<div class="navLinks">
|
||
<input class="nav-toggleclass"id="nav-toggle" type="checkbox" onclick="openNav()";>
|
||
<label for="nav-toggle" class="icon-burger" >
|
||
<div class="line"></div>
|
||
<div class="line"></div>
|
||
<div class="line"></div>
|
||
</label>
|
||
</div>
|
||
</nav>
|
||
|
||
|
||
<footer class="fuss" >
|
||
<div>
|
||
<a id="impressum" href="impressum.html">Impressum</a>
|
||
<a id="kontakt" href="kontakt.html">Kontakt</a>
|
||
<a id="datenschutz" href="datenschutz.html">Datenschutz</a>
|
||
|
||
</div>
|
||
</footer>
|
||
|
||
</body>
|
||
|
||
</html>';
|
||
|
||
$erg = register($vorname,
|
||
$nachname ,
|
||
$strasse,
|
||
$hausnummer,
|
||
$plz,
|
||
$ort,
|
||
$email,
|
||
$passwort,);
|
||
|
||
|
||
echo '<p> . $erg . </p>';
|
||
|
||
|
||
}
|
||
|
||
}
|
||
?>
|