21 Commits

Author SHA1 Message Date
Robert
72ecc1e836 Final Abgabe 2 2023-11-10 16:27:12 +01:00
Robert
2cbfe5ee61 Final Abgabe 2 2023-11-10 15:21:47 +01:00
Robert
d98acc1ce0 Update 2023-11-10 15:20:26 +01:00
Robert
09d786ea9b Upate 2023-11-10 15:18:31 +01:00
Robert
9382b6375a Merge pull request #2 from S170H/dev/m2_safak
Dev/m2 safak
2023-11-10 15:02:46 +01:00
Robert
17646a1ecd 7 und 9 fertig 2023-11-10 14:58:27 +01:00
S170H
1b5faa0d69 M2 Aufgabe 8 2023-11-10 14:39:20 +01:00
S170H
daa8f95cb7 Merge remote-tracking branch 'origin/m2_Robert' into dev/m2_safak 2023-11-10 13:42:06 +01:00
Robert
59d1540de6 Aufgabe 9 fertig 2023-11-10 01:04:07 +01:00
Robert
217a13bd52 Aufgabe 7 1) fertig 2023-11-07 13:03:30 +01:00
Robert
0c360ccb99 Woche 1 fertig 2023-11-07 01:14:33 +01:00
Robert
d1ee9c1fb9 Bis 6. 3) 2023-11-07 01:02:40 +01:00
S170H
8b4c4c1c7f M2 1 2023-11-06 22:37:19 +01:00
Robert
f1831cc58d Anfang von 6 2. 2023-11-06 16:54:20 +01:00
Robert
b8c27e90ea Aufgabe 5 fertig 2023-11-06 16:44:01 +01:00
Robert
2539383e67 Edit Matrikel nummer bis 5 c) 2023-11-05 23:30:46 +01:00
Robert
fddeba1ce8 Bis 5c) 2023-11-05 23:25:53 +01:00
Robert
7d4ec262a5 Aufgabe 3 komplett 2023-11-05 21:45:35 +01:00
Robert
fc22cd51df Bis 3i) 2023-11-05 17:17:58 +01:00
Robert
c7e17faeaf Bis 3 d) 2023-10-31 17:11:44 +01:00
Robert
48cca528a8 Bis Aufgabe 3 1. 2023-10-31 14:39:05 +01:00
32 changed files with 838 additions and 10 deletions

8
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

8
.idea/DBWT-Praktika.iml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

8
.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/DBWT-Praktika.iml" filepath="$PROJECT_DIR$/.idea/DBWT-Praktika.iml" />
</modules>
</component>
</project>

20
.idea/php.xml generated Normal file
View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MessDetectorOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PHPCSFixerOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PHPCodeSnifferOptionsConfiguration">
<option name="highlightLevel" value="WARNING" />
<option name="transferred" value="true" />
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="8.2" />
<component name="PhpStanOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PsalmOptionsConfiguration">
<option name="transferred" value="true" />
</component>
</project>

6
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

1
M2/.idea/php.xml generated
View File

@@ -10,6 +10,7 @@
<option name="highlightLevel" value="WARNING" />
<option name="transferred" value="true" />
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="8.0" />
<component name="PhpStanOptionsConfiguration">
<option name="transferred" value="true" />
</component>

21
M2/Beispiele/Test.php Normal file
View File

@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<body>
<?php
$anweisung = 3;
switch ($anweisung) {
case 1:
echo "catch _1_ !";
break;
case 2:
echo "catch _2_ !";
break;
case 3:
echo "catch _3_ !";
default:
echo "nothing to catch!";
break;
}
?>
</body>
</html>

View File

@@ -0,0 +1 @@
07.11.2023 - 13:02 | 127.0.0.1 | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0

4
M2/Beispiele/en.txt Normal file
View File

@@ -0,0 +1,4 @@
Bewertung;Rating
Name;Name
Begründung;Reason
Senden;Send

View File

@@ -0,0 +1,3 @@
<?php
echo "Erstes PHP-Skript <br>";
phpinfo();

View File

@@ -0,0 +1,12 @@
<?php
/**
* Praktikum DBWT. Autoren:
* Şafak, Hazinedar, 3108590
* Robert, Joel, 3672729
*/
function addieren(int $number1,int $number2=0){
return $number1+$number2;
}
?>

