Projekt initialize
This commit is contained in:
commit
6a9d16028d
202
CSS/style.css
Normal file
202
CSS/style.css
Normal file
@ -0,0 +1,202 @@
|
||||
*, *:before, *:after {
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #ffffff;
|
||||
color: #666;
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
text-decoration: none;
|
||||
margin: 5px;
|
||||
text-align: center;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
nav li a:hover {
|
||||
background-color: orange;
|
||||
}
|
||||
|
||||
nav {
|
||||
position: fixed;
|
||||
background: white;
|
||||
top: 0px;
|
||||
width: 600px;
|
||||
text-align: center;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
#metanavi {
|
||||
color: #4d4d4d;
|
||||
font-weight: bold;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
#metanavi a {
|
||||
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;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#metanavi a:hover {
|
||||
background: orange;
|
||||
}
|
||||
|
||||
.articleImg {
|
||||
width: 100%;
|
||||
border: 2px solid lightskyblue;
|
||||
padding: 5px;
|
||||
margin: 0 0 15px 0;
|
||||
}
|
||||
|
||||
.welcomeImg {
|
||||
width: 100%;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.articleInfo {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/*** Formulare ***/
|
||||
|
||||
form {
|
||||
width: 440px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
label {
|
||||
width: 120px;
|
||||
display: inline-block;
|
||||
margin: 5px 15px 10px 0;
|
||||
vertical-align: top;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
300
CSS/style_.css
Normal file
300
CSS/style_.css
Normal file
@ -0,0 +1,300 @@
|
||||
/*
|
||||
To change this license header, choose License Headers in Project Properties.
|
||||
To change this template file, choose Tools | Templates
|
||||
and open the template in the editor.
|
||||
*/
|
||||
/*
|
||||
Created on : 01.04.2016, 15:39:10
|
||||
Author : reich
|
||||
*/
|
||||
|
||||
*, *:before, *:after {
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
#wrapper {
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
background-color: #4d4d4d;
|
||||
padding: 10px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 10px;
|
||||
color: #4d4d4d;
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
h1 span {
|
||||
/*color: #09add0;*/
|
||||
color: orange;
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: orange;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: none;
|
||||
color: white;
|
||||
}
|
||||
|
||||
nav ul {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
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;
|
||||
text-decoration: none;
|
||||
margin: 5px;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
nav li a:hover {
|
||||
background-color: lightskyblue;
|
||||
}
|
||||
|
||||
nav {
|
||||
position: fixed;
|
||||
background: white;
|
||||
top: 0px;
|
||||
margin-left: -10px;
|
||||
width: 600px;
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
main {
|
||||
margin-top: 145px;
|
||||
}
|
||||
|
||||
.nav_back {
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.articleImg {
|
||||
width: 200px;
|
||||
float: left;
|
||||
border: 2px solid lightskyblue;
|
||||
padding: 5px;
|
||||
margin: 5px 10px 5px 5px;
|
||||
|
||||
}
|
||||
|
||||
.articleInfo {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
label {
|
||||
width: 80px;
|
||||
display: inline-block;
|
||||
margin: 5px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
label.errorMsg {
|
||||
width: 380px;
|
||||
display: inline-block;
|
||||
margin: 5px;
|
||||
vertical-align: top;
|
||||
text-align: right;
|
||||
color: orange;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
input[type="submit"] {
|
||||
width: 100px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
#entry {
|
||||
width: 300px;
|
||||
height: 150px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
form {
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
#metanavi {
|
||||
color: #4d4d4d;
|
||||
font-weight: bold;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
#metanavi a {
|
||||
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;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#metanavi a:hover {
|
||||
background: orange;
|
||||
}
|
||||
|
||||
#signup form {
|
||||
padding: 20px 0 60px;
|
||||
}
|
||||
|
||||
#signup p {
|
||||
margin: 0 0 5px 0;
|
||||
}
|
||||
|
||||
#signup {
|
||||
margin: auto;
|
||||
width: 450px;
|
||||
}
|
||||
|
||||
#signup ol {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#signup li {
|
||||
margin: 0 0 20px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#signup label {
|
||||
width: 150px;
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
text-align: right;
|
||||
padding-right: 15px;
|
||||
font-weight: 500;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
#signup span {
|
||||
margin-top: 10px;
|
||||
width: 400px;
|
||||
color: orange;
|
||||
text-align: right;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#signup input {
|
||||
display: inline-block;
|
||||
width: 250px;
|
||||
border: 1px solid #aaa;
|
||||
padding: 6px 10px 6px 6px;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#signup input[type="submit"]{
|
||||
background: #09add0;
|
||||
border:none;
|
||||
width:180px;
|
||||
margin-left: 230px;
|
||||
padding:5px;
|
||||
border-radius:5px;
|
||||
color:#fff;
|
||||
font-weight:bold;
|
||||
cursor:pointer;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
#signup input[type="submit"]:hover {
|
||||
background: orange;
|
||||
}
|
||||
|
||||
#signup label.errorMsg {
|
||||
width: 400px;
|
||||
padding:5px 5px 5px 0;
|
||||
color: orange;
|
||||
}
|
||||
|
||||
.autherIcons i {
|
||||
margin: 0 5px 0 5px;
|
||||
color: orange;
|
||||
}
|
||||
|
||||
.autherIcons i:hover {
|
||||
color: white;
|
||||
}
|
||||
|
||||
/*** Formulare ***/
|
||||
|
||||
form {
|
||||
width: 440px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
label {
|
||||
width: 120px;
|
||||
display: inline-block;
|
||||
margin: 5px 15px 10px 0;
|
||||
vertical-align: top;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
66
CSS/style_columns.css
Normal file
66
CSS/style_columns.css
Normal file
@ -0,0 +1,66 @@
|
||||
/*
|
||||
Created on : 04.01.2018, 04:54:54
|
||||
Author : reich
|
||||
*/
|
||||
|
||||
/*** 12 spaltiges Grid mit Flexboxen ***/
|
||||
|
||||
/*** Container ***/
|
||||
.row {
|
||||
display: flex;
|
||||
flex-flow: row;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
/*** Spaltendefinitionen Smartphone Ansicht ***/
|
||||
@media (max-width: 529px) {
|
||||
.col-s-12 {
|
||||
flex: 0 0 100%;
|
||||
}
|
||||
|
||||
/*** Loesung Workshop-Seite ***/
|
||||
.textContent {
|
||||
padding: 15px 0 0 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*** Spaltendefinitionen Tablet Ansicht ***/
|
||||
@media (min-width: 530px) {
|
||||
.col-m-1 {
|
||||
flex: 0 0 100%;
|
||||
}
|
||||
.col-m-4 {
|
||||
flex: 0 0 33.3333333%;
|
||||
}
|
||||
.col-m-6 {
|
||||
flex: 0 0 50%;
|
||||
}
|
||||
.col-m-12 {
|
||||
flex: 0 0 100%;
|
||||
}
|
||||
}
|
||||
|
||||
/*** Spaltendefinitionen Desktop Ansicht ***/
|
||||
@media (min-width: 800px) {
|
||||
.col-1 {
|
||||
flex: 0 0 8.3333333%;
|
||||
}
|
||||
.col-3 {
|
||||
flex: 0 0 25%;
|
||||
}
|
||||
.col-4 {
|
||||
flex: 0 0 33.3333333%;
|
||||
}
|
||||
.col-5 {
|
||||
flex: 0 0 41.6666667%;
|
||||
}
|
||||
.col-6 {
|
||||
flex: 0 0 50%;
|
||||
}
|
||||
.col-8 {
|
||||
flex: 0 0 66.66666667%;
|
||||
}
|
||||
.col-12 {
|
||||
flex: 0 0 100%;
|
||||
}
|
||||
}
|
56
Controller/ContactController.php
Normal file
56
Controller/ContactController.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
18
Controller/WelcomeController.php
Normal file
18
Controller/WelcomeController.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Blog\Controller;
|
||||
|
||||
class WelcomeController
|
||||
{
|
||||
function showWelcome() {
|
||||
|
||||
}
|
||||
|
||||
function showProjects() {
|
||||
|
||||
}
|
||||
|
||||
function showTutorials() {
|
||||
|
||||
}
|
||||
}
|
25
Library/ErrorMsg.php
Normal file
25
Library/ErrorMsg.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Blog\Library;
|
||||
|
||||
use Blog\Library\View;
|
||||
|
||||
class ErrorMsg
|
||||
{
|
||||
protected $view;
|
||||
|
||||
public function __construct($msg = 'Ihre Anfrage konnte nicht verarbeitet werden', $ex = '')
|
||||
{
|
||||
$this->view = new View(dirname(__DIR__).DIRECTORY_SEPARATOR.'Views'
|
||||
, 'Error', 'showErrMsg');
|
||||
$this->view->setVars([
|
||||
'error' => $msg,
|
||||
'debug' => $ex
|
||||
|
||||
]);
|
||||
$this->view->render();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
58
Library/View.php
Normal file
58
Library/View.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
namespace Blog\Library;
|
||||
|
||||
class View
|
||||
{
|
||||
protected $path, $controller, $do, $vars = [];
|
||||
|
||||
/**
|
||||
* @param string $path Basepath of the views.
|
||||
* @param string $controllerName Current controller.
|
||||
* @param string $doMethodName Current action.
|
||||
*/
|
||||
public function __construct($path, $controllerName, $doMethodName)
|
||||
{
|
||||
$this->path = $path;
|
||||
$this->controller = $controllerName;
|
||||
$this->do = $doMethodName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set view vars. The keys will be added, to existing keys.
|
||||
*
|
||||
* @param array $vars
|
||||
*/
|
||||
public function setVars(array $vars)
|
||||
{
|
||||
foreach ($vars as $key => $val) {
|
||||
$this->vars[$key] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
public function setDoMethodName($doMethodName)
|
||||
{
|
||||
$this->do = $doMethodName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the view.
|
||||
*
|
||||
* @throws NotFoundException
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
$fileName = $this->path.DIRECTORY_SEPARATOR.$this->controller.DIRECTORY_SEPARATOR.$this->do.'.phtml';
|
||||
|
||||
if (!file_exists($fileName)) {
|
||||
echo "Fehler: Datei " . $fileName . " existiert nicht";
|
||||
exit();
|
||||
}
|
||||
|
||||
// spare the view the bloat of using "$this->vars[]" for every variable
|
||||
foreach ($this->vars as $key => $val) {
|
||||
$$key = $val; //Variable Variablen siehe http://php.net/manual/de/language.variables.variable.php
|
||||
}
|
||||
|
||||
include $fileName;
|
||||
}
|
||||
}
|
31
Model/ContactModel.php
Normal file
31
Model/ContactModel.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Blog\Model;
|
||||
|
||||
use PDOException;
|
||||
|
||||
class ContactModel extends Database
|
||||
{
|
||||
public function writeContactData($values)
|
||||
{
|
||||
$guid = $this->createUUID();
|
||||
|
||||
$sql = "INSERT INTO contact (`id`, `name`, `email`, `content`) VALUES (
|
||||
:guid, :name, :email, :content);";
|
||||
|
||||
$pdo = $this->linkDB();
|
||||
|
||||
try {
|
||||
$sth = $pdo->prepare($sql);
|
||||
$sth->execute(array(":guid" => $guid,
|
||||
":name" => $values["name"],
|
||||
":email" => $values["email"],
|
||||
":content" => $values["content"]));
|
||||
} catch (PDOException $e) {
|
||||
new \Blog\Library\ErrorMsg("Fehler beim Schreiben der Daten.", $e);
|
||||
die;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
49
Model/Database.php
Normal file
49
Model/Database.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Blog\Model;
|
||||
|
||||
use PDO;
|
||||
use PDOException;
|
||||
|
||||
abstract class Database {
|
||||
|
||||
/**
|
||||
* Zugangsdaten für die Datenbank
|
||||
*/
|
||||
private $dbName = "pbbfa23ahr_kursapp"; //Datenbankname
|
||||
private $linkName = "mysql.pb.bib.de"; //Datenbank-Server
|
||||
private $user = "pbbfa23ahr"; //Benutzername
|
||||
private $pw = "Gyc5g3Xgqs7d"; //Passwort
|
||||
|
||||
/**
|
||||
* Stellt eine Verbindung zur Datenbank her
|
||||
*
|
||||
* @return PDO Gibt eine Datenbankverbindung zurueck
|
||||
*/
|
||||
public function linkDB() {
|
||||
try {
|
||||
$pdo = new PDO("mysql:dbname=$this->dbName;host=$this->linkName"
|
||||
, $this->user
|
||||
, $this->pw
|
||||
, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
|
||||
return $pdo;
|
||||
} catch (PDOException $e) {
|
||||
new \Blog\Library\ErrorMsg("Verbindung konnte nicht aufgebaut werden.", $e);
|
||||
die;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Zum serverseitigen generieren einer UUID
|
||||
*
|
||||
* @return string Liefert eine UUID
|
||||
*/
|
||||
public function createUUID()
|
||||
{
|
||||
$data = openssl_random_pseudo_bytes(16);
|
||||
$data[6] = chr(ord($data[6]) & 0x0f | 0x40);
|
||||
$data[8] = chr(ord($data[8]) & 0x3f | 0x80);
|
||||
return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
|
||||
}
|
||||
}
|
12
Views/Contact/showConfirmation.phtml
Normal file
12
Views/Contact/showConfirmation.phtml
Normal file
@ -0,0 +1,12 @@
|
||||
<?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'; ?>
|
36
Views/Contact/showContactForm.phtml
Normal file
36
Views/Contact/showContactForm.phtml
Normal file
@ -0,0 +1,36 @@
|
||||
<?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'; ?>
|
11
Views/Error/showErrMsg.phtml
Normal file
11
Views/Error/showErrMsg.phtml
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
include dirname(__DIR__).'/header.phtml';
|
||||
?>
|
||||
|
||||
<h2><?=$error?></h2>
|
||||
<p><?=$debug?></p>
|
||||
|
||||
<?php include dirname(__DIR__).'/footer.phtml'; ?>
|
||||
|
||||
|
||||
|
21
Views/Welcome/showProjects.phtml
Normal file
21
Views/Welcome/showProjects.phtml
Normal file
@ -0,0 +1,21 @@
|
||||
<?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'; ?>
|
21
Views/Welcome/showTutorials.phtml
Normal file
21
Views/Welcome/showTutorials.phtml
Normal file
@ -0,0 +1,21 @@
|
||||
<?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'; ?>
|
23
Views/Welcome/showWelcome.phtml
Normal file
23
Views/Welcome/showWelcome.phtml
Normal file
@ -0,0 +1,23 @@
|
||||
<?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'; ?>
|
||||
|
5
Views/footer.phtml
Normal file
5
Views/footer.phtml
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
25
Views/header.phtml
Normal file
25
Views/header.phtml
Normal file
@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>VR Contact</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" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
<nav>
|
||||
<div id="metanavi">
|
||||
<a href="#">Anmelden</a>
|
||||
</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>
|
30
contact.sql
Normal file
30
contact.sql
Normal file
@ -0,0 +1,30 @@
|
||||
-- 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/controller.jpg
Normal file
BIN
images/controller.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.5 KiB |
BIN
images/gtx-1080-ti.jpg
Normal file
BIN
images/gtx-1080-ti.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 43 KiB |
BIN
images/museum.jpg
Normal file
BIN
images/museum.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 100 KiB |
BIN
images/oculus.jpg
Normal file
BIN
images/oculus.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
BIN
images/oculus_2.jpg
Normal file
BIN
images/oculus_2.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
45
index.php
Normal file
45
index.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
session_start();
|
||||
|
||||
spl_autoload_register(function ($className) {
|
||||
if (substr($className, 0, 5) !== 'Blog\\') {
|
||||
// not our business
|
||||
return;
|
||||
}
|
||||
|
||||
$fileName = __DIR__.'/'.str_replace('\\', DIRECTORY_SEPARATOR, substr($className, 5)).'.php';
|
||||
|
||||
if (file_exists($fileName)) {
|
||||
include $fileName;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$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";
|
||||
} else {
|
||||
$controllerName = isset($_GET['controller']) && $_GET['controller'] ? $_GET['controller'] : "Welcome";
|
||||
$doMethodName = isset($_GET['do']) && $_GET['do'] ? $_GET['do'] : "showWelcome";
|
||||
}
|
||||
|
||||
$controllerClassName = 'Blog\\Controller\\'.ucfirst($controllerName).'Controller';
|
||||
|
||||
if (method_exists($controllerClassName, $doMethodName)) {
|
||||
$view = new \Blog\Library\View(__DIR__.DIRECTORY_SEPARATOR.'Views'
|
||||
, ucfirst($controllerName), $doMethodName);
|
||||
|
||||
$controller = new $controllerClassName($view);
|
||||
$controller->$doMethodName();
|
||||
|
||||
$view->render();
|
||||
|
||||
} else {
|
||||
new \Blog\Library\ErrorMsg('Page not found: '.$controllerClassName.'::'.$doMethodName);
|
||||
}
|
||||
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user