From c828fdf1d0aea6489633e54407153273d4ef06f5 Mon Sep 17 00:00:00 2001
From: Victoria Badeke <victoria.badeke@mni.thm.de>
Date: Mon, 27 Jan 2025 11:19:59 +0100
Subject: [PATCH] datenbank

---
 userman_all/client/index.html                 | 144 +++++++++++++++++-
 userman_all/client/src/client.ts              |   2 +-
 userman_all/client/stylesheet.css             | 128 ++++++++++++++++
 userman_all/server/doc/index.html             |  20 +--
 userman_all/server/src/server.ts              |   9 +-
 userman_all/server/test/horizon_changers.http |  49 +++---
 6 files changed, 306 insertions(+), 46 deletions(-)

diff --git a/userman_all/client/index.html b/userman_all/client/index.html
index 0f3a684..43138b6 100644
--- a/userman_all/client/index.html
+++ b/userman_all/client/index.html
@@ -237,7 +237,7 @@
                 <li><a onclick="showPage('profil')">Mein Profil</a></li>
                 <li><a href="#">Merkliste</a></li>
                 <li><a href="#">Meine Supportanfragen</a></li>
-                <li><a href="#">Reisebericht schreiben</a></li>
+                <li><a onclick="showPage ('meineReiseberichte')">Meine Reiseberichte </a></li>
                 <div id="logout-form">
                     <li><a  id="logout-button" onclick="showPage('startseite')">Abmelden</a></li>
                 </div>
@@ -262,7 +262,7 @@
                 <div class="trip-info">
                     <h3>Projekt Bausteine der Gesundheit (Peru)</h3>
                     <button class="details-button">Details</button>
-                    <button class="report-button">Reisebericht schreiben</button>
+                    <button class="report-button" onclick="showPage('reiseberichtSchreiben')">Reisebericht schreiben</button>
                 </div>
             </div>
         </section>
@@ -283,7 +283,7 @@
                     <li><a>Mein Profil</a></li>
                     <li><a>Merkliste</a></li>
                     <li><a>Meine Supportanfragen</a></li>
-                    <li><a>Reisebericht schreiben</a></li>
+                    <li><a onclick="showPage ('meineReiseberichte')">Meine Reiseberichte </a></li>
                     <div id="logout-form1">
                         <li><a  id="logout-button1" onclick="showPage('startseite')">Abmelden</a></li>
                     </div>
@@ -589,6 +589,141 @@
 </div>
 
 