View File

@@ -0,0 +1,13 @@
<?php
/**
* Praktikum DBWT. Autoren:
* Şafak, Hazinedar, 3108590
* Robert, Joel, 3672729
*/
include "m2_5a_standardparameter.php";
echo addieren(2,3)."<br>";
echo addieren(50,10)."<br>";
echo addieren(-2,3);
?>

View File

@@ -0,0 +1,53 @@
<?php
/**
* Praktikum DBWT. Autoren:
* Şafak, Hazinedar, 3108590
* Robert, Joel, 3672729
*/
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if ($_POST['rechnen'] == 'Addieren') {
$number1 = $_POST['number1'];
$number2 = $_POST['number2'];
$ergebnis = $number1 + $number2;
} elseif ($_POST['rechnen'] == "Multiplizieren") {
$number1 = $_POST['number1'];
$number2 = $_POST['number2'];
$ergebnis = $number1 * $number2;
}
}
?>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8"/>
<title>Addform</title>
<style>
* {
font-family: Arial, serif;
}
.rating {
color: darkgray;
}
</style>
</head>
<body>
<form action="m2_5c_addform.php" method="post">
<label for="number1">Erste Zahl:</label>
<input id="number1" type="text" name="number1"/>
<label for="number2">Zweite Zahl:</label>
<input id="number2" type="text" name="number2"/>
<input type="Submit" name="rechnen" value="Addieren" />
<input type="Submit" name="rechnen" value="Multiplizieren" />
<?php
if(!empty($ergebnis))
{
echo "<br><br>Ergebnis: ".$ergebnis;
}
?>
</body>
</html>

View File

@@ -0,0 +1,67 @@
<?php
/**
* Praktikum DBWT. Autoren:
* Şafak, Hazinedar, 3108590
* Robert, Joel, 3672729
*/
function missingYear($famousMeals){
$years = [];
$winneryears = [];
$ergebniss = [];
for ($i = 0;$i <= 23; $i++){
$years[] = 2000+$i;
}
foreach ($famousMeals as $meal){
if(gettype($meal["winner"])== "array"){
foreach ($meal["winner"]as $year){
$winneryears[] = $year;
}
}else{
$winneryears[] = $year;
}
}
foreach ($years as $year){
$a=0;
foreach ($winneryears as $winners){
if ($year == $winners){
$a = 1;
break;
}
}
if($a==0){
$ergebniss[]=$year;
}
}
echo var_dump($ergebniss);
}
$famousMeals = [
1 => ['name' => 'Currywurst mit Pommes',
'winner' => [2001, 2003, 2007, 2010, 2020]],
2 => ['name' => 'Hähnchencrossies mit Paprikareis',
'winner' => [2002, 2004, 2008]],
3 => ['name' => 'Spaghetti Bolognese',
'winner' => [2011, 2012, 2017]],
4 => ['name' => 'Jägerschnitzel mit Pommes',
'winner' => 2019]
];
echo "<ol>";
foreach ($famousMeals as $meal){
echo "<li>". $meal['name']."<br>";
if(gettype($meal["winner"])== "array"){
foreach ($meal["winner"]as $year){
$dump[] = $year;
}
}else{
$dump[] = $year;
}
echo implode( ', ', $dump);
$dump = null;
echo "</li><br>";
}
echo "</ol>";
missingYear($famousMeals);
?>

View File

@@ -0,0 +1,16 @@
<?php
/**
* Praktikum DBWT. Autoren:
* Şafak, Hazinedar, 3108590
* Robert, Joel, 3672729
*/
$ip = $_SERVER['REMOTE_ADDR'];
$agent = $_SERVER['HTTP_USER_AGENT'];
$logFile = fopen("accesslog.txt", "a");
$time = time();
$datum = date("d.m.Y - H:i", $time);
$write = $datum." | ".$ip." | ".$agent."\n";
fwrite($logFile, $write);
?>

View File

