diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -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 diff --git a/.idea/DBWT-Praktika.iml b/.idea/DBWT-Praktika.iml new file mode 100644 index 0000000..c956989 --- /dev/null +++ b/.idea/DBWT-Praktika.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..20be1f8 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml new file mode 100644 index 0000000..e84699f --- /dev/null +++ b/.idea/php.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/M2/Beispiele/Test.php b/M2/Beispiele/Test.php new file mode 100644 index 0000000..58b5e25 --- /dev/null +++ b/M2/Beispiele/Test.php @@ -0,0 +1,21 @@ + + + + + + \ No newline at end of file diff --git a/M2/Beispiele/accesslog.txt b/M2/Beispiele/accesslog.txt new file mode 100644 index 0000000..506be3e --- /dev/null +++ b/M2/Beispiele/accesslog.txt @@ -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 diff --git a/M2/Beispiele/en.txt b/M2/Beispiele/en.txt new file mode 100644 index 0000000..00854a9 --- /dev/null +++ b/M2/Beispiele/en.txt @@ -0,0 +1,4 @@ +Bewertung;Rating +Name;Name +Begründung;Reason +Senden;Send diff --git a/M2/Beispiele/erstesphp.php b/M2/Beispiele/erstesphp.php new file mode 100644 index 0000000..631ef83 --- /dev/null +++ b/M2/Beispiele/erstesphp.php @@ -0,0 +1,3 @@ +"; +phpinfo(); \ No newline at end of file diff --git a/M2/Beispiele/m2_5a_standardparameter.php b/M2/Beispiele/m2_5a_standardparameter.php new file mode 100644 index 0000000..5a0a1a0 --- /dev/null +++ b/M2/Beispiele/m2_5a_standardparameter.php @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/M2/Beispiele/m2_5b_include.php b/M2/Beispiele/m2_5b_include.php new file mode 100644 index 0000000..7d4392e --- /dev/null +++ b/M2/Beispiele/m2_5b_include.php @@ -0,0 +1,13 @@ +"; +echo addieren(50,10)."
"; +echo addieren(-2,3); +?> \ No newline at end of file diff --git a/M2/Beispiele/m2_5c_addform.php b/M2/Beispiele/m2_5c_addform.php new file mode 100644 index 0000000..8ee4a30 --- /dev/null +++ b/M2/Beispiele/m2_5c_addform.php @@ -0,0 +1,53 @@ + + + + + + + Addform + + + +
+ + + + + + + + +
Ergebnis: ".$ergebnis; + } + ?> + + diff --git a/M2/Beispiele/m2_5d_array.php b/M2/Beispiele/m2_5d_array.php new file mode 100644 index 0000000..93a0049 --- /dev/null +++ b/M2/Beispiele/m2_5d_array.php @@ -0,0 +1,67 @@ + ['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 "
    "; + foreach ($famousMeals as $meal){ + echo "
  1. ". $meal['name']."
    "; + if(gettype($meal["winner"])== "array"){ + foreach ($meal["winner"]as $year){ + $dump[] = $year; + } + }else{ + $dump[] = $year; + } + echo implode( ', ', $dump); + $dump = null; + echo "

  2. "; + } + echo "
"; + missingYear($famousMeals); +?> \ No newline at end of file diff --git a/M2/Beispiele/m2_7a_accesslog.php b/M2/Beispiele/m2_7a_accesslog.php new file mode 100644 index 0000000..1c6a952 --- /dev/null +++ b/M2/Beispiele/m2_7a_accesslog.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/M2/Beispiele/m2_7b_showtext.php b/M2/Beispiele/m2_7b_showtext.php new file mode 100644 index 0000000..6c9ad13 --- /dev/null +++ b/M2/Beispiele/m2_7b_showtext.php @@ -0,0 +1,41 @@ + + + + + > + +
\ No newline at end of file diff --git a/M2/Beispiele/meal.php b/M2/Beispiele/meal.php new file mode 100644 index 0000000..bf230b5 --- /dev/null +++ b/M2/Beispiele/meal.php @@ -0,0 +1,206 @@ + '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; +} + +/** + * + */ + +?> + + + + + <?php echo $translation["Gericht"].": ". $meal['name']; ?> + + + +

