Compare commits
32 Commits
main
...
frontendba
Author | SHA1 | Date | |
---|---|---|---|
60f72ec6c9 | |||
8a59ddde8e | |||
d24d914c8c | |||
d711bc6152 | |||
8e1a13ea27 | |||
6852923db0 | |||
71d838da0a | |||
8583012c5b | |||
31a381bba4 | |||
a72a0c5fc5 | |||
cbd7b0f8cc | |||
db1b26f017 | |||
ce23d839a3 | |||
![]() |
3be7e1ecfd | ||
36d6364cd0 | |||
d8865cbd27 | |||
![]() |
5477e7fdd8 | ||
![]() |
db526e5bb2 | ||
![]() |
dd6e98fe28 | ||
66ff531ba4 | |||
1964cadd8c | |||
![]() |
5965e1df81 | ||
![]() |
8d4376d313 | ||
![]() |
49a8f6a1dc | ||
![]() |
78e1e72eba | ||
![]() |
4fa775f326 | ||
6e3e3708b2 | |||
![]() |
0cff38b71f | ||
5bde268b89 | |||
5cef69ae81 | |||
f3699cb287 | |||
1f8e7dc67b |
193
.gitignore
vendored
Normal file
@ -0,0 +1,193 @@
|
||||
# Created by https://www.toptal.com/developers/gitignore/api/intellij,windows,macos,git
|
||||
# Edit at https://www.toptal.com/developers/gitignore?templates=intellij,windows,macos,git
|
||||
|
||||
### Git ###
|
||||
# Created by git for backups. To disable backups in Git:
|
||||
# $ git config --global mergetool.keepBackup false
|
||||
*.orig
|
||||
|
||||
# Created by git when using merge tools for conflicts
|
||||
*.BACKUP.*
|
||||
*.BASE.*
|
||||
*.LOCAL.*
|
||||
*.REMOTE.*
|
||||
*_BACKUP_*.txt
|
||||
*_BASE_*.txt
|
||||
*_LOCAL_*.txt
|
||||
*_REMOTE_*.txt
|
||||
|
||||
### Intellij ###
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
|
||||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||
|
||||
# User-specific stuff
|
||||
.idea/**/workspace.xml
|
||||
.idea/encodings.xml
|
||||
.idea/php.xml
|
||||
.idea/**/tasks.xml
|
||||
.idea/**/usage.statistics.xml
|
||||
.idea/**/dictionaries
|
||||
.idea/**/shelf
|
||||
|
||||
# AWS User-specific
|
||||
.idea/**/aws.xml
|
||||
|
||||
# Generated files
|
||||
.idea/**/contentModel.xml
|
||||
|
||||
# Sensitive or high-churn files
|
||||
.idea/**/dataSources/
|
||||
.idea/**/dataSources.ids
|
||||
.idea/**/dataSources.local.xml
|
||||
.idea/**/sqlDataSources.xml
|
||||
.idea/**/dynamic.xml
|
||||
.idea/**/uiDesigner.xml
|
||||
.idea/**/dbnavigator.xml
|
||||
|
||||
# Gradle
|
||||
.idea/**/gradle.xml
|
||||
.idea/**/libraries
|
||||
|
||||
# Gradle and Maven with auto-import
|
||||
# When using Gradle or Maven with auto-import, you should exclude module files,
|
||||
# since they will be recreated, and may cause churn. Uncomment if using
|
||||
# auto-import.
|
||||
# .idea/artifacts
|
||||
# .idea/compiler.xml
|
||||
# .idea/jarRepositories.xml
|
||||
# .idea/modules.xml
|
||||
# .idea/*.iml
|
||||
# .idea/modules
|
||||
# *.iml
|
||||
# *.ipr
|
||||
|
||||
# CMake
|
||||
cmake-build-*/
|
||||
|
||||
# Mongo Explorer plugin
|
||||
.idea/**/mongoSettings.xml
|
||||
|
||||
# File-based project format
|
||||
*.iws
|
||||
|
||||
# IntelliJ
|
||||
out/
|
||||
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Cursive Clojure plugin
|
||||
.idea/replstate.xml
|
||||
|
||||
# SonarLint plugin
|
||||
.idea/sonarlint/
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
fabric.properties
|
||||
|
||||
# Editor-based Rest Client
|
||||
.idea/httpRequests
|
||||
|
||||
# Android studio 3.1+ serialized cache file
|
||||
.idea/caches/build_file_checksums.ser
|
||||
|
||||
### Intellij Patch ###
|
||||
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
|
||||
|
||||
# *.iml
|
||||
# modules.xml
|
||||
# .idea/misc.xml
|
||||
# *.ipr
|
||||
|
||||
# Sonarlint plugin
|
||||
# https://plugins.jetbrains.com/plugin/7973-sonarlint
|
||||
.idea/**/sonarlint/
|
||||
|
||||
# SonarQube Plugin
|
||||
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
|
||||
.idea/**/sonarIssues.xml
|
||||
|
||||
# Markdown Navigator plugin
|
||||
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
|
||||
.idea/**/markdown-navigator.xml
|
||||
.idea/**/markdown-navigator-enh.xml
|
||||
.idea/**/markdown-navigator/
|
||||
|
||||
# Cache file creation bug
|
||||
# See https://youtrack.jetbrains.com/issue/JBR-2257
|
||||
.idea/$CACHE_FILE$
|
||||
|
||||
# CodeStream plugin
|
||||
# https://plugins.jetbrains.com/plugin/12206-codestream
|
||||
.idea/codestream.xml
|
||||
|
||||
# Azure Toolkit for IntelliJ plugin
|
||||
# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij
|
||||
.idea/**/azureSettings.xml
|
||||
|
||||
### macOS ###
|
||||
# General
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
.com.apple.timemachine.donotpresent
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
### macOS Patch ###
|
||||
# iCloud generated files
|
||||
*.icloud
|
||||
|
||||
### Windows ###
|
||||
# Windows thumbnail cache files
|
||||
Thumbs.db
|
||||
Thumbs.db:encryptable
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
|
||||
# Dump file
|
||||
*.stackdump
|
||||
|
||||
# Folder config file
|
||||
[Dd]esktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
# End of https://www.toptal.com/developers/gitignore/api/intellij,windows,macos,git
|
6
.idea/sqldialects.xml
generated
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="SqlDialectMappings">
|
||||
<file url="file://$PROJECT_DIR$/contact.sql" dialect="GenericSQL" />
|
||||
</component>
|
||||
</project>
|
390
CSS/style.css
@ -1,202 +1,242 @@
|
||||
*, *:before, *:after {
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #ffffff;
|
||||
color: #666;
|
||||
background-color: #DFF0F2;
|
||||
color: black;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 10px;
|
||||
color: #4d4d4d;
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
h1 span {
|
||||
color: orange;
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: orange;
|
||||
padding: 10px 0 0 10px;
|
||||
}
|
||||
|
||||
main {
|
||||
margin-top: 135px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#wrapper {
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
background-color: #4d4d4d;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.msg {
|
||||
text-align: center;
|
||||
font-size: 17px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.msg a {
|
||||
text-decoration: none;
|
||||
color: #09add0;
|
||||
|
||||
}
|
||||
|
||||
.msg a:hover {
|
||||
color: orange;
|
||||
}
|
||||
|
||||
nav ul {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
#wrapper {
|
||||
|
||||
}
|
||||
|
||||
nav li {
|
||||
float: left;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
|
||||
nav li a {
|
||||
display: block;
|
||||
width: 100px;
|
||||
height: 30px;
|
||||
border: 1px solid #4d4d4d;
|
||||
background-color: #4d4d4d;
|
||||
color: white;
|
||||
a {
|
||||
color: black;
|
||||
text-decoration: none;
|
||||
margin: 5px;
|
||||
text-align: center;
|
||||
line-height: 30px;
|
||||
}
|
||||
#navigation {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.link-container {
|
||||
display: grid;
|
||||
width: 80%;
|
||||
grid-template-columns: 20% 20% 56% 4%;
|
||||
background-color: #BAC8D4;
|
||||
border-bottom-right-radius: 10px;
|
||||
border-bottom-left-radius: 10px;
|
||||
}
|
||||
.links {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 25px;
|
||||
}
|
||||
#logo {
|
||||
height: 60px;
|
||||
width: 170px;
|
||||
background-image: url("../images/bibArts.png");
|
||||
background-position: center;
|
||||
background-size: contain;
|
||||
}
|
||||
#footer {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 240px;
|
||||
background-color: #BAC8D4;
|
||||
|
||||
display: grid;
|
||||
grid-template-columns: 6% 5% 43% 32% 14%;
|
||||
grid-template-rows: 45% 10% 45%;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
nav li a:hover {
|
||||
background-color: orange;
|
||||
.container-zahlungsmittel {
|
||||
grid-column: 5;
|
||||
justify-content: right;
|
||||
}
|
||||
.header-zahlungsarten {
|
||||
padding-right: 15px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
nav {
|
||||
position: fixed;
|
||||
background: white;
|
||||
top: 0px;
|
||||
width: 600px;
|
||||
text-align: center;
|
||||
padding-top: 10px;
|
||||
.inhalt {
|
||||
display: flex;
|
||||
height: 10px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#metanavi {
|
||||
.zahlungsmittel-img {
|
||||
height: 41px;
|
||||
width: 284px;
|
||||
background-image: url("../images/Zahlungsmittel.png");
|
||||
background-position: center;
|
||||
background-size: contain;
|
||||
justify-self: right;
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 97%;
|
||||
height: 1px;
|
||||
background-color: grey;
|
||||
justify-self: center;
|
||||
grid-column-start: 1;
|
||||
grid-column-end: 6;
|
||||
}
|
||||
|
||||
.container-rest {
|
||||
grid-column-start: 1;
|
||||
grid-column-end: 6;
|
||||
padding-left: 50px;
|
||||
}
|
||||
|
||||
.link-impressum {
|
||||
padding-left: 30px;
|
||||
|
||||
}
|
||||
.text-bib {
|
||||
grid-column: 5;
|
||||
justify-self: right;
|
||||
padding-right: 30px;
|
||||
}
|
||||
.container-welcome-inhalt {
|
||||
grid-template-columns: 39% 61%;
|
||||
display: grid;
|
||||
width: 110em;
|
||||
min-height: 80%;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.beispiel-austellung1-img {
|
||||
height: 480px;
|
||||
width: 670px;
|
||||
background-image: url("../images/beispiel-austellung1.png");
|
||||
background-position: center;
|
||||
background-size: contain;
|
||||
justify-self: right;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.beispiel-austellung2-img {
|
||||
background-image: url("../images/beispiel-austellung2.png");
|
||||
background-position: center;
|
||||
background-size: contain;
|
||||
justify-self: right;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
/* Login Page Styles */
|
||||
.login-page-bg {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: linear-gradient(135deg, #DFF0F2 60%, #BAC8D4 100%);
|
||||
}
|
||||
|
||||
.login-container {
|
||||
background: #fff;
|
||||
box-shadow: 0 4px 24px rgba(0,0,0,0.10);
|
||||
border-radius: 16px;
|
||||
padding: 40px 32px 32px 32px;
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.login-title {
|
||||
margin-bottom: 24px;
|
||||
color: #4d4d4d;
|
||||
font-weight: bold;
|
||||
margin-bottom: 5px;
|
||||
font-size: 2rem;
|
||||
font-weight: 600;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
#metanavi a {
|
||||
.login-form {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 18px;
|
||||
}
|
||||
|
||||
.login-field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.login-field label {
|
||||
font-weight: 500;
|
||||
color: #4d4d4d;
|
||||
}
|
||||
|
||||
.login-field input {
|
||||
padding: 10px 12px;
|
||||
border: 1px solid #BAC8D4;
|
||||
border-radius: 6px;
|
||||
font-size: 1rem;
|
||||
background: #F7FAFC;
|
||||
transition: border 0.2s;
|
||||
}
|
||||
|
||||
.login-field input:focus {
|
||||
border: 1.5px solid #09add0;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.login-btn {
|
||||
margin-top: 10px;
|
||||
padding: 12px 0;
|
||||
background: #09add0;
|
||||
border: none;
|
||||
width: 100px;
|
||||
margin: 0 5px 0 5px;
|
||||
float: right;
|
||||
padding: 2px;
|
||||
border-radius: 5px;
|
||||
color:#fff;
|
||||
cursor:pointer;
|
||||
font-size: 12px;
|
||||
text-decoration: none;
|
||||
color: #fff;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
font-size: 1.1rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
|
||||
.login-btn:hover {
|
||||
background: #007b9e;
|
||||
}
|
||||
|
||||
.login-error {
|
||||
background: #ffe0e0;
|
||||
color: #b30000;
|
||||
border: 1px solid #ffb3b3;
|
||||
border-radius: 6px;
|
||||
padding: 10px 16px;
|
||||
margin-bottom: 18px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#metanavi a:hover {
|
||||
background: orange;
|
||||
}
|
||||
|
||||
.articleImg {
|
||||
.login-success {
|
||||
background: #e0ffe6;
|
||||
color: #006633;
|
||||
border: 1px solid #b3ffd1;
|
||||
border-radius: 6px;
|
||||
padding: 10px 16px;
|
||||
margin-bottom: 18px;
|
||||
width: 100%;
|
||||
border: 2px solid lightskyblue;
|
||||
padding: 5px;
|
||||
margin: 0 0 15px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.welcomeImg {
|
||||
width: 100%;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.articleInfo {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/*** Formulare ***/
|
||||
|
||||
form {
|
||||
width: 440px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
label {
|
||||
width: 120px;
|
||||
.login-link {
|
||||
display: inline-block;
|
||||
margin: 5px 15px 10px 0;
|
||||
vertical-align: top;
|
||||
text-align: right;
|
||||
margin-top: 10px;
|
||||
color: #09add0;
|
||||
font-weight: 500;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
label.errorMsg {
|
||||
width: 420px;
|
||||
display: inline-block;
|
||||
margin: 0 5px 15px 0;
|
||||
vertical-align: top;
|
||||
text-align: right;
|
||||
color: orange;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
input[type="submit"] {
|
||||
width: 100px;
|
||||
margin-left: 330px;
|
||||
}
|
||||
|
||||
form textarea {
|
||||
width: 300px;
|
||||
height: 150px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
form select {
|
||||
width: 300px;
|
||||
}
|
||||
/*** Loesung Workshop-Seite ***/
|
||||
|
||||
.textContent {
|
||||
padding: 0 10px 0 30px;
|
||||
}
|
||||
|
||||
@media (max-width: 529px) {
|
||||
.textContent {
|
||||
padding: 15px 0 0 0;
|
||||
@media (max-width: 600px) {
|
||||
.login-container {
|
||||
padding: 24px 8px;
|
||||
max-width: 95vw;
|
||||
}
|
||||
}
|
||||
|
||||
.event h3 {
|
||||
margin: 15px 0 5px 0;
|
||||
font-size: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.orange {
|
||||
color: orange;
|
||||
display: block;
|
||||
font-size: 18px;
|
||||
margin: 0 0 5px 0;
|
||||
}
|
151
Controller/AuthController.php
Normal file
@ -0,0 +1,151 @@
|
||||
<?php
|
||||
|
||||
namespace Blog\Controller;
|
||||
|
||||
use Blog\Model\AuthModel;
|
||||
|
||||
class AuthController
|
||||
{
|
||||
private $model;
|
||||
private $view;
|
||||
|
||||
public function __construct($view) {
|
||||
$this->model = new AuthModel();
|
||||
$this->view = $view;
|
||||
}
|
||||
|
||||
public function showLoginForm() {
|
||||
$this->view->setVars([
|
||||
'labels' => [
|
||||
"email" => "E-Mail-Adresse",
|
||||
"password" => "Passwort",
|
||||
"password_repeat" => "Passwort wiederholen",
|
||||
"old_password" => "Altes Passwort"
|
||||
],
|
||||
'errors' => $_SESSION['auth_errors'] ?? [],
|
||||
'validData' => $_SESSION['auth_validData'] ?? []
|
||||
]);
|
||||
unset($_SESSION['auth_errors'], $_SESSION['auth_validData']);
|
||||
}
|
||||
|
||||
public function showRegistrationForm() {
|
||||
$this->view->setVars([
|
||||
'labels' => [
|
||||
"email" => "E-Mail-Adresse",
|
||||
"password" => "Passwort",
|
||||
"password_repeat" => "Passwort wiederholen",
|
||||
"old_password" => "Altes Passwort"
|
||||
],
|
||||
'errors' => $_SESSION['auth_errors'] ?? [],
|
||||
'validData' => $_SESSION['auth_validData'] ?? []
|
||||
]);
|
||||
unset($_SESSION['auth_errors'], $_SESSION['auth_validData']);
|
||||
}
|
||||
|
||||
public function login() {
|
||||
$email = $_POST['email'];
|
||||
$password = $_POST['password'];
|
||||
|
||||
$result = $this->model->login($email, $password);
|
||||
|
||||
if ($result === true) {
|
||||
$_SESSION['user'] = $email;
|
||||
header('Location: /bibarts/?controller=News&do=showNews');
|
||||
exit();
|
||||
} else {
|
||||
$this->view->setVars([
|
||||
'errors' => ['login' => is_string($result) ? $result : "Login fehlgeschlagen."],
|
||||
'validData' => ['email' => $email],
|
||||
'loginSuccess' => false
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function register() {
|
||||
$data = [
|
||||
'first_name' => $_POST['vorname'] ?? '',
|
||||
'last_name' => $_POST['nachname'] ?? '',
|
||||
'street' => $_POST['strasse'] ?? '',
|
||||
'house_number' => $_POST['hausnr'] ?? '',
|
||||
'postal_code' => $_POST['plz'] ?? '',
|
||||
'city' => $_POST['ort'] ?? '',
|
||||
'country' => $_POST['land'] ?? '',
|
||||
'phone' => $_POST['tel'] ?? '',
|
||||
'email' => $_POST['email'] ?? '',
|
||||
'password' => $_POST['password'] ?? '',
|
||||
'password_repeat' => $_POST['password_repeat'] ?? '',
|
||||
'is_admin' => $_POST['isAdmin'] ?? false,
|
||||
];
|
||||
|
||||
$result = $this->model->register($data);
|
||||
|
||||
if ($result === true) {
|
||||
$this->view->setVars(['success' => 'Registrierung erfolgreich!']);
|
||||
$this->view->render('Auth/showLoginForm');
|
||||
exit;
|
||||
} else {
|
||||
$errors['register'] = is_string($result) ? $result : "Registrierung fehlgeschlagen.";
|
||||
$this->view->setVars(['errors' => $errors, 'validData' => $data]);
|
||||
$this->view->render('Auth/showRegistrationForm');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
public function forgotPassword() {
|
||||
$email = $_POST['email'] ?? '';
|
||||
if (empty($email)) {
|
||||
$_SESSION['auth_errors']['email'] = "Bitte E-Mail-Adresse angeben.";
|
||||
header("Location: /?controller=Auth&do=showAuthForm");
|
||||
exit;
|
||||
}
|
||||
$this->model->pwForgot($email);
|
||||
header("Location: /?controller=Auth&do=showConfirmation&msg=pwforgot");
|
||||
exit;
|
||||
}
|
||||
|
||||
public function changePassword()
|
||||
{
|
||||
$email = $_POST['email'] ?? '';
|
||||
$oldpw = $_POST['old_password'] ?? '';
|
||||
$newpw = $_POST['password'] ?? '';
|
||||
$repeat = $_POST['password_repeat'] ?? '';
|
||||
|
||||
if (!$this->model->checkDoublePw($newpw, $repeat)) {
|
||||
$_SESSION['auth_errors']['password'] = "Neue Passwörter stimmen nicht überein.";
|
||||
header("Location: /?controller=Auth&do=showAuthForm");
|
||||
exit;
|
||||
}
|
||||
|
||||
$result = $this->model->updatePassword($email, $oldpw, $newpw);
|
||||
|
||||
if ($result === true) {
|
||||
header("Location: /?controller=Auth&do=showConfirmation&msg=pwchange");
|
||||
exit;
|
||||
} else {
|
||||
$_SESSION['auth_errors']['password'] = is_string($result) ? $result : "Fehler beim Aktualisieren des Passworts.";
|
||||
header("Location: /?controller=Auth&do=showAuthForm");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
public function showConfirmation()
|
||||
{
|
||||
$messages = [
|
||||
'login' => "Login erfolgreich.",
|
||||
'register' => "Registrierung erfolgreich.",
|
||||
'pwforgot' => "Ein temporäres Passwort wurde an Ihre E-Mail gesendet.",
|
||||
'pwchange' => "Passwort erfolgreich geändert."
|
||||
];
|
||||
$msgKey = $_GET['msg'] ?? '';
|
||||
$message = $messages[$msgKey] ?? "Aktion erfolgreich.";
|
||||
$this->view->setVars(['message' => $message]);
|
||||
$this->view->render('auth/confirmation');
|
||||
}
|
||||
|
||||
public function logout() {
|
||||
unset($_SESSION['user']);
|
||||
session_destroy();
|
||||
header('Location: /bibarts/?controller=Auth&do=showLoginForm');
|
||||
exit();
|
||||
}
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Blog\Controller;
|
||||
|
||||
use Blog\Model\ContactModel;
|
||||
|
||||
class ContactController
|
||||
{
|
||||
protected $view;
|
||||
private $db;
|
||||
private $validData = array();
|
||||
private $errors = array();
|
||||
private $labels = array("name" => "Name", "email" => "E-Mail-Adresse", "content" => "Nachricht");
|
||||
|
||||
|
||||
public function __construct($view)
|
||||
{
|
||||
$this->db = new ContactModel();
|
||||
$this->view = $view;
|
||||
}
|
||||
|
||||
public function showContactForm()
|
||||
{
|
||||
$this->view->setVars([
|
||||
'labels' => $this->labels,
|
||||
'validData' => $this->validData,
|
||||
'errors' => $this->errors
|
||||
]);
|
||||
}
|
||||
|
||||
public function showConfirmation()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function validateForm(){
|
||||
foreach ($this->labels as $index => $value) {
|
||||
if (!isset($_POST[$index]) || empty($_POST[$index])) {
|
||||
$this->errors[$index] = "Bitte " . $value . " angeben";
|
||||
} else {
|
||||
$this->validData[$index] = $_POST[$index];
|
||||
}
|
||||
}
|
||||
|
||||
if (count($this->errors) > 0) {
|
||||
$this->view->setDoMethodName("showContactForm");
|
||||
$this->showContactForm();
|
||||
} else {
|
||||
if ($this->db->writeContactData($this->validData)) {
|
||||
$this->view->setDoMethodName("showConfirmation");
|
||||
$this->showConfirmation();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
64
Controller/EventController.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace Blog\Controller;
|
||||
|
||||
use Blog\Model\EventModel;
|
||||
|
||||
class EventController {
|
||||
|
||||
private $model;
|
||||
private $view;
|
||||
|
||||
public function __construct($view) {
|
||||
$this->model = new EventModel();
|
||||
$this->view = $view;
|
||||
}
|
||||
|
||||
public function showEvents() {
|
||||
$events = $this->model->getEvents();
|
||||
$this->view->setVars([
|
||||
'events' => $events
|
||||
]);
|
||||
}
|
||||
|
||||
public function createEvent() {
|
||||
$data = [
|
||||
'location_id' => $_POST['location_id'] ?? null,
|
||||
'start_date' => $_POST['start_date'] ?? null,
|
||||
'end_date' => $_POST['end_date'] ?? null,
|
||||
'name' => $_POST['name'] ?? null,
|
||||
'description' => $_POST['description'] ?? null,
|
||||
'max_tickets' => $_POST['max_tickets'] ?? null,
|
||||
'ticket_price' => $_POST['ticket_price'] ?? null
|
||||
];
|
||||
|
||||
$this->model->createEvent($data);
|
||||
$this->view->setVars(['event' => $data]);
|
||||
exit;
|
||||
}
|
||||
|
||||
public function editEventForm() {
|
||||
$id = $_GET['event_id'];
|
||||
$event = $this->model->getEvent($id);
|
||||
$this->view->setVars(['event' => $event]);
|
||||
}
|
||||
|
||||
public function updateEvent($id, $data) {
|
||||
$id = $_POST['event_id'];
|
||||
$data = [
|
||||
'location_id' => $_POST['location_id'] ?? null,
|
||||
'start_date' => $_POST['start_date'] ?? null,
|
||||
'end_date' => $_POST['end_date'] ?? null,
|
||||
'name' => $_POST['name'] ?? null,
|
||||
'description' => $_POST['description'] ?? null,
|
||||
'max_tickets' => $_POST['max_tickets'] ?? null,
|
||||
'ticket_price' => $_POST['ticket_price'] ?? null
|
||||
];
|
||||
$this->model->updateEvent($id, $data);
|
||||
}
|
||||
|
||||
public function deleteEvent($id) {
|
||||
$this->model->deleteEvent($id);
|
||||
$this->view->setVars(['id' => $id]);
|
||||
}
|
||||
}
|
61
Controller/LocationController.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace Blog\Controller;
|
||||
|
||||
use Blog\Model\LocationModel;
|
||||
|
||||
class LocationController {
|
||||
|
||||
private $model;
|
||||
private $view;
|
||||
|
||||
public function __construct($view) {
|
||||
$this->model = new LocationModel();
|
||||
$this->view = $view;
|
||||
}
|
||||
|
||||
public function showLocations() {
|
||||
$locations = $this->model->getLocations();
|
||||
$this->view->setVars(['locations' => $locations]);
|
||||
}
|
||||
|
||||
public function createLocation() {
|
||||
$data = [
|
||||
'street' => $_POST['street'],
|
||||
'house_number' => $_POST['house_number'],
|
||||
'postal_code' => $_POST['postal_code'],
|
||||
'city' => $_POST['city'],
|
||||
'country' => $_POST['country'],
|
||||
'phone' => $_POST['phone'],
|
||||
'email' => $_POST['email']
|
||||
];
|
||||
$result = $this->model->createLocation($data);
|
||||
$this->view->setVars(['location' => $result]);
|
||||
}
|
||||
|
||||
public function editLocationForm() {
|
||||
$id = $_GET['location_id'];
|
||||
$location = $this->model->getLocation($id);
|
||||
$this->view->setVars(['location' => $location]);
|
||||
}
|
||||
|
||||
public function updateLocation() {
|
||||
$data = [
|
||||
'street' => $_POST['street'],
|
||||
'house_number' => $_POST['house_number'],
|
||||
'postal_code' => $_POST['postal_code'],
|
||||
'city' => $_POST['city'],
|
||||
'country' => $_POST['country'],
|
||||
'phone' => $_POST['phone'],
|
||||
'email' => $_POST['email']
|
||||
];
|
||||
$location_id = $_POST['location_id'];
|
||||
$result = $this->model->updateLocation($location_id, $data);
|
||||
$this->view->setVars(['location' => $result]);
|
||||
}
|
||||
|
||||
public function deleteLocation() {
|
||||
$id = $_GET['location_id'] ?? null;
|
||||
$this->model->deleteLocation($id);
|
||||
}
|
||||
}
|
53
Controller/NewsController.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace Blog\Controller;
|
||||
|
||||
use Blog\Model\NewsModel;
|
||||
|
||||
class NewsController {
|
||||
|
||||
private $model;
|
||||
private $view;
|
||||
|
||||
public function __construct($view) {
|
||||
$this->model = new NewsModel();
|
||||
$this->view = $view;
|
||||
}
|
||||
|
||||
public function showNews() {
|
||||
$news = $this->model->getNews();
|
||||
$this->view->setVars(['news' => $news]);
|
||||
}
|
||||
|
||||
public function createNews() {
|
||||
$data = [
|
||||
'name' => $_POST['name'],
|
||||
'beschreibung' => $_POST['beschreibung'],
|
||||
'datum' => $_POST['datum'],
|
||||
];
|
||||
$erg = $this->model->createNews($data);
|
||||
$this->view->setVars(['news' => $erg]);
|
||||
exit;
|
||||
}
|
||||
|
||||
public function editNewsForm() {
|
||||
$id = $_GET['newsid'];
|
||||
$news = $this->model->getNewsById($id);
|
||||
$this->view->setVars(['news' => $news]);
|
||||
}
|
||||
|
||||
public function updateNews() {
|
||||
$id = $_POST['newsid'] ?? null;
|
||||
$data = [
|
||||
'name' => $_POST['name'],
|
||||
'beschreibung' => $_POST['beschreibung'],
|
||||
'datum' => $_POST['datum'],
|
||||
];
|
||||
$this->model->updateNews($id, $data);
|
||||
}
|
||||
|
||||
public function deleteNews() {
|
||||
$id = $_GET['newsid'] ?? null;
|
||||
$this->model->deleteNews($id);
|
||||
}
|
||||
}
|
39
Controller/TicketController.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Blog\Controller;
|
||||
|
||||
use Blog\Model\TicketModel;
|
||||
|
||||
class TicketController {
|
||||
|
||||
private $ticketModel;
|
||||
private $view;
|
||||
|
||||
public function __construct($view) {
|
||||
$this->ticketModel = new TicketModel();
|
||||
$this->view = $view;
|
||||
}
|
||||
|
||||
public function showTickets() {
|
||||
$tickets = $this->ticketModel->getTickets();
|
||||
$this->view->setVars(['tickets' => $tickets]);
|
||||
}
|
||||
|
||||
public function buyTicket() {
|
||||
$data = [
|
||||
'user_id' => $_POST['user_id'] ?? null,
|
||||
'event_id' => $_POST['event_id'] ?? null,
|
||||
'price' => $_POST['price'] ?? null
|
||||
];
|
||||
|
||||
$result = $this->ticketModel->createTicket($data);
|
||||
$this->view->setVars(['ticket' => $result]);
|
||||
}
|
||||
|
||||
public function deleteTicket() {
|
||||
$ticketid = $_GET['ticketid'] ?? null;
|
||||
if ($ticketid) {
|
||||
$this->ticketModel->deleteTicket($ticketid);
|
||||
}
|
||||
}
|
||||
}
|
57
Controller/VoucherController.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace Blog\Controller;
|
||||
|
||||
use Blog\Model\VoucherModel;
|
||||
|
||||
class VoucherController {
|
||||
|
||||
private $model;
|
||||
private $view;
|
||||
|
||||
public function __construct($view) {
|
||||
$this->model = new VoucherModel();
|
||||
$this->view = $view;
|
||||
}
|
||||
|
||||
public function showVouchers() {
|
||||
$vouchers = $this->model->getVouchers();
|
||||
$this->view->setVars(['vouchers' => $vouchers]);
|
||||
}
|
||||
|
||||
public function createVoucher() {
|
||||
$data = [
|
||||
'code' => $_POST['code'] ?? null,
|
||||
'discount' => $_POST['discount'] ?? null,
|
||||
'event_id' => $_POST['event_id'] ?? null,
|
||||
'valid_until' => $_POST['valid_until'] ?? null
|
||||
];
|
||||
$result = $this->model->createVoucher($data);
|
||||
$this->view->setVars(['voucher' => $result]);
|
||||
exit;
|
||||
}
|
||||
|
||||
public function editVoucherForm() {
|
||||
$id = $_GET['voucher_id'];
|
||||
if ($id) {
|
||||
$voucher = $this->model->getVoucher($id);
|
||||
$this->view->setVars(['voucher' => $voucher]);
|
||||
}
|
||||
}
|
||||
|
||||
public function updateVoucher() {
|
||||
$id = $_POST['voucher_id'];
|
||||
$data = [
|
||||
'code' => $_POST['code'] ?? null,
|
||||
'discount' => $_POST['discount'] ?? null,
|
||||
'event_id' => $_POST['event_id'] ?? null,
|
||||
'valid_until' => $_POST['valid_until'] ?? null
|
||||
];
|
||||
$this->model->updateVoucher($id, $data);
|
||||
}
|
||||
|
||||
public function deleteVoucher() {
|
||||
$id = $_GET['voucher_id'] ?? null;
|
||||
$this->model->deleteVoucher($id);
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Blog\Controller;
|
||||
|
||||
class WelcomeController
|
||||
{
|
||||
function showWelcome() {
|
||||
|
||||
}
|
||||
|
||||
function showProjects() {
|
||||
|
||||
}
|
||||
|
||||
function showTutorials() {
|
||||
|
||||
}
|
||||
}
|
239
Model/AuthModel.php
Normal file
@ -0,0 +1,239 @@
|
||||
<?php
|
||||
|
||||
namespace Blog\Model;
|
||||
|
||||
use DateTime;
|
||||
use PDO;
|
||||
use PDOException;
|
||||
|
||||
class AuthModel extends Database
|
||||
{
|
||||
public function login(string $email, string $password)
|
||||
{
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "SELECT email, password, valid_until FROM user WHERE email = :email";
|
||||
$params = [":email" => $email];
|
||||
|
||||
try {
|
||||
$sth = $pdo->prepare($sql);
|
||||
$sth->execute($params);
|
||||
$user = $sth->fetch(PDO::FETCH_ASSOC);
|
||||
} catch (PDOException $e) {
|
||||
new \Blog\Library\ErrorMsg("Fehler beim Abrufen der Benutzerdaten.", $e);
|
||||
return "Interner Datenbankfehler."; // Nur für Debug sichtbar machen, sonst besser allgemein halten
|
||||
}
|
||||
|
||||
if (!$user) {
|
||||
return "Benutzer mit dieser E-Mail wurde nicht gefunden.";
|
||||
}
|
||||
|
||||
if (!password_verify($password, $user['password'])) {
|
||||
return "Das eingegebene Passwort ist falsch.";
|
||||
}
|
||||
|
||||
try {
|
||||
$now = new DateTime();
|
||||
$validUntil = new DateTime($user['valid_until']);
|
||||
|
||||
if ($now > $validUntil) {
|
||||
return "Ihr Passwort ist abgelaufen. Bitte setzen Sie ein neues über \"Passwort vergessen\".";
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
new \Blog\Library\ErrorMsg("Fehler beim Verarbeiten des Gültigkeitsdatums.", $e);
|
||||
return "Fehler bei der Passwortprüfung.";
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function register($data) {
|
||||
if (!filter_var($data['email'], FILTER_VALIDATE_EMAIL)) {
|
||||
return "Bitte geben Sie eine gültige E-Mail ein.";
|
||||
}
|
||||
|
||||
$requiredFields = [
|
||||
'email', 'password', 'street', 'house_number', 'city', 'postal_code',
|
||||
'country', 'first_name', 'last_name', 'phone'
|
||||
];
|
||||
|
||||
foreach ($requiredFields as $field) {
|
||||
if (empty($data[$field])) {
|
||||
return "Bitte füllen Sie alle Felder aus.";
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->userExistsByEmail($data['email'])) {
|
||||
return "Ein Account mit dieser E-Mail existiert bereits.";
|
||||
}
|
||||
|
||||
// Passwort-Validierung
|
||||
if (!$this->checkDoublePw($data['password'], $data['password_repeat'])) {
|
||||
return "Passwörter stimmen nicht überein.";
|
||||
}
|
||||
|
||||
if ($this->pwRequirementCheck($data['password']) !== true) {
|
||||
return "Passwort muss mindestens 8 Zeichen lang sein und mindestens ein Großbuchstabe, ein Kleinbuchstabe, eine Zahl und ein Sonderzeichen enthalten.";
|
||||
}
|
||||
|
||||
$hashedPassword = password_hash($data['password'], PASSWORD_DEFAULT);
|
||||
|
||||
$sql = "INSERT INTO user (email, password, street, house_number, city, postal_code, country, first_name, last_name, phone, is_admin)
|
||||
VALUES (:email, :password, :street, :house_number, :city, :postal_code, :country, :first_name, :last_name, :phone, :is_admin)";
|
||||
|
||||
$params = [
|
||||
':email' => $data['email'],
|
||||
':password' => $hashedPassword,
|
||||
':street' => $data['street'],
|
||||
':house_number' => $data['house_number'],
|
||||
':city' => $data['city'],
|
||||
':postal_code'=> $data['postal_code'],
|
||||
':country'=> $data['country'],
|
||||
':first_name' => $data['first_name'],
|
||||
':last_name'=> $data['last_name'],
|
||||
':phone' => $data['phone'],
|
||||
':is_admin' => $data['is_admin'] ? 1 : 0,
|
||||
];
|
||||
|
||||
try {
|
||||
$pdo = $this->linkDB();
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute($params);
|
||||
return true;
|
||||
} catch (PDOException $e) {
|
||||
new \Blog\Library\ErrorMsg("Fehler beim Schreiben der Daten.", $e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private function userExistsByEmail($email) {
|
||||
try {
|
||||
$pdo = $this->linkDB();
|
||||
|
||||
$sql = "SELECT user_id FROM user WHERE email = :email";
|
||||
$params = [':email' => $email];
|
||||
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute($params);
|
||||
|
||||
return (bool) $stmt->fetch();
|
||||
} catch (\PDOException $e) {
|
||||
new \Blog\Library\ErrorMsg("Fehler bei der E-Mail-Prüfung", $e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function pwForgot($email){
|
||||
$randomPw = bin2hex(random_bytes(12 / 2));
|
||||
$hashedPassword = password_hash($randomPw, PASSWORD_DEFAULT);
|
||||
|
||||
$this->forgottenPwUpdate($email, $hashedPassword);
|
||||
|
||||
$betreff = "Passwort zurücksetzen bei bibArts";
|
||||
$nachricht = "Hallo,\n\nhier ihr temporäres Passwort:\n\n $randomPw \n\n Bitte beachten Sie, dass das Passwort nur 2 stunden Gülltig ist. \nViele Grüße,\nbibArts Team";
|
||||
|
||||
$header = "From: noreply@edu.bib.de\r\n";
|
||||
$header .= "Content-Type: text/plain; charset=UTF-8\r\n";
|
||||
|
||||
$maxTries = 5;
|
||||
$try = 0;
|
||||
$success = false;
|
||||
|
||||
while ($try < $maxTries && !$success) {
|
||||
$erfolg = mail($email, $betreff, $nachricht, $header);
|
||||
$try++;
|
||||
if (!$erfolg) {
|
||||
error_log("Mailversuch $try an $email fehlgeschlagen.");
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function forgottenPwUpdate($email, $hashedPassword) {
|
||||
try{
|
||||
$pdo = $this->linkDB();
|
||||
|
||||
$sqlCheck = "SELECT COUNT(*) FROM user WHERE email = :email";
|
||||
$stmt = $pdo->prepare($sqlCheck);
|
||||
$stmt->execute([':email' => $email]);
|
||||
if ($stmt->fetchColumn() == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$validUntil = (new DateTime())->add(new DateInterval('PT2H'))->format('Y-m-d H:i:s');
|
||||
|
||||
|
||||
$sql = "UPDATE user
|
||||
SET password = :password, valid_until = :valid_until
|
||||
WHERE email = :email";
|
||||
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$params = [
|
||||
':email' => $email,
|
||||
':password' => $hashedPassword,
|
||||
':valid_until' => $validUntil
|
||||
];
|
||||
return $stmt->execute($params);
|
||||
} catch (PDOException $e) {
|
||||
new \Blog\Library\ErrorMsg("Fehler beim Aktualisieren der Daten.", $e);
|
||||
die;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function updatePassword($email, $oldpw, $newpw){
|
||||
if(!$this->login($email, $oldpw)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$requiredFields = [$email, $oldpw, $newpw];
|
||||
foreach ($requiredFields as $field) {
|
||||
if (empty($field)) {
|
||||
return "Bitte füllen Sie alle Felder aus";
|
||||
}
|
||||
}
|
||||
$hashedPassword = password_hash($newpw, PASSWORD_DEFAULT);
|
||||
|
||||
$sql = "UPDATE user SET password = :password WHERE email = :email";
|
||||
|
||||
try{
|
||||
$pdo = $this->linkDB();
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$params = [
|
||||
':email' => $email,
|
||||
':password' => $hashedPassword,
|
||||
];
|
||||
return $stmt->execute($params);
|
||||
} catch (PDOException $e) {
|
||||
new \Blog\Library\ErrorMsg("Fehler beim Schreiben der Daten.", $e);
|
||||
die;
|
||||
}
|
||||
}
|
||||
|
||||
public function checkDoublePw($password1, $password2){
|
||||
if($password1 === $password2){
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
public function pwRequirementCheck($password){
|
||||
$error = [];
|
||||
|
||||
if(strlen($password) <= 8)
|
||||
$error[] = "min 8 Charackter";
|
||||
if(!preg_match("/[A-Z]/", $password))
|
||||
$error[] = "min one large Character";
|
||||
if(!preg_match("/[a-z]/", $password))
|
||||
$error[] = "min one small charakter";
|
||||
if(!preg_match("/[0-9]/", $password))
|
||||
$error[] = "min one number";
|
||||
if(!preg_match("[^a-zA-Z0-9\s]", $password));
|
||||
$error[] = "min one special character";
|
||||
|
||||
if(empty($error))
|
||||
return true;
|
||||
else
|
||||
return $error;
|
||||
}
|
||||
}
|
103
Model/EventModel.php
Normal file
@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace Blog\Model;
|
||||
|
||||
use PDOException;
|
||||
|
||||
class EventModel extends Database {
|
||||
|
||||
public function getEvents() {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "SELECT * FROM event ORDER BY start_date ASC;";
|
||||
try {
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute();
|
||||
return $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
} catch (PDOException $e) {
|
||||
new \Blog\Library\ErrorMsg("Fehler beim Lesen der Events.", $e);
|
||||
die;
|
||||
}
|
||||
}
|
||||
|
||||
public function getEvent($id) {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "SELECT * FROM event WHERE event_id = :event_id;";
|
||||
$params = [":event_id" => $id];
|
||||
try {
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute($params);
|
||||
return $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||
} catch (PDOException $e) {
|
||||
new \Blog\Library\ErrorMsg("Fehler beim Lesen des Events.", $e);
|
||||
die;
|
||||
}
|
||||
}
|
||||
|
||||
public function updateEvent($id, $data) {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "UPDATE event SET
|
||||
name = :name,
|
||||
description = :description,
|
||||
location_id = :location_id,
|
||||
start_date = :start_date,
|
||||
end_date = :end_date,
|
||||
max_tickets = :max_tickets,
|
||||
ticket_price = :ticket_price
|
||||
WHERE event_id = :event_id;";
|
||||
$params = [
|
||||
":name" => $data['name'],
|
||||
":description" => $data['description'],
|
||||
":location_id" => $data['location_id'],
|
||||
":start_date" => $data['start_date'],
|
||||
":end_date" => $data['end_date'],
|
||||
":max_tickets" => $data['max_tickets'],
|
||||
":ticket_price" => $data['ticket_price'],
|
||||
":event_id" => $id
|
||||
];
|
||||
try {
|
||||
$sth = $pdo->prepare($sql);
|
||||
$sth->execute($params);
|
||||
return $sth;
|
||||
} catch (PDOException $e) {
|
||||
new \Blog\Library\ErrorMsg("Fehler beim Aktualisieren des Events.", $e);
|
||||
die;
|
||||
}
|
||||
}
|
||||
|
||||
public function createEvent($data) {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "INSERT INTO event (name, description, location_id, start_date, end_date, max_tickets, ticket_price)
|
||||
VALUES (:name, :description, :location_id, :start_date, :end_date, :max_tickets, :ticket_price);";
|
||||
$params = [
|
||||
":name" => $data['name'],
|
||||
":description" => $data['description'],
|
||||
":location_id" => $data['location_id'],
|
||||
":start_date" => $data['start_date'],
|
||||
":end_date" => $data['end_date'],
|
||||
":max_tickets" => $data['max_tickets'],
|
||||
":ticket_price" => $data['ticket_price']
|
||||
];
|
||||
try {
|
||||
$sth = $pdo->prepare($sql);
|
||||
$sth->execute($params);
|
||||
return $sth;
|
||||
} catch (PDOException $e) {
|
||||
new \Blog\Library\ErrorMsg("Fehler beim Schreiben des Events.", $e);
|
||||
die;
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteEvent($id) {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "DELETE FROM event WHERE event_id = :event_id;";
|
||||
$params = [":event_id" => $id];
|
||||
try {
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute($params);
|
||||
return $stmt->rowCount();
|
||||
} catch (PDOException $e) {
|
||||
new \Blog\Library\ErrorMsg("Fehler beim Löschen des Events.", $e);
|
||||
die;
|
||||
}
|
||||
}
|
||||
}
|
104
Model/LocationModel.php
Normal file
@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
namespace Blog\Model;
|
||||
|
||||
use PDO;
|
||||
use PDOException;
|
||||
|
||||
class LocationModel extends Database {
|
||||
|
||||
public function getLocations() {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "SELECT * FROM location ORDER BY location_id ASC;";
|
||||
try {
|
||||
$sth = $pdo->prepare($sql);
|
||||
$sth->execute();
|
||||
return $sth->fetchAll(\PDO::FETCH_ASSOC);
|
||||
} catch (PDOException $e) {
|
||||
new \Blog\Library\ErrorMsg("Fehler beim Lesen der Standorte.", $e);
|
||||
die;
|
||||
}
|
||||
}
|
||||
|
||||
public function getLocation($id) {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "SELECT * FROM location WHERE location_id = :location_id;";
|
||||
$params = [":location_id" => $id];
|
||||
try {
|
||||
$sth = $pdo->prepare($sql);
|
||||
$sth->execute($params);
|
||||
return $sth->fetch(\PDO::FETCH_ASSOC);
|
||||
} catch (PDOException $e) {
|
||||
new \Blog\Library\ErrorMsg("Fehler beim Lesen des Standorts.", $e);
|
||||
die;
|
||||
}
|
||||
}
|
||||
|
||||
public function createLocation($data) {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "INSERT INTO location (street, house_number, postal_code, city, country, phone, email)
|
||||
VALUES (:street, :house_number, :postal_code, :city, :country, :phone, :email);";
|
||||
$params = [
|
||||
":street" => $data['street'],
|
||||
":house_number" => $data['house_number'],
|
||||
":postal_code" => $data['postal_code'],
|
||||
":city" => $data['city'],
|
||||
":country" => $data['country'],
|
||||
":phone" => $data['phone'],
|
||||
":email" => $data['email']
|
||||
];
|
||||
try {
|
||||
$sth = $pdo->prepare($sql);
|
||||
$sth->execute($params);
|
||||
return $pdo->lastInsertId();
|
||||
} catch (PDOException $e) {
|
||||
new \Blog\Library\ErrorMsg("Fehler beim Anlegen des Standorts.", $e);
|
||||
die;
|
||||
}
|
||||
}
|
||||
|
||||
public function updateLocation($id, $data) {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "UPDATE location SET
|
||||
street = :street,
|
||||
house_number = :house_number,
|
||||
postal_code = :postal_code,
|
||||
city = :city,
|
||||
country = :country,
|
||||
phone = :phone,
|
||||
email = :email
|
||||
WHERE location_id = :location_id;";
|
||||
$params = [
|
||||
":street" => $data['street'],
|
||||
":house_number" => $data['house_number'],
|
||||
":postal_code" => $data['postal_code'],
|
||||
":city" => $data['city'],
|
||||
":country" => $data['country'],
|
||||
":phone" => $data['phone'],
|
||||
":email" => $data['email'],
|
||||
":location_id" => $id
|
||||
];
|
||||
try {
|
||||
$sth = $pdo->prepare($sql);
|
||||
$sth->execute($params);
|
||||
return $sth->rowCount();
|
||||
} catch (PDOException $e) {
|
||||
new \Blog\Library\ErrorMsg("Fehler beim Aktualisieren des Standorts.", $e);
|
||||
die;
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteLocation($id) {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "DELETE FROM location WHERE location_id = :location_id;";
|
||||
$params = [":location_id" => $id];
|
||||
try {
|
||||
$sth = $pdo->prepare($sql);
|
||||
$sth->execute($params);
|
||||
return $sth->rowCount();
|
||||
} catch (PDOException $e) {
|
||||
new \Blog\Library\ErrorMsg("Fehler beim Löschen des Standorts.", $e);
|
||||
die;
|
||||
}
|
||||
}
|
||||
}
|
60
Model/NewsModel.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace Blog\Model;
|
||||
|
||||
use PDOException;
|
||||
use PDO;
|
||||
|
||||
class NewsModel extends Database {
|
||||
|
||||
public function getNewsById($id) {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "SELECT * FROM news WHERE news_id = :news_id;";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$params = [':news_id' => $id];
|
||||
$stmt->execute($params);
|
||||
return $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
public function updateNews($id, $data) {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "UPDATE news SET name = :name, description = :description, date = :date WHERE news_id = :news_id;";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$params = [
|
||||
':name' => $data['name'],
|
||||
':description' => $data['description'],
|
||||
':date' => $data['date'],
|
||||
':news_id' => $id
|
||||
];
|
||||
return $stmt->execute($params);
|
||||
}
|
||||
|
||||
public function getNews() {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "SELECT * FROM news ORDER BY date DESC;";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute();
|
||||
return $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
public function createNews($data) {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "INSERT INTO news (name, description, date) VALUES (:name, :description, :date);";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$params = [
|
||||
':name' => $data['name'],
|
||||
':description' => $data['description'],
|
||||
':date' => $data['date']
|
||||
];
|
||||
$stmt->execute($params);
|
||||
return $pdo->lastInsertId();
|
||||
}
|
||||
|
||||
public function deleteNews($id) {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "DELETE FROM news WHERE news_id = :news_id;";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$params = [':news_id' => $id];
|
||||
return $stmt->execute($params);
|
||||
}
|
||||
}
|
74
Model/TicketModel.php
Normal file
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace Blog\Model;
|
||||
|
||||
use PDOException;
|
||||
use PDO;
|
||||
|
||||
class TicketModel extends Database {
|
||||
|
||||
public function getTickets() {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "SELECT * FROM ticket ORDER BY ticket_id ASC;";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute();
|
||||
return $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
public function buyTicket($data) {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "INSERT INTO ticket (user_id, event_id, purchase_date, valid_until)
|
||||
VALUES (:user_id, :event_id, :purchase_date, :valid_until)";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$params = [
|
||||
':user_id' => $data['user_id'],
|
||||
':event_id' => $data['event_id'],
|
||||
':purchase_date' => $data['purchase_date'],
|
||||
':valid_until' => $data['valid_until']
|
||||
];
|
||||
$stmt->execute($params);
|
||||
return $pdo->lastInsertId();
|
||||
}
|
||||
|
||||
public function checkTicketExists($userid, $ausstellungid) {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "SELECT COUNT(*) as count FROM ticket WHERE user_id = :user_id AND event_id = :event_id;";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$params = [':user_id' => $userid, ':event_id' => $ausstellungid];
|
||||
$stmt->execute($params);
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
return $result['count'] > 0;
|
||||
}
|
||||
|
||||
public function deleteTicket($id) {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "DELETE FROM ticket WHERE ticket_id = :ticket_id;";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$params = [':ticket_id' => $id];
|
||||
return $stmt->execute($params);
|
||||
}
|
||||
|
||||
public function createTicket($data) {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "INSERT INTO ticket (event_id, user_id, price) VALUES (:event_id, :user_id, :price);";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$params = [
|
||||
':event_id' => $data['event_id'],
|
||||
':user_id' => $data['user_id'],
|
||||
':price' => $data['price']
|
||||
];
|
||||
return $stmt->execute($params);
|
||||
}
|
||||
|
||||
public function getTicketsByUser($userId) {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "SELECT t.*, e.name as event_name, e.start_date, e.end_date
|
||||
FROM ticket t
|
||||
JOIN event e ON t.event_id = e.event_id
|
||||
WHERE t.user_id = :user_id;";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$params = [':user_id' => $userId];
|
||||
$stmt->execute($params);
|
||||
return $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
}
|
62
Model/VoucherModel.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace Blog\Model;
|
||||
|
||||
use PDO;
|
||||
use PDOException;
|
||||
|
||||
class VoucherModel extends Database {
|
||||
|
||||
public function getVouchers() {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "SELECT * FROM voucher ORDER BY valid_until DESC;";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute();
|
||||
return $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
public function getVoucher($id) {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "SELECT * FROM voucher WHERE voucher_id = :id;";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$params = [':id' => $id];
|
||||
$stmt->execute($params);
|
||||
return $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
public function createVoucher($data) {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "INSERT INTO voucher (code, discount, event_id, valid_until) VALUES (:code, :discount, :event_id, :valid_until);";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$params = [
|
||||
':code' => $data['code'],
|
||||
':discount' => $data['discount'],
|
||||
':event_id' => $data['event_id'],
|
||||
':valid_until' => $data['valid_until']
|
||||
];
|
||||
$stmt->execute($params);
|
||||
return $pdo->lastInsertId();
|
||||
}
|
||||
|
||||
public function updateVoucher($id, $data) {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "UPDATE voucher SET code = :code, discount = :discount, event_id = :event_id, valid_until = :valid_until WHERE voucher_id = :id;";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$params = [
|
||||
':code' => $data['code'],
|
||||
':discount' => $data['discount'],
|
||||
':event_id' => $data['event_id'],
|
||||
':valid_until' => $data['valid_until'],
|
||||
':id' => $id
|
||||
];
|
||||
return $stmt->execute($params);
|
||||
}
|
||||
|
||||
public function deleteVoucher($id) {
|
||||
$pdo = $this->linkDB();
|
||||
$sql = "DELETE FROM voucher WHERE voucher_id = :id;";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$params = [':id' => $id];
|
||||
return $stmt->execute($params);
|
||||
}
|
||||
}
|
28
Views/Auth/showLoginForm.phtml
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
include dirname(__DIR__) . '/header.phtml';
|
||||
?>
|
||||
|
||||
<div class="inhalt">
|
||||
<div class="login-container">
|
||||
<h1>Anmelden</h1>
|
||||
<form class="form-horizontal" action="index.php" method="post">
|
||||
<input type="hidden" name="controller" value="Auth">
|
||||
<input type="hidden" name="do" value="login">
|
||||
<label for="email">E-Mail</label>
|
||||
<input class="input-email" type="email" name="email" id="email" placeholder="E-Mail" required>
|
||||
<label for="password">Passwort</label>
|
||||
<input class="input-passwort" type="password" name="password" id="password" placeholder="Passwort" required>
|
||||
<button class="button-loggin" type="submit">Login</button>
|
||||
</form>
|
||||
<div style="text-align:center; margin-top: 1.5em;">
|
||||
<a class="link-passwort-vergessen">Passwort vergessen?</a>
|
||||
<br>
|
||||
<a class="link-konto-erstellen" href="?controller=Auth&do=showRegistrationForm">Konto erstellen</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include dirname(__DIR__) . '/footer.phtml';
|
||||
?>
|
||||
|
55
Views/Auth/showRegistrationForm.phtml
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
include dirname(__DIR__) . '/header.phtml';
|
||||
?>
|
||||
|
||||
<div class="inhalt">
|
||||
<div class="login-container">
|
||||
<h1>Registrieren</h1>
|
||||
<form class="form-horizontal" action="index.php" method="post">
|
||||
<input type="hidden" name="controller" value="Auth">
|
||||
<input type="hidden" name="do" value="register">
|
||||
<label>
|
||||
<input class="input-vorname" type="text" name="vorname" placeholder="Vorname">
|
||||
</label>
|
||||
<label>
|
||||
<input class="input-nachname" type="text" name="nachname" placeholder="Nachname">
|
||||
</label>
|
||||
<label>
|
||||
<input class="input-email" type="text" name="email" placeholder="E-Mail">
|
||||
</label>
|
||||
<label>
|
||||
<input class="input-passwort" type="password" name="password" placeholder="Passwort">
|
||||
</label>
|
||||
<label>
|
||||
<input class="input-passwort-repeat" type="password" name="password_repeat" placeholder="Passwort wiederholen">
|
||||
</label>
|
||||
<label>
|
||||
<input class="input-strasse" type="text" name="strasse" placeholder="Straße">
|
||||
</label>
|
||||
<label>
|
||||
<input class="input-hausnr" type="text" name="hausnr" placeholder="Hausnr.">
|
||||
</label>
|
||||
<label>
|
||||
<input class="input-postleitzahl" type="text" name="plz" placeholder="Postleitzahl">
|
||||
</label>
|
||||
<label>
|
||||
<input class="input-ort" type="text" name="ort" placeholder="Ort">
|
||||
</label>
|
||||
<label>
|
||||
<input class="input-land" type="text" name="land" placeholder="Land">
|
||||
</label>
|
||||
<label>
|
||||
<input class="input-tel" type="text" name="tel" placeholder="Telefonnr.">
|
||||
</label>
|
||||
<button class="button-register" type="submit">Registrieren</button>
|
||||
</form>
|
||||
<div style="text-align:center; margin-top: 1.5em;">
|
||||
<a href="?controller=Auth&do=showLoginForm" class="login-link">Bereits registriert? Hier einloggen</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include dirname(__DIR__) . '/footer.phtml';
|
||||
?>
|
||||
|
@ -1,12 +0,0 @@
|
||||
<?php
|
||||
include dirname(__DIR__).'/header.phtml';
|
||||
?>
|
||||
|
||||
<div class="msg">
|
||||
<p>Ihre Anfrage wurde erfolgreich versendet.</p>
|
||||
<a href="?controller=Welcome&do=showWelcome">Weiter</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php include dirname(__DIR__).'/footer.phtml'; ?>
|
@ -1,36 +0,0 @@
|
||||
<?php
|
||||
include dirname(__DIR__).'/header.phtml';
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<h2>Ihre Anfrage an uns</h2>
|
||||
<form method="post">
|
||||
|
||||
<?php foreach ($labels as $index => $value) {
|
||||
echo '<label for="' . $index . '">' . $value . '</label>';
|
||||
if ($index == "content") {
|
||||
echo "<textarea id=\"$index\" name=\"$index\" >";
|
||||
if (isset($validData[$index])) { echo $validData[$index]; }
|
||||
echo "</textarea><br>";
|
||||
} else {
|
||||
echo '<input type="text" name="' . $index . '" value="' . (isset($validData[$index]) ? $validData[$index] : '') . '"><br>';
|
||||
}
|
||||
if (isset($errors[$index])) {
|
||||
echo '<label class="errorMsg">' . $errors[$index] . '</label><br>';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="controller" value="contact">
|
||||
<input type="hidden" name="do" value="validateForm">
|
||||
<input type="submit" name="submit" value="Absenden"></form>
|
||||
|
||||
<?php include dirname(__DIR__).'/footer.phtml'; ?>
|
12
Views/Event/createEvent.phtml
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
include dirname(__DIR__).'/header.phtml';
|
||||
?>
|
||||
|
||||
<div class="msg">
|
||||
<p>Das Event "<?php echo $event['name']?>" wurde erfolgreich erstellt!</p>
|
||||
<a href="?controller=Event&do=showEvents">Weiter</a>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include dirname(__DIR__).'/footer.phtml';
|
||||
?>
|
12
Views/Event/deleteEvent.phtml
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
include dirname(__DIR__).'/header.phtml';
|
||||
?>
|
||||
|
||||
<div class="msg">
|
||||
<p>Das Event mit der id"<?php echo $id?>" wurde erfolgreich gelöscht!</p>
|
||||
<a href="?controller=Event&do=showEvents">Weiter</a>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include dirname(__DIR__).'/footer.phtml';
|
||||
?>
|
33
Views/Event/showEvents.phtml
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
include dirname(__DIR__).'/header.phtml';
|
||||
?>
|
||||
<h2>Alle Events</h2>
|
||||
<?php if (!empty($events)): ?>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Beschreibung</th>
|
||||
<th>Von</th>
|
||||
<th>Bis</th>
|
||||
<th>Max. Tickets</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($events as $event): ?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($event['name']); ?></td>
|
||||
<td><?php echo nl2br(htmlspecialchars($event['description'])); ?></td>
|
||||
<td><?php echo date('d.m.Y', strtotime($event['start_date'])); ?></td>
|
||||
<td><?php echo date('d.m.Y', strtotime($event['end_date'])); ?></td>
|
||||
<td><?php echo (int) $event['max_tickets']; ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<p>Derzeit sind keine Events verfügbar.</p>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
include dirname(__DIR__).'/footer.phtml';
|
||||
?>
|
12
Views/Event/updateEvent.phtml
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
include dirname(__DIR__).'/header.phtml';
|
||||
?>
|
||||
|
||||
<div class="msg">
|
||||
<p>Das Event mit der ID "<?php echo $event_id?>" wurde erfolgreich bearbeitet!</p>
|
||||
<a href="?controller=Event&do=showEvents">Weiter</a>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include dirname(__DIR__).'/footer.phtml';
|
||||
?>
|
37
Views/Location/showStandorte.phtml
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
include dirname(__DIR__).'/header.phtml';
|
||||
?>
|
||||
<h2>Unsere Standorte</h2>
|
||||
<?php if (!empty($standorte)): ?>
|
||||
<table border="1" cellpadding="8" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Straße</th>
|
||||
<th>Hausnr.</th>
|
||||
<th>PLZ</th>
|
||||
<th>Ort</th>
|
||||
<th>Land</th>
|
||||
<th>Telefon</th>
|
||||
<th>Email</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($standorte as $standort): ?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($standort['strasse']); ?></td>
|
||||
<td><?php echo htmlspecialchars($standort['hausnr']); ?></td>
|
||||
<td><?php echo htmlspecialchars($standort['plz']); ?></td>
|
||||
<td><?php echo htmlspecialchars($standort['ort']); ?></td>
|
||||
<td><?php echo htmlspecialchars($standort['land']); ?></td>
|
||||
<td><?php echo htmlspecialchars($standort['tel']); ?></td>
|
||||
<td><?php echo htmlspecialchars($standort['email']); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<p>Keine Standorte gefunden.</p>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
include dirname(__DIR__).'/footer.phtml';
|
||||
?>
|
29
Views/News/showNews.phtml
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
include dirname(__DIR__).'/header.phtml';
|
||||
?>
|
||||
<h2>Alle News</h2>
|
||||
<?php if (!empty($news)): ?>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Titel</th>
|
||||
<th>Beschreibung</th>
|
||||
<th>Datum</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($news as $item): ?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($item['name']); ?></td>
|
||||
<td><?php echo nl2br(htmlspecialchars($item['description'])); ?></td>
|
||||
<td><?php echo date('d.m.Y', strtotime($item['date'])); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<p>Derzeit sind keine News verfügbar.</p>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
include dirname(__DIR__).'/footer.phtml';
|
||||
?>
|
12
Views/Ticket/buyTicket.phtml
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
include dirname(__DIR__).'/header.phtml';
|
||||
?>
|
||||
|
||||
<div class="msg">
|
||||
<p>Ihr Ticket für das Event "<?php echo $event['name']?>" wurde erfolgreich gekauft!</p>
|
||||
<a href="?controller=Welcome&do=showWelcome">Weiter</a>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include dirname(__DIR__).'/footer.phtml';
|
||||
?>
|
7
Views/Voucher/createVoucher.phtml
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
include dirname(__DIR__).'/header.phtml';
|
||||
?>
|
||||
<!-- Gutschein-Erstellungsformular oder Inhalt hier einfügen -->
|
||||
<?php
|
||||
include dirname(__DIR__).'/footer.phtml';
|
||||
?>
|
37
Views/Voucher/showVouchers.phtml
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
include dirname(__DIR__).'/header.phtml';
|
||||
?>
|
||||
<h2>Alle Gutscheine</h2>
|
||||
<a href="?controller=Voucher&do=createVoucherForm">Neuen Gutschein anlegen</a>
|
||||
<?php if (!empty($vouchers)): ?>
|
||||
<table border="1" cellpadding="8" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Code</th>
|
||||
<th>Rabatt (%)</th>
|
||||
<th>Event-ID</th>
|
||||
<th>Gültig bis</th>
|
||||
<th>Aktionen</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($vouchers as $v): ?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($v['code']); ?></td>
|
||||
<td><?php echo (int)$v['discount']; ?></td>
|
||||
<td><?php echo (int)$v['event_id']; ?></td>
|
||||
<td><?php echo htmlspecialchars($v['valid_until']); ?></td>
|
||||
<td>
|
||||
<a href="?controller=Voucher&do=editVoucherForm&id=<?php echo $v['voucher_id']; ?>">Bearbeiten</a> |
|
||||
<a href="?controller=Voucher&do=deleteVoucher&id=<?php echo $v['voucher_id']; ?>" onclick="return confirm('Wirklich löschen?');">Löschen</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<p>Keine Gutscheine vorhanden.</p>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
include dirname(__DIR__).'/footer.phtml';
|
||||
?>
|
@ -1,21 +0,0 @@
|
||||
<?php
|
||||
include dirname(__DIR__).'/header.phtml';
|
||||
?>
|
||||
|
||||
<article>
|
||||
<h2>Virtuelles Museum</h2>
|
||||
<span class="articleInfo">John Doe | 12.08.2018 um 10:18 Uhr</span>
|
||||
|
||||
<p>
|
||||
<img class="articleImg" src="images/museum.jpg" alt="my Oculus Rift">
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Curabitur pretium tincidunt lacus. Nulla gravida orci a odio.
|
||||
</p>
|
||||
<p>
|
||||
Proin nonummy, lacus eget pulvinar lacinia, pede felis dignissim leo, vitae tristique magna lacus sit amet eros. Nullam ornare. Praesent odio ligula, dapibus sed, tincidunt eget, dictum ac, nibh. Nam quis lacus. Nunc eleifend molestie velit. Morbi lobortis quam eu velit. Donec euismod vestibulum massa. Donec non lectus. Aliquam commodo lacus sit amet nulla. Cras dignissim elit et augue. Nullam non diam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In hac habitasse platea dictumst. Aenean vestibulum. Sed lobortis elit quis lectus. Nunc sed lacus at augue bibendum dapibus.
|
||||
</p>
|
||||
<p>
|
||||
Aliquam vehicula sem ut pede. Cras purus lectus, egestas eu, vehicula at, imperdiet sed, nibh. Morbi consectetuer luctus felis. Donec vitae nisi. Aliquam tincidunt feugiat elit. Duis sed elit ut turpis ullamcorper feugiat. Praesent pretium, mauris sed fermentum hendrerit, nulla lorem iaculis magna, pulvinar scelerisque urna tellus a justo. Suspendisse pulvinar massa in metus. Duis quis quam. Proin justo. Curabitur ac sapien. Nam erat.
|
||||
Praesent ut quam.
|
||||
</p>
|
||||
</article>
|
||||
<?php include dirname(__DIR__).'/footer.phtml'; ?>
|
@ -1,21 +0,0 @@
|
||||
<?php
|
||||
include dirname(__DIR__).'/header.phtml';
|
||||
?>
|
||||
|
||||
<article>
|
||||
<h2>Implement Controller</h2>
|
||||
<span class="articleInfo">John Doe | 18.07.2018 um 18:43 Uhr</span>
|
||||
|
||||
<p>
|
||||
<img class="articleImg" src="images/controller.jpg" alt="my Oculus Rift">
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Curabitur pretium tincidunt lacus. Nulla gravida orci a odio.
|
||||
</p>
|
||||
<p>
|
||||
Proin nonummy, lacus eget pulvinar lacinia, pede felis dignissim leo, vitae tristique magna lacus sit amet eros. Nullam ornare. Praesent odio ligula, dapibus sed, tincidunt eget, dictum ac, nibh. Nam quis lacus. Nunc eleifend molestie velit. Morbi lobortis quam eu velit. Donec euismod vestibulum massa. Donec non lectus. Aliquam commodo lacus sit amet nulla. Cras dignissim elit et augue. Nullam non diam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In hac habitasse platea dictumst. Aenean vestibulum. Sed lobortis elit quis lectus. Nunc sed lacus at augue bibendum dapibus.
|
||||
</p>
|
||||
<p>
|
||||
Aliquam vehicula sem ut pede. Cras purus lectus, egestas eu, vehicula at, imperdiet sed, nibh. Morbi consectetuer luctus felis. Donec vitae nisi. Aliquam tincidunt feugiat elit. Duis sed elit ut turpis ullamcorper feugiat. Praesent pretium, mauris sed fermentum hendrerit, nulla lorem iaculis magna, pulvinar scelerisque urna tellus a justo. Suspendisse pulvinar massa in metus. Duis quis quam. Proin justo. Curabitur ac sapien. Nam erat.
|
||||
Praesent ut quam.
|
||||
</p>
|
||||
</article>
|
||||
<?php include dirname(__DIR__).'/footer.phtml'; ?>
|
@ -1,23 +0,0 @@
|
||||
<?php
|
||||
include dirname(__DIR__).'/header.phtml';
|
||||
?>
|
||||
|
||||
<!-- <a href="?controller=guestbook&do=showGuestbookForm">Neuen Eintrag schreiben</a> -->
|
||||
<article>
|
||||
<h2>Willkommen</h2>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
||||
</p>
|
||||
<p>
|
||||
Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris. Integer in mauris eu nibh euismod gravida. Duis ac tellus et risus vulputate vehicula. Donec lobortis risus a elit. Etiam tempor. Ut ullamcorper, ligula eu tempor congue, eros est euismod turpis, id tincidunt sapien risus a quam. Maecenas fermentum consequat mi. Donec fermentum. Pellentesque malesuada nulla a mi. Duis sapien sem, aliquet nec, commodo eget, consequat quis, neque. Aliquam faucibus, elit ut dictum aliquet, felis nisl adipiscing sapien, sed malesuada diam lacus eget erat. Cras mollis scelerisque nunc. Nullam arcu. Aliquam consequat. Curabitur augue lorem, dapibus quis, laoreet et, pretium ac, nisi. Aenean magna nisl, mollis quis, molestie eu, feugiat in, orci. In hac habitasse platea dictumst.
|
||||
</p>
|
||||
<p>
|
||||
Fusce convallis, mauris imperdiet gravida bibendum, nisl turpis suscipit mauris, sed placerat ipsum urna sed risus. In convallis tellus a mauris. Curabitur non elit ut libero tristique sodales. Mauris a lacus. Donec mattis semper leo. In hac habitasse platea dictumst. Vivamus facilisis diam at odio. Mauris dictum, nisi eget consequat elementum, lacus ligula molestie metus, non feugiat orci magna ac sem. Donec turpis. Donec vitae metus. Morbi tristique neque eu mauris. Quisque gravida ipsum non sapien. Proin turpis lacus, scelerisque vitae, elementum at, lobortis ac, quam. Aliquam dictum eleifend risus. In hac habitasse platea dictumst. Etiam sit amet diam. Suspendisse odio. Suspendisse nunc. In semper bibendum libero.
|
||||
</p>
|
||||
<p>
|
||||
Proin nonummy, lacus eget pulvinar lacinia, pede felis dignissim leo, vitae tristique magna lacus sit amet eros. Nullam ornare. Praesent odio ligula, dapibus sed, tincidunt eget, dictum ac, nibh. Nam quis lacus. Nunc eleifend molestie velit. Morbi lobortis quam eu velit. Donec euismod vestibulum massa. Donec non lectus. Aliquam commodo lacus sit amet nulla. Cras dignissim elit et augue. Nullam non diam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In hac habitasse platea dictumst. Aenean vestibulum. Sed lobortis elit quis lectus.
|
||||
Nunc sed lacus at augue bibendum dapibus.
|
||||
</p>
|
||||
</article>
|
||||
<?php include dirname(__DIR__).'/footer.phtml'; ?>
|
||||
|
@ -1,5 +1,13 @@
|
||||
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<div id="footer">
|
||||
<div class="container-zahlungsmittel">
|
||||
<h2 class="header-zahlungsarten">Mögliche Zahlungsarten</h2>
|
||||
<div class="zahlungsmittel-img"></div>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
<a class="link-impressum">Impressum</a>
|
||||
<a class="link-datenschutz">Datenschutz</a>
|
||||
<a class="link-nutzungsbedingungen">Nutzungsbedingungen</a>
|
||||
<span class="text-bib">© bib arts GmbH</span>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,25 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>VR Contact</title>
|
||||
<title>Bib Arts</title>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="CSS/style.css" rel="stylesheet" type="text/css" />
|
||||
<link href="/bibarts/CSS/style.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
<nav>
|
||||
<div id="metanavi">
|
||||
<a href="#">Anmelden</a>
|
||||
<div id="wrapper">
|
||||
<nav id="navigation">
|
||||
<div class="link-container">
|
||||
<div id="logo" ><a class="link-logo" href="#"></a></div>
|
||||
<a id="link-ausstellungen" class="links" href="?controller=Event&do=showEvents">Ausstellungen</a>
|
||||
<a id="link-tickets" class="links" href="#">Tickets</a>
|
||||
<a id="link-news" class="links" href="/bibarts/?controller=News&do=showNews">News</a>
|
||||
<a id="link-profil" class="links" href="?controller=Contact&do=showContactForm">Profil</a>
|
||||
<div id="profile-picture"></div>
|
||||
<?php if (isset($_SESSION['user'])): ?>
|
||||
<form method="post" action="/bibarts/index.php" style="display:inline;">
|
||||
<input type="hidden" name="controller" value="Auth">
|
||||
<input type="hidden" name="do" value="logout">
|
||||
<button type="submit" class="links" style="background:none;border:none;cursor:pointer;">Logout</button>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<a class="links" href="?controller=Auth&do=showLoginForm">Login</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<h1><span>V</span>irtual <span>R</span>evolution</h1>
|
||||
<ul>
|
||||
<li><a href="?controller=Welcome&do=showWelcome">Willkommen</a></li>
|
||||
<li><a href="#">Projekte</a></li>
|
||||
<li><a href="#">Workshops</a></li>
|
||||
<li><a href="?controller=Contact&do=showContactForm">Kontakt</a></li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<main>
|
||||
</div>
|
112
bibarts.sql
Normal file
@ -0,0 +1,112 @@
|
||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||
SET time_zone = "+00:00";
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
CREATE TABLE user (
|
||||
user_id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
first_name VARCHAR(50),
|
||||
last_name VARCHAR(50),
|
||||
street VARCHAR(100),
|
||||
house_number VARCHAR(10),
|
||||
postal_code VARCHAR(10),
|
||||
city VARCHAR(50),
|
||||
country VARCHAR(50),
|
||||
phone VARCHAR(20),
|
||||
email VARCHAR(100) UNIQUE,
|
||||
is_admin BOOLEAN DEFAULT FALSE,
|
||||
valid_until DATETIME NOT NULL DEFAULT '3025-01-01 00:00:00',
|
||||
password VARCHAR(255)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE location (
|
||||
location_id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
street VARCHAR(100),
|
||||
house_number VARCHAR(10),
|
||||
postal_code VARCHAR(10),
|
||||
city VARCHAR(50),
|
||||
country VARCHAR(50),
|
||||
phone VARCHAR(20),
|
||||
email VARCHAR(100)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE event (
|
||||
event_id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
location_id INT,
|
||||
start_date DATE,
|
||||
end_date DATE,
|
||||
name VARCHAR(100),
|
||||
description TEXT,
|
||||
max_tickets INT,
|
||||
ticket_price DECIMAL(5,2),
|
||||
FOREIGN KEY (location_id) REFERENCES location(location_id)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE ticket (
|
||||
ticket_id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
user_id INT,
|
||||
event_id INT,
|
||||
purchase_date DATE,
|
||||
valid_until DATE,
|
||||
FOREIGN KEY (user_id) REFERENCES user(user_id),
|
||||
FOREIGN KEY (event_id) REFERENCES event(event_id)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE voucher (
|
||||
voucher_id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
code VARCHAR(50) UNIQUE,
|
||||
discount INT CHECK (discount BETWEEN 0 AND 100),
|
||||
event_id INT,
|
||||
valid_until DATE,
|
||||
FOREIGN KEY (event_id) REFERENCES event(event_id)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE news (
|
||||
news_id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(100),
|
||||
description TEXT,
|
||||
date DATE
|
||||
);
|
||||
|
||||
|
||||
|
||||
-- User-Daten (Passwort: passwort123)
|
||||
INSERT INTO user (first_name, last_name, street, house_number, postal_code, city, country, phone, email, is_admin, password)
|
||||
VALUES
|
||||
('Max', 'Muster', 'Musterstraße', '1', '12345', 'Musterstadt', 'Deutschland', '0123456789', 'max@muster.de', FALSE, '$2y$10$VAj.C0XHPUxV4oXS6b79aumlg5fBMPPx5FPqgkQSIQeBLh0WtYmKy'),
|
||||
('Anna', 'Beispiel', 'Beispielweg', '5a', '54321', 'Beispielstadt', 'Deutschland', '0987654321', 'anna@beispiel.de', TRUE, '$2y$10$cnPBpkvLbdpDxzYvxlQg9uVp5y8ggr2SWL8NAMg9zk.3QnnEl.MGq');
|
||||
|
||||
-- Standort-Daten
|
||||
INSERT INTO location (street, house_number, postal_code, city, country, phone, email)
|
||||
VALUES
|
||||
('Galeriestraße', '10', '10115', 'Berlin', 'Deutschland', '030123456', 'kontakt@galerie-berlin.de'),
|
||||
('Kunstallee', '22b', '50667', 'Köln', 'Deutschland', '0221123456', 'info@kunst-koeln.de');
|
||||
|
||||
-- Ausstellung-Daten
|
||||
INSERT INTO event (location_id, start_date, end_date, name, description, max_tickets, ticket_price)
|
||||
VALUES
|
||||
(1, '2025-07-01', '2025-08-31', 'Moderne Meisterwerke', 'Eine Sammlung moderner Kunstwerke aus Europa.', 200, 19.99),
|
||||
(2, '2025-09-10', '2025-10-20', 'Kunst der Antike', 'Ausstellung antiker Skulpturen und Gemälde.', 150, 39.99);
|
||||
|
||||
-- Gutschein-Daten
|
||||
INSERT INTO voucher (code, discount, event_id, valid_until)
|
||||
VALUES
|
||||
('SOMMER2025', 15, 1, '2025-08-31'),
|
||||
('HERBST25', 25, 2, '2025-10-15');
|
||||
|
||||
-- Ticket-Daten
|
||||
INSERT INTO ticket (user_id, event_id, purchase_date, valid_until)
|
||||
VALUES
|
||||
(1, 1, '2025-06-01', '2025-07-15'),
|
||||
(2, 2, '2025-06-05', '2025-09-15');
|
||||
|
||||
-- News-Daten
|
||||
INSERT INTO news (name, description, date)
|
||||
VALUES
|
||||
('Neuer Standort eröffnet', 'Unsere Galerie in Köln ist jetzt geöffnet!', '2025-06-01'),
|
||||
('Frühbucher-Rabatt', 'Sichern Sie sich jetzt 15% Rabatt auf unsere Sommerausstellung.', '2025-05-20');
|
30
contact.sql
@ -1,30 +0,0 @@
|
||||
-- phpMyAdmin SQL Dump
|
||||
-- version 4.5.1
|
||||
-- http://www.phpmyadmin.net
|
||||
--
|
||||
-- Host: 127.0.0.1
|
||||
-- Erstellungszeit: 24. Nov 2017 um 17:01
|
||||
-- Server-Version: 10.1.16-MariaDB
|
||||
-- PHP-Version: 7.0.9
|
||||
|
||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||
SET time_zone = "+00:00";
|
||||
|
||||
--
|
||||
-- Datenbank: `blog`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
CREATE TABLE `contact` (
|
||||
`id` varchar(36) NOT NULL,
|
||||
`topicCode` tinyint(2) NULL,
|
||||
`name` varchar(200) NOT NULL,
|
||||
`email` varchar(300) NOT NULL,
|
||||
`phone` varchar(16) NULL,
|
||||
`content` varchar(500) NOT NULL,
|
||||
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
ALTER TABLE `contact`
|
||||
ADD PRIMARY KEY (`id`)
|
BIN
images/Zahlungsmittel.png
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
images/beispiel-austellung1.png
Normal file
After Width: | Height: | Size: 855 KiB |
BIN
images/beispiel-austellung2.png
Normal file
After Width: | Height: | Size: 2.1 MiB |
BIN
images/bibArts.png
Normal file
After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 100 KiB |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 16 KiB |
@ -19,11 +19,11 @@ spl_autoload_register(function ($className) {
|
||||
$controllerName = "";
|
||||
$doMethodName = "";
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
$controllerName = isset($_POST['controller']) && $_POST['controller'] ? $_POST['controller'] : "Welcome";
|
||||
$doMethodName = isset($_POST['do']) && $_POST['do'] ? $_POST['do'] : "showWelcome";
|
||||
$controllerName = isset($_POST['controller']) && $_POST['controller'] ? $_POST['controller'] : "Auth";
|
||||
$doMethodName = isset($_POST['do']) && $_POST['do'] ? $_POST['do'] : "showAuthForm";
|
||||
} else {
|
||||
$controllerName = isset($_GET['controller']) && $_GET['controller'] ? $_GET['controller'] : "Welcome";
|
||||
$doMethodName = isset($_GET['do']) && $_GET['do'] ? $_GET['do'] : "showWelcome";
|
||||
$controllerName = isset($_GET['controller']) && $_GET['controller'] ? $_GET['controller'] : "Auth";
|
||||
$doMethodName = isset($_GET['do']) && $_GET['do'] ? $_GET['do'] : "showAuthForm";
|
||||
}
|
||||
|
||||
$controllerClassName = 'Blog\\Controller\\'.ucfirst($controllerName).'Controller';
|
||||
|