removed gallery, added notizen button
This commit is contained in:
parent
3862b68d9f
commit
da82f93e99
@ -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()
|
|
||||||
]);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -7,10 +7,10 @@ abstract class Database {
|
|||||||
/**
|
/**
|
||||||
* Zugangsdaten für die Datenbank
|
* Zugangsdaten für die Datenbank
|
||||||
*/
|
*/
|
||||||
private $dbName = "fotofreunde"; //Datenbankname
|
private $dbName = "pbbfa23civ_notes"; //Datenbankname
|
||||||
private $linkName = "localhost"; //Datenbank-Server
|
private $linkName = "mysql.pb.bib.de"; //Datenbank-Server
|
||||||
private $user = "root"; //Benutzername
|
private $user = "pbbfa23civ"; //Benutzername
|
||||||
private $pw = "root"; //Passwort
|
private $pw = "eJZpd6EuqZzV"; //Passwort
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stellt eine Verbindung zur Datenbank her
|
* Stellt eine Verbindung zur Datenbank her
|
||||||
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
@ -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'; ?>
|
|
@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Gallery View Vorlage</title>
|
<title>Notizen App</title>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width">
|
<meta name="viewport" content="width=device-width">
|
||||||
<link href="CSS/style.css" rel="stylesheet" type="text/css" />
|
<link href="CSS/style.css" rel="stylesheet" type="text/css" />
|
||||||
@ -12,15 +12,13 @@
|
|||||||
<div class="button">
|
<div class="button">
|
||||||
<a href="?controller=User&do=showUserLoginForm">Anmelden</a>
|
<a href="?controller=User&do=showUserLoginForm">Anmelden</a>
|
||||||
</div>
|
</div>
|
||||||
<h1>Fotofreun<span>.de</span> OWL<span>e.V.</span></h1>
|
<h1>Notes<span>.de</span></h1>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="?controller=Welcome&do=showWelcome">Willkommen</a></li>
|
<li><a href="?controller=Welcome&do=showWelcome">Willkommen</a></li>
|
||||||
<li><a href="#">Mitglieder</a></li>
|
<li><a href="?controller=Notes&do=showNotes">Notizen</a></li>
|
||||||
<li><a href="?controller=Gallery&do=showPhotos">Galerie</a></li>
|
|
||||||
<li><a href="#">Gästebuch</a></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user