removed gallery, added notizen button

This commit is contained in:
Felix Ivo 2025-06-16 10:01:41 +02:00
parent 3862b68d9f
commit da82f93e99
5 changed files with 7 additions and 81 deletions

View File

@ -1,27 +0,0 @@
<?php
namespace ppa\Controller;
use ppa\Model\GalleryModel;
use ppa\Library\View;
class GalleryController
{
private $galleryModel;
protected $view;
public function __construct($view)
{
$this->galleryModel = new GalleryModel();
$this->view = $view;
}
public function showPhotos()
{
$this->view->setVars([
"photos" => $this->galleryModel->selectPhotos()
]);
}
}

View File

@ -7,10 +7,10 @@ abstract class Database {
/**
* Zugangsdaten für die Datenbank
*/
private $dbName = "fotofreunde"; //Datenbankname
private $linkName = "localhost"; //Datenbank-Server
private $user = "root"; //Benutzername
private $pw = "root"; //Passwort
private $dbName = "pbbfa23civ_notes"; //Datenbankname
private $linkName = "mysql.pb.bib.de"; //Datenbank-Server
private $user = "pbbfa23civ"; //Benutzername
private $pw = "eJZpd6EuqZzV"; //Passwort
/**
* Stellt eine Verbindung zur Datenbank her

View File

@ -1,28 +0,0 @@
<?php
namespace ppa\Model;
use ppa\Model\ParticipantModel;
class GalleryModel extends Database
{
public function selectPhotos()
{
$sql = "SELECT title, filename, category.description, firstname, gallery.created
, gallery.description as alt
FROM gallery
JOIN category ON category.id = categoryId
JOIN user ON user.id = userId
ORDER BY gallery.created DESC";
$pdo = $this->linkDB();
try {
$res = $pdo->query($sql);
} catch (\PDOException $e) {
new \ppa\Library\ErrorMsg("Ihre Anfrage konnte nicht verarbeitet werden", $e);
die;
}
return $res->fetchAll(\PDO::FETCH_ASSOC);
}
}

View File

@ -1,17 +0,0 @@
<?php include dirname(__DIR__).'/header.phtml'; ?>
<h2>Galerie</h2>
<div class="container">
<?php
foreach($photos as $p) {
echo '<div class="item-4-12">';
echo '<h3>' . $p["title"] . '</h3>'
. '<img src="images/' . $p["filename"] . '" />';
echo '</div>';
}
?>
</div>
<?php include dirname(__DIR__).'/footer.phtml'; ?>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>Gallery View Vorlage</title>
<title>Notizen App</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width">
<link href="CSS/style.css" rel="stylesheet" type="text/css" />
@ -12,15 +12,13 @@
<div class="button">
<a href="?controller=User&do=showUserLoginForm">Anmelden</a>
</div>
<h1>Fotofreun<span>.de</span> OWL<span>e.V.</span></h1>
<h1>Notes<span>.de</span></h1>
</div>
</header>
<nav>
<ul>
<li><a href="?controller=Welcome&do=showWelcome">Willkommen</a></li>
<li><a href="#">Mitglieder</a></li>
<li><a href="?controller=Gallery&do=showPhotos">Galerie</a></li>
<li><a href="#">G&auml;stebuch</a></li>
<li><a href="?controller=Notes&do=showNotes">Notizen</a></li>
</ul>
</nav>
<div class="wrapper">