@@ -0,0 +1,46 @@
<?php
/**
* Praktikum DBWT. Autoren:
* Şafak, Hazinedar, 3108590
* Robert, Joel, 3672729
*/
const GET_PARAM_SEARCH_TEXT = 'search_text';
$searchTerm = "";
if (!empty($_GET[GET_PARAM_SEARCH_TEXT])) {
$searchTerm = $_GET[GET_PARAM_SEARCH_TEXT];
}
$enFile = fopen("en.txt", "r");
$fileLines = [];
while ($line = fgets($enFile)) {
$fileLines[] = $line;
}
$found = false;
foreach ($fileLines as $line){
$lineArray[] = explode(';', $line);
$deutsch = $lineArray[0][0];
if(strtolower($deutsch)==strtolower($searchTerm)){
$found = true;
echo $searchTerm." bedeutet ".$lineArray[0][1];
}
unset($lineArray);
}
if(!$found){
if(!empty($searchTerm)){
echo "Das gesuchte Wort ".$searchTerm." ist nicht enthalten";
}
}
?>
<form method="get">
<label for="search_text">Suche:</label>
<input id="search_text" type="text" name="search_text" value=<?php echo $searchTerm?>>
<input type="submit" value="Suchen">
</form>

206
M2/Beispiele/meal.php Normal file
View File

@@ -0,0 +1,206 @@
<?php
const GET_PARAM_MIN_STARS = 'search_min_stars';
const GET_PARAM_SEARCH_TEXT = 'search_text';
const GET_PARAM_SHOW_DESCRIPTION = 'show_description';
const GET_PARAM_SPRACHE = 'sprache';
const GET_PARAM_TOP_FLOPP = 'top_flopp';
/**
* List of all allergens.
*/
$allergens = [
11 => 'Gluten',
12 => 'Krebstiere',
13 => 'Eier',
14 => 'Fisch',
17 => 'Milch'
];
$meal = [
'name' => 'Süßkartoffeltaschen mit Frischkäse und Kräutern gefüllt',
'description' => 'Die Süßkartoffeln werden vorsichtig aufgeschnitten und der Frischkäse eingefüllt.',
'price_intern' => 2.90,
'price_extern' => 3.90,
'allergens' => [11, 13],
'amount' => 42 // Number of available meals
];
$ratings = [
[ 'text' => 'Die Kartoffel ist einfach klasse. Nur die Fischstäbchen schmecken nach Käse. ',
'author' => 'Ute U.',
'stars' => 2 ],
[ 'text' => 'Sehr gut. Immer wieder gerne',
'author' => 'Gustav G.',
'stars' => 4 ],
[ 'text' => 'Der Klassiker für den Wochenstart. Frisch wie immer',
'author' => 'Renate R.',
'stars' => 4 ],
[ 'text' => 'Kartoffel ist gut. Das Grüne ist mir suspekt.',
'author' => 'Marta M.',
'stars' => 3 ]
];
$dic = [
[ "Gericht" => "Gericht",
"Allergien" => "Allergien",
"Bewertungen" => "Bewertungen (Insgesamt: ",
"Text" => "Text",
"Sterne" => "Sterne",
"Author" => "Author",
"Preis" => "Preis",
"Gaeste" => "Gäste"
],
[ "Gericht" => "Meal",
"Allergien" => "Allergies",
"Bewertungen" => "Review (overall: ",
"Text" => "Text",
"Sterne" => "Stars",
"Author" => "Author",
"Preis" => "Price",
"Gaeste" => "Guests"
]
];
$translation = $dic[0];
$language = "de";
if (!empty($_GET[GET_PARAM_SPRACHE])){
$language = $_GET[GET_PARAM_SPRACHE];
}
if($language == "en"){$translation = $dic[1];}
if (empty($_GET[GET_PARAM_SHOW_DESCRIPTION])){
$meal['description'] = "";
}
$searchTerm = "";
$showRatings = [];
if (!empty($_GET[GET_PARAM_SEARCH_TEXT])) {
$searchTerm = $_GET[GET_PARAM_SEARCH_TEXT];
foreach ($ratings as $rating) {
if (strpos(strtolower($rating['text']), strtolower($searchTerm) )!== false) {
$showRatings[] = $rating;
}
}
} else if (!empty($_GET[GET_PARAM_MIN_STARS])) {
$minStars = $_GET[GET_PARAM_MIN_STARS];
foreach ($ratings as $rating) {
if ($rating['stars'] >= $minStars) {
$showRatings[] = $rating;
}
}
} else {
$showRatings = $ratings;
}
if (!empty($_GET[GET_PARAM_TOP_FLOPP])){
$flopp = $_GET[GET_PARAM_TOP_FLOPP];
if($flopp == "flopp"){
unset($showRatings);
$showRatings=[];
$stars=[];
foreach ($ratings as $rating) {
$stars[] = $rating["stars"];
}
$min = min($stars);
foreach ($ratings as $rating) {
if ($rating['stars'] == $min) {
$showRatings[] = $rating;
}
}
}
elseif ($flopp == "top"){
unset($showRatings);
$showRatings=[];
$stars=[];
foreach ($ratings as $rating) {
$stars[] = $rating["stars"];
}
$min = max($stars);
foreach ($ratings as $rating) {
if ($rating['stars'] == $min) {
$showRatings[] = $rating;
}
}
}
}
/**
*:float gibt den return value der Funktion an
*/
function calcMeanStars (array $ratings) : float {
$sum = 0;
foreach ($ratings as $rating) {
$sum += $rating['stars'] / count($ratings);
}
return $sum;
}
/**
*
*/
?>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8"/>
<title><?php echo $translation["Gericht"].": ". $meal['name']; ?></title>
<style>
* {
font-family: Arial, serif;
}
.rating {
color: darkgray;
}
</style>
</head>
<body>
<h1><?php echo $translation["Gericht"].": ". $meal['name']; ?></h1>
<p><?php echo $meal['description']; ?>
</p>
<h4><?php echo $translation["Preis"].":"?></h4>
<p>
<?php echo $translation["Preis"]." intern: ".$meal["price_intern"]."€";?> <br>
<?php echo $translation["Preis"]." ".$translation["Gaeste"].": ".$meal["price_extern"]."€";?>
</p>
<h4><?php echo $translation["Allergien"].":"?> </h4>
<ul>
<?php
foreach ($meal['allergens'] as $all) {
echo "<li>$allergens[$all]</li>";
}
?>
</ul>
<h1><?php echo $translation["Bewertungen"].calcMeanStars($ratings); ?>)</h1>
<!--Such form in den Bewertungen für den User -->
<form method="get">
<label for="search_text">Filter:</label>
<input id="search_text" type="text" name="search_text" value=<?php echo $searchTerm?>>
<input type="submit" value="Suchen">
</form>
<table class="rating">
<thead>
<tr>
<td><?php echo $translation["Text"]?></td>
<td><?php echo $translation["Sterne"]?></td>
<td><?php echo $translation["Author"]?></td>
</tr>
</thead>
<tbody>
<?php
foreach ($showRatings as $rating) {
echo "<tr><td class='rating_text'>{$rating['text']}</td>
<td class='rating_stars'>{$rating['stars']}</td>
<td class='rating_author'>{$rating['author']}</td>
</tr>";
}
?>
</tbody>
</table>
<br>
<br>
<a href="?sprache=de">Deutsch</a> oder <a href="?sprache=en">English</a>
</body>
</html>