+

+

+ +

+

+
+ +

+ +

+ +

)

+ +
+ + > + +
+ + + + + + + + + + + + + "; + } + ?> + +
{$rating['text']}{$rating['stars']}{$rating['author']}
+ +
+
+ Deutsch oder English + + diff --git a/M2/Werbeseite/besucher.txt b/M2/Werbeseite/besucher.txt new file mode 100644 index 0000000..9a03714 --- /dev/null +++ b/M2/Werbeseite/besucher.txt @@ -0,0 +1 @@ +10 \ No newline at end of file diff --git a/M2/Werbeseite/fh-logo.jpg b/M2/Werbeseite/fh-logo.jpg new file mode 100644 index 0000000..33cf0b4 Binary files /dev/null and b/M2/Werbeseite/fh-logo.jpg differ diff --git a/M2/Werbeseite/gerichte.php b/M2/Werbeseite/gerichte.php new file mode 100644 index 0000000..826be87 --- /dev/null +++ b/M2/Werbeseite/gerichte.php @@ -0,0 +1,31 @@ + ['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" + ] +] +?> \ No newline at end of file diff --git a/M2/Werbeseite/img/bambus.jpg b/M2/Werbeseite/img/bambus.jpg new file mode 100644 index 0000000..83a2cb5 Binary files /dev/null and b/M2/Werbeseite/img/bambus.jpg differ diff --git a/M2/Werbeseite/img/bolo.jpg b/M2/Werbeseite/img/bolo.jpg new file mode 100644 index 0000000..5fcab51 Binary files /dev/null and b/M2/Werbeseite/img/bolo.jpg differ diff --git a/M2/Werbeseite/img/carbonara.jpg b/M2/Werbeseite/img/carbonara.jpg new file mode 100644 index 0000000..a9c990b Binary files /dev/null and b/M2/Werbeseite/img/carbonara.jpg differ diff --git a/M2/Werbeseite/img/risotto.jpg b/M2/Werbeseite/img/risotto.jpg new file mode 100644 index 0000000..a9ae088 Binary files /dev/null and b/M2/Werbeseite/img/risotto.jpg differ diff --git a/M2/Werbeseite/index.php b/M2/Werbeseite/index.php new file mode 100644 index 0000000..d127a9f --- /dev/null +++ b/M2/Werbeseite/index.php @@ -0,0 +1,226 @@ + + + + + + + + Ihre E-Mensa + + + + +
+
+ FH-Logo +
+
+ Ankündigung + Speisen + Zahlen + Kontakt + Wichtig für uns + +
+
+
+
+
+
+ Essen +

Bald gibt es auch Essen online ;)

+

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.

+

Köstlichkeiten die Sie erwarten

+ + + + + + + + +
GerichtePreis internPreis externBild
".$gericht["name"]."".$gericht["priceint"]."".$gericht["priceex"].".$gericht["; + } + ?> +
+

E-Mensa in Zahlen

+
+

Besuche

+

Y Anmeldungen zum Newsletter

+

Speisen

+
+

Interesse geweckt? Wir informieren

+
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ + + +

Das ist uns wichtig

+
+
    +
  • Beste frische saisonale Zutaten
  • +
  • Ausgewogen abwechslungsreiche Gerichte
  • +
  • Sauberkeit
  • +
+
+

Wir freuen uns auf Ihren Besuch!

+
+
+ + + + \ No newline at end of file diff --git a/M2/Werbeseite/mensa21.jpg b/M2/Werbeseite/mensa21.jpg new file mode 100644 index 0000000..370d0fc Binary files /dev/null and b/M2/Werbeseite/mensa21.jpg differ diff --git a/M2/dossier.xlsx b/M2/dossier.xlsx new file mode 100644 index 0000000..733ba6a Binary files /dev/null and b/M2/dossier.xlsx differ