+<!--Impressum-->
+<div id="Impressum" class="page">
+    <div class="container-Impressum">
+        <i class="fa-solid fa-circle-arrow-left backButton"></i>
+        <h1>Impressum</h1>
+        <section class="impressum">
+            <h2>Impressum</h2>
+            <br>
+            <h3>Horizon Changers</h3>
+            <p>Musterstraße 123<br>12345 Musterstadt<br>Deutschland</p>
+
+            <h3>Vertreten durch:</h3>
+            <p>Max Mustermann (Geschäftsführer)</p>
+
+            <h3>Kontakt:</h3>
+            <p>
+                Telefon: +49 (0)123 4567890<br>
+                E-Mail: <a href="mailto:info@horizonchangers.de">info@horizonchangers.de</a><br>
+                Web: <a href="http://www.horizonchangers.de" target="_blank">www.horizonchangers.de</a>
+            </p>
+
+            <h3>Registereintrag:</h3>
+            <p>
+                Eingetragen im Handelsregister.<br>
+                Registergericht: Amtsgericht Musterstadt<br>
+                Registernummer: HRB 123456
+            </p>
+
+            <h3>Umsatzsteuer-ID:</h3>
+            <p>DE123456789</p>
+
+            <h3>Verantwortlich für den Inhalt nach § 55 Abs. 2 RStV:</h3>
+            <p>
+                Max Mustermann<br>
+                Musterstraße 123<br>
+                12345 Musterstadt
+            </p>
+
+            <h3>Hinweis auf EU-Streitschlichtung:</h3>
+            <p>
+                Die Europäische Kommission stellt eine Plattform zur Online-Streitbeilegung bereit.
+                <br>
+                <br>
+                Unsere E-Mail-Adresse finden Sie oben im Impressum.
+            </p>
+        </section>
+
+        <section class="datenschutz">
+            <h3>Datenschutz</h3>
+            <p>
+                Sämtliche innerhalb des Internetauftritts verwendeten Texte, Bilder und Grafiken sind geistiges Eigentum und damit urheberrechtlich geschützt. Es besteht weder ein Recht auf Kopie, Download oder Abschrift. Insbesondere besteht kein Recht auf weitere Verwendung, es sei denn, ein Nutzungsrecht hierfür sei ausdrücklich eingeräumt worden.
+                <br>
+                Haftungsausschluss
+                <br>
+                Wir haben den Inhalt unserer Seiten nach bestem Wissen und Gewissen zusammengestellt. Eine Gewähr für die Funktion, Aktualität, Richtigkeit, Vollständigkeit oder Qualität der Informationen unserer Internet-Seiten, der Link-Verweise und insbesondere der Informationen der verwiesenen („verlinkten“) Internetseiten der Drittanbieter (inklusive Rechtmäßigkeit des Inhaltes) kann angesichts der Unentgeltlichkeit aber nicht übernommen werden. Die Rechte an diesen Seiten sowie die Verantwortlichkeit für deren Inhalt liegen ausschließlich beim Drittanbieter.
+            </p>
+        </section>
+    </div>
+</div>
+
+<!--Reisebericht schreiben-->
+<div id="reiseberichtSchreiben" class="page">
+    <aside class="sidebar">
+        <i class="fa-solid fa-circle-arrow-left backButton" onclick="showPage('startseite')"></i>
+        <p class="greeting">Hallo,</p>
+        <nav class="menu">
+            <ul>
+                <li><a onclick="showPage('meineReisen')">Meine Reisen</a></li>
+                <li><a>Mein Profil</a></li>
+                <li><a>Merkliste</a></li>
+                <li><a>Meine Supportanfragen</a></li>
+                <li><a onclick="showPage ('meineReiseberichte')">Meine Reiseberichte </a></li>
+                <div id="logout-form3">
+                    <li><a  id="logout-button3" onclick="showPage('startseite')">Abmelden</a></li>
+                </div>
+            </ul>
+        </nav>
+    </aside>
+    <div class="reiseberichtFormular">
+        <h1>Wie war Deine Reise mit Uns?</h1>
+        <form>
+            <label for="country">Land auswählen</label>
+            <select id="country" name="country">
+                <option value="">-- Bitte wählen --</option>
+                <option value="de">Spanien</option>
+                <option value="fr" >Peru</option>
+                <option value="it">Indien</option>
+                <option value="it">Kenia</option>
+            </select>
+
+            <label for="firstname">Vorname</label>
+            <input type="text" id="firstname" name="firstname" placeholder="Vorname">
+
+            <label for="lastname">Nachname</label>
+            <input type="text" id="lastname" name="lastname" placeholder="Nachname">
+
+            <div class="rating">
+                <span>&#9733;</span>
+                <span>&#9733;</span>
+                <span>&#9733;</span>
+                <span>&#9733;</span>
+                <span>&#9733;</span>
+            </div>
+
+            <label for="feedback">Feedback</label>
+            <textarea id="feedback" name="feedback" placeholder="Schreibe hier dein Feedback..."></textarea>
+
+            <button type="submit" class="reiseberichtAbsenden" onclick="showPage('meineReiseberichte')">Absenden</button>
+
+        </form>
+    </div>
+</div>
+
+
+<!--Meine Reiseberichte-->
+
+<div id="meineReiseberichte" class="page">
+    <aside class="sidebar">
+        <i class="fa-solid fa-circle-arrow-left backButton" onclick="showPage('startseite')"></i>
+        <p class="greeting">Hallo,</p>
+        <nav class="menu">
+            <ul>
+                <li><a onclick="showPage('meineReisen')">Meine Reisen</a></li>
+                <li><a>Mein Profil</a></li>
+                <li><a>Merkliste</a></li>
+                <li><a>Meine Supportanfragen</a></li>
+                <li><a onclick="showPage ('meineReiseberichte')">Meine Reiseberichte </a></li>
+                <div id="logout-form4">
+                    <li><a  id="logout-button4" onclick="showPage('startseite')">Abmelden</a></li>
+                </div>
+            </ul>
+        </nav>
+    </aside>
+</div>
+
 
 <!--Footer-->
 <footer class="footer">