BIN
M2/M2.pdf Normal file

Binary file not shown.

View File

@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
Test
</body>
</html>

View File

@@ -0,0 +1 @@
64

BIN
M2/Werbeseite/fh-logo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

View File

@@ -0,0 +1,31 @@
<?php
/**
* Praktikum DBWT. Autoren:
* Şafak, Hazinedar, 3108590
* Robert, Joel, 3672729
*/
$gerichte = [
1 => ['name' => 'Rindfleich mit Bambus, Kaiserschoten und roter Paprika, dazu Mie Nudeln',
'priceint' => 3.50,
"priceex" => 6.20,
"img" =>"img/bambus.jpg"
],
2 => ['name' => 'Spinatrisotto mit kleinen Samosateigecken und gemischter Salat',
'priceint' => 2.90,
"priceex" => 5.30,
"img" =>"img/risotto.jpg"
],
3 => ['name' => 'Spaghetti Bolognese',
'priceint' => 3,
"priceex" => 5,
"img" =>"img/bolo.jpg"
],
4 => ['name' => 'Spaghetti Carbonara',
'priceint' => 3,
"priceex" => 5,
"img" =>"img/carbonara.jpg"
]
]
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

BIN
M2/Werbeseite/img/bolo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

308
M2/Werbeseite/index.php Normal file
View File

