Merge branch 'frontendBackendFinal' of https://git.bib.de/PBBFA23CSE/Bib-Arts into frontendBackendFinal

This commit is contained in:
Max Schneider 2025-07-07 14:22:53 +02:00
commit ca757d1723
11 changed files with 97 additions and 66 deletions

View File

@ -50,14 +50,14 @@ class AuthController
if ($result === true) {
$_SESSION['user'] = $email;
header('Location: /bibarts/?controller=News&do=showNews');
exit();
$this->view->setDoMethodName('showLoginSuccess');
} else {
$this->view->setVars([
'errors' => ['login' => is_string($result) ? $result : "Login fehlgeschlagen."],
'validData' => ['email' => $email],
'loginSuccess' => false
]);
$this->view->setDoMethodName('showLoginForm');
}
}
@ -87,7 +87,6 @@ class AuthController
$errors['register'] = is_string($result) ? $result : "Registrierung fehlgeschlagen.";
$this->view->setVars(['errors' => $errors, 'validData' => $data]);
$this->view->render('Auth/showRegistrationForm');
exit;
}
}
@ -128,8 +127,7 @@ class AuthController
}
}
public function showConfirmation()
{
public function showConfirmation() {
$messages = [
'login' => "Login erfolgreich.",
'register' => "Registrierung erfolgreich.",
@ -145,7 +143,6 @@ class AuthController
public function logout() {
unset($_SESSION['user']);
session_destroy();
header('Location: /bibarts/?controller=Auth&do=showLoginForm');
exit();
$this->view->setDoMethodName('showLogoutSuccess');
}
}

View File

@ -0,0 +1,15 @@
<div class="inhalt">
<div class="login-success">
<h2>Login erfolgreich!</h2>
<p>Sie werden in wenigen Sekunden zu den News weitergeleitet...</p>
</div>
</div>
<script>
setTimeout(function() {
window.location.href = "?controller=News&do=showNews";
}, 2000); // 2 Sekunden warten
</script>
<noscript>
<meta http-equiv="refresh" content="2;url=?controller=News&do=showNews">
</noscript>

View File

@ -0,0 +1,14 @@
<div class="inhalt">
<div class="login-success">
<h2>Logout erfolgreich!</h2>
<p>Sie werden in wenigen Sekunden zum Login weitergeleitet...</p>
</div>
</div>
<script>
setTimeout(function() {
window.location.href = "?controller=Auth&do=showLoginForm";
}, 2000); // 2 Sekunden warten
</script>
<noscript>
<meta http-equiv="refresh" content="2;url=?controller=Auth&do=showLoginForm">
</noscript>

View File

@ -2,11 +2,11 @@
include dirname(__DIR__).'/header.phtml';
?>
<div class="inhalt">
<div class="msg">
<p>Das Event "<?php echo $name?>" wurde erfolgreich erstellt!</p>
<a href="?controller=Event&do=showEvents">Weiter</a>
</div>
</div>
<?php include dirname(__DIR__).'/footer.phtml'; ?>

View File

@ -2,11 +2,11 @@
include dirname(__DIR__).'/header.phtml';
?>
<div class="inhalt">
<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>
</div>
<?php include dirname(__DIR__).'/footer.phtml'; ?>

View File

@ -2,11 +2,11 @@
include dirname(__DIR__).'/header.phtml';
?>
<div class="inhalt">
<div class="msg">
<p>Das Event mit der ID "<?php echo $ausstellungid?>" wurde erfolgreich bearbeitet!</p>
<a href="?controller=Event&do=showEvents">Weiter</a>
</div>
</div>
<?php include dirname(__DIR__).'/footer.phtml'; ?>

View File

@ -1,5 +1,6 @@
<?php include dirname(__DIR__) . '/header.phtml'; ?>
<div class="inhalt">
<h2>Alle Gutscheine</h2>
<a href="?controller=Gutschein&do=createGutscheinForm">Neuen Gutschein anlegen</a>
<?php if (!empty($gutscheine)): ?>
@ -17,9 +18,9 @@
<?php foreach ($gutscheine as $g): ?>
<tr>
<td><?php echo htmlspecialchars($g['code']); ?></td>
<td><?php echo (int)$g['rabatt']; ?></td>
<td><?php echo (int)$g['eventid']; ?></td>
<td><?php echo htmlspecialchars($g['gültigkeit']); ?></td>
<td><?php echo (int)$g['discount']; ?></td>
<td><?php echo (int)$g['event_id']; ?></td>
<td><?php echo htmlspecialchars($g['valid_until']); ?></td>
<td>
<a href="?controller=Gutschein&action=editGutscheinForm&id=<?php echo $g['gutscheinid']; ?>">Bearbeiten</a> |
<a href="?controller=Gutschein&action=deleteGutschein&id=<?php echo $g['gutscheinid']; ?>" onclick="return confirm('Wirklich löschen?');">Löschen</a>
@ -31,5 +32,5 @@
<?php else: ?>
<p>Keine Gutscheine vorhanden.</p>
<?php endif; ?>
</div>
<?php include dirname(__DIR__) . '/footer.phtml'; ?>

View File

@ -1,7 +1,6 @@
<?php if (!empty($news)): ?>
<h2>Alle News</h2>
<table>
<thead>
<tr>
@ -14,12 +13,14 @@
<?php foreach ($news as $item): ?>
<tr>
<td><?php echo htmlspecialchars($item['name']); ?></td>
<td><?php echo nl2br(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>
</div>
<?php else: ?>
<p>Derzeit sind keine News verfügbar.</p>
<?php endif; ?>

View File

@ -1,5 +1,6 @@
<?php include dirname(__DIR__) . '/header.phtml'; ?>
<div class="inhalt">
<h2>Unsere Standorte</h2>
<?php if (!empty($standorte)): ?>
@ -18,12 +19,12 @@
<tbody>
<?php foreach ($standorte as $standort): ?>
<tr>
<td><?php echo htmlspecialchars($standort['stre']); ?></td>
<td><?php echo htmlspecialchars($standort['hausnr']); ?></td>
<td><?php echo htmlspecialchars($standort['postleitzahl']); ?></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['street']); ?></td>
<td><?php echo htmlspecialchars($standort['house_number']); ?></td>
<td><?php echo htmlspecialchars($standort['postal_code']); ?></td>
<td><?php echo htmlspecialchars($standort['city']); ?></td>
<td><?php echo htmlspecialchars($standort['country']); ?></td>
<td><?php echo htmlspecialchars($standort['phone']); ?></td>
<td><?php echo htmlspecialchars($standort['email']); ?></td>
</tr>
<?php endforeach; ?>
@ -32,5 +33,5 @@
<?php else: ?>
<p>Keine Standorte gefunden.</p>
<?php endif; ?>
</div>
<?php include dirname(__DIR__) . '/footer.phtml'; ?>

View File

@ -15,7 +15,11 @@
<a id="link-tickets" class="links" href="?controller=Event&do=showEvents">Event</a>
<a id="link-infos" class="links" href="?controller=News&do=showNews">Infos</a>
<a id="link-profil" class="links" href="?controller=Profile&do=showProfile">Profil</a>
<?php if (isset($_SESSION['user'])): ?>
<a id="link-logout" class="links" href="?controller=Auth&do=logout">Logout</a>
<?php else: ?>
<a id="link-login" class="links" href="?controller=Auth&do=showLoginForm">Login</a>
<?php endif; ?>
<a id="link-register" class="links" href="?controller=Auth&do=showRegistrationForm">Register</a>
<div id="profile-picture"></div>
</div>

View File

@ -2,7 +2,6 @@
session_start();
include 'Views/header.phtml';
?>
<div id="wrapper">
<?php
spl_autoload_register(function ($className) {
if (substr($className, 0, 5) !== 'Blog\\') {
@ -43,7 +42,6 @@ include 'Views/header.phtml';
new \Blog\Library\ErrorMsg('Page not found: '.$controllerClassName.'::'.$doMethodName);
}
?>
</div>
<?php
include 'Views/footer.phtml';
?>