@@ -601,7 +736,7 @@
             <h4>Nützliche Informationen</h4>
             <ul>
                 <li> <a href="#">FAQ</a>
-                    <a href="#">Impressum</a>
+                    <a onclick="showPage('Impressum')">Impressum</a>
                 </li>
             </ul>
         </div>
@@ -628,6 +763,5 @@
     </div>
 </footer>
 
-
 </body>
 </html>
diff --git a/userman_all/client/src/client.ts b/userman_all/client/src/client.ts
index fb9406a..5b8cd42 100644
--- a/userman_all/client/src/client.ts
+++ b/userman_all/client/src/client.ts
@@ -172,7 +172,7 @@ document.addEventListener("DOMContentLoaded", (): void => {
     }
 
     // Update the html
-    readUsers();
+    readUsers(); //sorgt dafür das alle User ausgelesen werden
   });
 
   // edit admin
diff --git a/userman_all/client/stylesheet.css b/userman_all/client/stylesheet.css
index bb646af..dd162c9 100644
--- a/userman_all/client/stylesheet.css
+++ b/userman_all/client/stylesheet.css
@@ -1253,3 +1253,131 @@ h2 {
 .fa-pen:hover {
     opacity: 0.5;
 }
+
+/*Impressum*/
+
+.container-Impressum {
+    max-width: 800px;
+    margin: 20px auto;
+    padding: 20px;
+    background: #fff;
+    border-radius: 8px;
+}
+
+
+h1 {
+    font-family: "Cy Grotesk Wide";
+    font-size: 43px;
+    color: #03355C;
+    margin-bottom: 20px;
+}
+
+h2{
+    font-family: DM Sans, sans-serif, bold;
+    font-size: 26px;
+    color: #03355C;
+    margin-top: 30px;
+    margin-bottom: 10px;
+}
+
+h3 {
+    font-family: DM Sans, sans-serif, bold;
+    font-size: 20px;
+    margin-bottom: 5px;
+    color: #03355C;
+}
+
+p {
+    font-family: DM Sans, sans-serif;
+    font-size: 20px;
+    margin-bottom: 15px;
+}
+
+a {
+    color: #03355C;
+    text-decoration: none;
+}
+
+a:hover {
+    text-decoration: underline;
+}
+
+.datenschutz {
+
+    margin-top: 40px;
+}
+/*Reisebericht schreiben*/
+h1 {
+    font-size: 24px;
+    color: #03355C;
+    margin-bottom: 20px;
+}
+
+form {
+    max-width: 600px;
+    margin: 0 auto;
+    background: #fff;
+    padding: 20px;
+    border-radius: 8px;
+
+}
+
+label {
+    display: block;
+    margin-bottom: 8px;
+    font-weight: bold;
+    color: #03355C;
+}
+
+select,
+input[type="text"],
+textarea,
+input[type="file"] {
+    width: 100%;
+    padding: 10px;
+    margin-bottom: 20px;
+    border: 1px solid #03355C;
+    border-radius: 24px;
+    font-size: 16px;
+}
+
+select {
+    appearance: none;
+    background: #fff;
+    background-image: url('data:image/svg+xml;charset=UTF-8,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23002855" width="24" height="24"%3E%3Cpath d="M7 10l5 5 5-5z"/%3E%3C/svg%3E');
+    background-repeat: no-repeat;
+    background-position: right 10px center;
+    background-size: 16px;
+}
+
+textarea {
+    height: 150px;
+    background-color: #FCF3E4;
+}
+
+.rating {
+    display: flex;
+    gap: 5px;
+    margin-bottom: 20px;
+}
+
+.rating span {
+    font-size: 24px;
+    color: #FB7300;
+    cursor: pointer;
+}
+
+.reiseberichtAbsenden {
+    background-color: #FB7300;
+    color: white;
+    border: none;
+    border-radius: 24px;
+    padding: 10px 20px;
+    font-size: 16px;
+    cursor: pointer;
+    transition: background-color 0.3s;
+}
+
+.reiseberichtAbsenden:hover {
+    background-color: #e36c20;
+}
\ No newline at end of file
diff --git a/userman_all/server/doc/index.html b/userman_all/server/doc/index.html
index 52f0d40..e8a7a9c 100644
--- a/userman_all/server/doc/index.html
+++ b/userman_all/server/doc/index.html
@@ -5,15 +5,15 @@
   <meta name="description" content="horizon changers website">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-  <link href="assets/bootstrap.min.css?v=1737716477426" rel="stylesheet" media="screen">
-  <link href="assets/prism.css?v=1737716477426" rel="stylesheet" />
-  <link href="assets/prism-toolbar.css?v=1737716477426" rel="stylesheet" />
-  <link href="assets/prism-diff-highlight.css?v=1737716477426" rel="stylesheet" />
-  <link href="assets/main.css?v=1737716477426" rel="stylesheet" media="screen, print">
-  <link href="assets/favicon.ico?v=1737716477426" rel="icon" type="image/x-icon">
-  <link href="assets/apple-touch-icon.png?v=1737716477426" rel="apple-touch-icon" sizes="180x180">
-  <link href="assets/favicon-32x32.png?v=1737716477426" rel="icon" type="image/png" sizes="32x32">
-  <link href="assets/favicon-16x16.png?v=1737716477426" rel="icon" type="image/png" sizes="16x16">
+  <link href="assets/bootstrap.min.css?v=1737968153982" rel="stylesheet" media="screen">
+  <link href="assets/prism.css?v=1737968153982" rel="stylesheet" />
+  <link href="assets/prism-toolbar.css?v=1737968153982" rel="stylesheet" />
+  <link href="assets/prism-diff-highlight.css?v=1737968153982" rel="stylesheet" />
+  <link href="assets/main.css?v=1737968153982" rel="stylesheet" media="screen, print">
+  <link href="assets/favicon.ico?v=1737968153982" rel="icon" type="image/x-icon">
+  <link href="assets/apple-touch-icon.png?v=1737968153982" rel="apple-touch-icon" sizes="180x180">
+  <link href="assets/favicon-32x32.png?v=1737968153982" rel="icon" type="image/png" sizes="32x32">
+  <link href="assets/favicon-16x16.png?v=1737968153982" rel="icon" type="image/png" sizes="16x16">
 </head>
 
 <body class="container-fluid">
@@ -1042,6 +1042,6 @@
   </div>
 </div>
 
-<script src="assets/main.bundle.js?v=1737709870186"></script>
+<script src="assets/main.bundle.js?v=1737968153982"></script>
 </body>
 </html>
diff --git a/userman_all/server/src/server.ts b/userman_all/server/src/server.ts
index 8f1e957..ab7ef61 100644
--- a/userman_all/server/src/server.ts
+++ b/userman_all/server/src/server.ts
@@ -38,11 +38,11 @@ connectDatabase();
  * Define and start web-app server, define json-Parser                       *
  *****************************************************************************/
 //Start des Servers
-const app: Express = express();
+const app: Express = express(); //Instanz des Express-Frameworks wird erstellt
 app.listen(8080, () => {
-  console.log('Server started: http://localhost:8080');
+  console.log('Server started: http://localhost:8080'); //Anwendung anweisen, auf Port 8080 neue TCP-Verbindung anzunehmen
 });
-app.use(express.json());
+app.use(express.json()); //body Parser - interpretiert den Request-Body als JSON-String - ohne diese Zeile kann nicht auf req.body zugegriffen werden
 
 /*****************************************************************************
  * session management configuration                                          *
@@ -93,7 +93,7 @@ function isLoggedIn(req: Request, res: Response, next: NextFunction) {
   }
 }
 
-////HTTP-Routen
+//HTTP-Routen
 /*****************************************************************************
  * HTTP ROUTES: LOGIN                                                        *
  *****************************************************************************/
@@ -359,6 +359,7 @@ app.post('/user', async (req: Request, res: Response): Promise<void> => {
         role: userRows[0].role || 'user',
       };
 
+
       // Speichere den Benutzer in der Session
       req.session.user = user;
 
diff --git a/userman_all/server/test/horizon_changers.http b/userman_all/server/test/horizon_changers.http
index 8d73cf0..86e670f 100644
--- a/userman_all/server/test/horizon_changers.http
+++ b/userman_all/server/test/horizon_changers.http
@@ -3,8 +3,8 @@ POST http://localhost:8080/login HTTP/1.1
 Content-Type: application/json
 
 {
-  "eMail": "sabine.faust@gmx.de",
-  "password": "kindi123"
+  "eMail": "jens@badeke.de",
+  "password": "123"
 }
 
 ### Update user
@@ -18,10 +18,10 @@ Content-Type: application/json
   "password": "otto"
 }
 
-### Read User
-GET http://localhost:8080/user/21 HTTP/1.1
+### Read User - User
+GET http://localhost:8080/user/31 HTTP/1.1
 
-### Read User
+### Read User - Fehlerfall User gibt es nicht
 GET http://localhost:8080/user/500 HTTP/1.1
 
 
@@ -30,23 +30,23 @@ POST http://localhost:8080/login HTTP/1.1
 Content-Type: application/json
 
 {
-  "eMail": "lilith@fa.gmx.de",
+  "eMail": "jens@badeke.de",
   "password": "passwort"
 }
 
-### Create a new user
+### Create a new user - Registrieren
 POST http://localhost:8080/user HTTP/1.1
 Content-Type: application/json
 
 {
-  "firstName": "Bruce",
-  "lastName": "Wayne",
-  "eMail": "bat@mail.de",
+  "firstName": "Felix",
+  "lastName": "Blau",
+  "eMail": "felix@blau.de",
   "password": "1234",
   "repeatPassword": "1234"
 }
 
-### Create a new user
+### Create a new user Fehlermeldung Passwort unterschiedlich
 POST http://localhost:8080/user HTTP/1.1
 Content-Type: application/json
 
@@ -58,7 +58,7 @@ Content-Type: application/json
   "repeatPassword": "123456"
 }
 