@@ -0,0 +1,308 @@
<?php
/**
* Praktikum DBWT. Autoren:
* Şafak, Hazinedar, 3108590
* Robert, Joel, 3672729
*/
include "gerichte.php";
$besucherCount = 0;
$newletterCount = 0;
//Besucher counter
if (file_exists("besucher.txt")) {
$besucherFile = fopen("besucher.txt", "r");
$besucherCount = fgets($besucherFile) + 1;
fclose($besucherFile);
$besucherFile = fopen("besucher.txt", "w");
fwrite($besucherFile, $besucherCount);
fclose($besucherFile);
} else {
$besucherFile = fopen("besucher.txt", "w");
fwrite($besucherFile, 1);
fclose($besucherFile);
}
//Newletter counter
if (file_exists("newletter.txt")) {
$newsFile = fopen("newletter.txt", "r");
$newletterCount = fgets($newsFile);
fclose($newsFile);
} else {
$newsFile = fopen("newletter.txt", "w");
fwrite($newsFile, 0);
fclose($newsFile);
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$name = $_POST['name'];
$email = $_POST['email'];
$language = $_POST['language'];
$terms = $_POST['terms'];
$errors = array();
if (empty(trim($name))) {
$errors[] = "Bitte geben Sie einen Namen ein.";
}
if (!isset($terms)) {
$errors[] = "Bitte stimmen Sie den Datenschutzbestimmungen zu.";
}
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$errors[] = "Bitte geben Sie eine gültige E-Mail-Adresse ein.";
}
$spam_domains = array("rcpt.at", "damnthespam.at", "wegwerfmail.de", "trashmail");
foreach ($spam_domains as $domain) {
if (str_contains($email, $domain)) {
$errors[] = "Bitte geben Sie eine gültige E-Mail-Adresse ein, keine Wegwerf- oder Spam-E-Mail-Adresse.";
break;
}
}
if (empty($errors)) {
$data = array(
"name" => $name,
"email" => $email,
"language" => $language,
"terms" => $terms
);
$file = "subscriptions.json";
$current_data = file_exists($file) ? json_decode(file_get_contents($file), true) : array();
$current_data[] = $data;
if (file_put_contents($file, json_encode($current_data))) {
echo '<script type="text/javascript">';
echo 'alert("Vielen Dank für Ihre Anmeldung zum Newsletter.");';
echo '</script>';
//Newsletter counter
$newletterCount++;
$newsFile = fopen("newletter.txt", "w");
fwrite($newsFile, $newletterCount);
fclose($newsFile);
} else {
echo '<script type="text/javascript">';
echo 'alert("Es gab einen Fehler bei Ihrer Anmeldung. Bitte versuchen Sie es erneut.");';
echo '</script>';
}
} else {
$error_string = "";
foreach ($errors as $error) {
$error_string .= $error . '\n';
}
echo '<script type="text/javascript">';
echo 'alert("' . $error_string . '");';
echo '</script>';
}
}
?>
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
<meta charset="UTF-8">
<title>Ihre E-Mensa</title>
<style>
* {
font-family: Arial;
}
.grid {
display: grid;
grid-template-columns: 200px auto 200px;
}
img {
width: 100%;
height: auto;
}
.speisen {
border: solid;
border-collapse: collapse;
}
.speisen td {
border: solid;
border-collapse: collapse;
border-radius: 4px;
padding: 5px;
width: 150px;
}
.speisen td:not(:first-of-type) {
text-align: center;
}
p {
text-align: justify;
}
.zahlen {
list-style-type: none;
display: grid;
grid-template-columns: auto auto auto;
gap: 10px;
}
.zahlen p {
text-align: center;
font-weight: bold;
}
.formular {
display: grid;
grid-template-columns: auto auto auto;
justify-content: start;
gap: 10px;
}
.wichtig {
text-align: center;
}
.wichtigListe {
display: inline-block;
text-align: left;
}
.freude {
text-align: center;
}
footer {
border-top: 1px solid;
}
.fusszeile {
padding-top: 20px;
padding-bottom: 20px;
margin-left: auto;
margin-right: auto;
border: none;
}
.fusszeile td:first-child {
border-left: none;
padding-left: 20px;
padding-right: 20px;
}
.fusszeile td {
border-left: 3px solid;
padding-left: 20px;
padding-right: 20px;
}
</style>
</head>
<body>
<div class="grid">
<div>
<img src="fh-logo.jpg" alt="FH-Logo">
</div>
<div>
<a href="#ankündigung">Ankündigung</a>
<a href="#speisen">Speisen</a>
<a href="#zahlen">Zahlen</a>
<a href="#kontakt">Kontakt</a>
<a href="#wichtig">Wichtig für uns</a>
</div>
</div>
<hr>
<div class="grid">
<div></div>
<div>
<img src="mensa21.jpg" alt="Essen">
<h1 id="ankündigung">Bald gibt es auch Essen online ;)</h1>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et
dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet,
consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no
sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
<h1 id="speisen">Köstlichkeiten die Sie erwarten</h1>
<table class="speisen">
<tr class="speisen">
<td>Gerichte</td>
<td>Preis intern</td>
<td>Preis extern</td>
<td>Bild</td>
</tr>
<?php
/**
* Speisekarte
*/
foreach ($gerichte as $gericht) {
echo "<tr class=\"speisen\"><td>" . $gericht["name"] . "</td><td>" . $gericht["priceint"] . "</td><td>" . $gericht["priceex"] . "</td><td><img src=" . $gericht["img"] . " alt=" . $gericht["name"] . ">";
}
?>
</table>
<h1 id="zahlen">E-Mensa in Zahlen</h1>
<div class="zahlen">
<p><?php echo $besucherCount; ?> Besuche</p>
<p><?php echo $newletterCount; ?> Anmeldungen zum Newsletter</p>
<p><?php echo count($gerichte); ?> Speisen</p>
</div>
<h1 id="kontakt">Interesse geweckt? Wir informieren</h1>
<form method="post">
<div class="formular">
<div>
<label for="name">Name:</label> <br>
<input type="text" name="name" id="name" placeholder="Bitte geben Sie Ihren Namen ein">
</div>
<div>
<label for="email">E-Mail:</label> <br>
<input type="email" name="email" id="email" placeholder="Bitte geben Sie Ihre E-Mail ein">
</div>
<div>
<label for="language">Newsletter bitte in:</label> <br>
<select name="language" id="language">
<option value="deutsch">Deutsch</option>
<option value="englisch">Englisch</option>
</select>
</div>
</div>
<br>
<input required type="checkbox" name="terms" id="terms">
<label for="terms">Den Datenschutzbestimmungen stimme ich zu</label>
<button type="submit">Zum Newsletter anmelden</button>
</form>
<h1 id="wichtig">Das ist uns wichtig</h1>
<div class="wichtig">
<ul class="wichtigListe">
<li>Beste frische saisonale Zutaten</li>
<li>Ausgewogen abwechslungsreiche Gerichte</li>
<li>Sauberkeit</li>
</ul>
</div>
<h1 class="freude">Wir freuen uns auf Ihren Besuch!</h1>
</div>
</div>
<footer>
<table class="fusszeile">
<tr>
<td>(c) E-Mensa GmbH</td>
<td>Şafak Hazinedar & Robert Joel</td>
<td><a href="">Impressum</a></td>
</tr>
</table>
</footer>
</body>
</html>

BIN
M2/Werbeseite/mensa21.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

View File

@@ -0,0 +1 @@
1

View File

@@ -0,0 +1 @@
[{"name":"Max","email":"max@gmail.com","language":"deutsch","terms":"on"},{"name":"Max","email":"max@gmail.com","language":"deutsch","terms":"on"},{"name":"Max","email":"max@gmail.com","language":"deutsch","terms":"on"},{"name":"Max","email":"max@gmail.com","language":"deutsch","terms":"on"},{"name":"Ro","email":"robert-joel@web.de","language":"deutsch","terms":"on"},{"name":"Robert","email":"robert-joel@web.de","language":"deutsch","terms":"on"}]

View File

@@ -0,0 +1,3 @@
<?php
echo "Erstes PHP-Skript <br>";
phpinfo();

BIN
M2/dossier M2.xlsx Normal file

Binary file not shown.