Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tulln an der Donau #2

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions .idea/watcherTasks.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/webt-core-views-in-mvc.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions DemoTemplate/hotelpage.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="../node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet" href="../css/styles.css">
<title>Find your Hotel</title>
</head>
<body>
<h1>Find your hotel: Die besten Hotels in Österreich</h1>
<div class="hotelContainer">
<div class="hotel">
<h2>hotel_name_1</h2>
<p>hotel_description_1</p>
<p>hotel_address_1</p>
</div>
<div class="hotel">
<h2>hotel_name_2</h2>
<p>hotel_description_2</p>
<p>hotel_address_2</p>
</div>
<div class="hotel">
<h2>hotel_name_3</h2>
<p>hotel_description_3</p>
<p>hotel_address_3</p>
</div>
</div>
</body>
</html>

37 changes: 37 additions & 0 deletions DemoTemplate/templateEngineHotel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

$hotel_data_1 = array(
"name" => "Sonnenscheinhotel",
"description" => "Genieße einen herrlichen Aufenthalt am Neusiedlersee",
"address" => "Neusiedlersee 1, 0000"
);

$hotel_data_2 = array(
"name" => "Hotel an der grünen Neune",
"description" => "Schönes 4 Sterne Hotel in Wien",
"address" => "Rennweg 1, 1030 Wien"
);

$hotel_data_3 = array(
"name" => "Hotel Wien Pur",
"description" => "Mitten in der Innenstadt, in der Nähe des Stephandoms, befindet sich dieses schöne Hotel",
"address" => "Stephansplatz 99, 1010 Wien"
);


$hotelTemplate = file_get_contents("hotelpage.html");

$hotelTemplate = str_replace('hotel_name_1', $hotel_data_1['name'], $hotelTemplate);
$hotelTemplate = str_replace('hotel_description_1', $hotel_data_1['description'], $hotelTemplate);
$hotelTemplate = str_replace('hotel_address_1', $hotel_data_1['address'], $hotelTemplate);

$hotelTemplate = str_replace('hotel_name_2', $hotel_data_2['name'], $hotelTemplate);
$hotelTemplate = str_replace('hotel_description_2', $hotel_data_2['description'], $hotelTemplate);
$hotelTemplate = str_replace('hotel_address_2', $hotel_data_2['address'], $hotelTemplate);

$hotelTemplate = str_replace('hotel_name_3', $hotel_data_3['name'], $hotelTemplate);
$hotelTemplate = str_replace('hotel_description_3', $hotel_data_3['description'], $hotelTemplate);
$hotelTemplate = str_replace('hotel_address_3', $hotel_data_3['address'], $hotelTemplate);


echo $hotelTemplate;
38 changes: 38 additions & 0 deletions HotelTemplate/Hotel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

class Hotel {
private string $name;
private string $description;
private string $address;

/**
* @param string $name
* @param string $description
* @param string $address
*/
public function __construct(string $name, string $description, string $address, string $src)
{
$this->name = $name;
$this->description = $description;
$this->address = $address;
}


public function getName(): string
{
return $this->name;
}


public function getDescription(): string
{
return $this->description;
}


public function getAddress(): string
{
return $this->address;
}

}
6 changes: 6 additions & 0 deletions HotelTemplate/hotelTemplate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="hotel">
<h2>{name}</h2>
<img src="{src}" alt="">
<p>{description}</p>
<p>{address}</p>
</div>
17 changes: 17 additions & 0 deletions HotelTemplate/hotelpageTemplate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="/node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet" href="/css/styles.css">
<title>Find your Hotel</title>
</head>
<body>
<h1>Find your hotel: Die besten Hotels in Österreich</h1>
<div class="hotelContainer">
{placeholder}
</div>
</body>
</html>

22 changes: 22 additions & 0 deletions HotelTemplate/updatedEngine.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

require_once 'Hotel.php';

$hotel1 = new Hotel('Sonnenscheinhotel', 'Genieße einen herrlichen Aufenthalt am Neusiedlersee', 'Neusiedlersee 1, 0000');
$hotel2 = new Hotel('Internat der Golf-HAK für Richkids', 'Im Südburgenland ist alles besser', 'Südlich vom Sieggrabener sattel 5, 0000');


$hotels = array($hotel1, $hotel2);
$engineParam = "";

foreach ($hotels as $hotel) {
$engineParam .= file_get_contents("hotelTemplate.html");
$engineParam = str_replace('{name}', $hotel->getName(), $engineParam);
$engineParam = str_replace('{description}', $hotel->getDescription(), $engineParam);
$engineParam = str_replace('{address}', $hotel->getAddress(), $engineParam);
}

$hotelTemplate = file_get_contents("hotelpageTemplate.html");
$hotelTemplate = str_replace('{placeholder}', $engineParam, $hotelTemplate);

echo $hotelTemplate;
86 changes: 86 additions & 0 deletions css/styles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions css/styles.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions hotelpageDemo/hotelpage.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="/node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet" href="/css/styles.css">
<title>Find your Hotel</title>
</head>
<body>
<h1>Find your hotel: Die besten Hotels in Österreich</h1>
<div class="hotelContainer">
<div class="hotel">
<h2>Sonnenscheinhotel</h2>
<p>Genieße einen herrlichen Aufenthalt am Neusiedlersee</p>
<p>Addresse: Neusiedlersee 1, 0000</p>
</div>
<div class="hotel">
<h2>Hotel an der grünen Neune</h2>
<p>Schönes 4 Sterne Hotel in Wien</p>
<p>Addresse: Rennweg 1, 1030 Wien</p>
</div>
<div class="hotel">
<h2>Hotel am Stadtrand</h2>
<p>In der Nähe des Wiener Waldes befindet sich dieses 3 Sterne Hotel, Ruhe und Entspannung garantiert!</p>
<p>Addresse: Wienerwald 2, 1140 Wien</p>
</div>
</div>
</body>
</html>
Loading