-### Create a new user
+### Create a new user Fehlermeldung Email fehlt
 POST http://localhost:8080/user HTTP/1.1
 Content-Type: application/json
 
@@ -72,31 +72,28 @@ Content-Type: application/json
 ### Logout
 POST http://localhost:8080/logout HTTP/1.1
 
-### Logout
-POST http://localhost:8080/logout HTTP/1.1
-
 
-### Delete user
+### Delete user Nutzer
 DELETE  http://localhost:8080/user HTTP/1.1
 
 
-####Read Users
+####Read Users Admin
 GET http://localhost:8080/users HTTP/1.1
 
-### Update specific user
-PUT http://localhost:8080/user/10 HTTP/1.1
+### Update specific user Admin
+PUT http://localhost:8080/user/31 HTTP/1.1
 Content-Type: application/json
 
 {
-  "firstName": "Bruce",
-  "lastName": "Kayne",
-  "eMail": "bato",
+  "firstName": "Felix",
+  "lastName": "Blau",
+  "eMail": "felix@blau.de",
   "adress": "Fetzwiesen 4",
   "role": "user"
 }
 
 
-### Update specific user
+### Update specific user - fehlerfall
 PUT http://localhost:8080/user/1 HTTP/1.1
 Content-Type: application/json
 
@@ -105,11 +102,11 @@ Content-Type: application/json
   "familyName": "Kyle"
 }
 
-### Delete specific user
-DELETE  http://localhost:8080/user/7 HTTP/1.1
+### Delete specific user Admin
+DELETE  http://localhost:8080/user/31 HTTP/1.1
 
 
-### Delete specific user
+### Delete specific user admin fehlerfall
 DELETE  http://localhost:8080/user/1 HTTP/1.1
 
 
-- 
GitLab