From 9bb8a0a6e06b9c51fe1776e12386cbe57a248855 Mon Sep 17 00:00:00 2001
From: Rhys Nute <nuterd@cardiff.ac.uk>
Date: Wed, 13 Dec 2023 10:43:14 +0000
Subject: [PATCH] updated

---
 .../Organisation/organisationControllers.java |  6 ++
 .../Team5/SmartTowns/business/business.java   |  2 +
 .../resources/templates/business-data.html    | 57 +++++++++----------
 src/main/resources/templates/businesses.html  |  9 +--
 4 files changed, 39 insertions(+), 35 deletions(-)

diff --git a/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java b/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java
index e59108bb..73c7bea7 100644
--- a/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java
+++ b/src/main/java/Team5/SmartTowns/Organisation/organisationControllers.java
@@ -25,6 +25,12 @@ public class organisationControllers {
         ModelAndView modelAndView = new ModelAndView("businesses");
         return modelAndView;
     }
+    @GetMapping("/businessSub")
+    public ModelAndView getBusinessSubPage(){
+        ModelAndView modelAndView = new ModelAndView("business-data");
+        modelAndView.addObject("business", new business());
+        return modelAndView;
+    }
     @Autowired
     private businessRepository businessRepository;
     @PostMapping("/business-data")
diff --git a/src/main/java/Team5/SmartTowns/business/business.java b/src/main/java/Team5/SmartTowns/business/business.java
index 361fda10..4f291feb 100644
--- a/src/main/java/Team5/SmartTowns/business/business.java
+++ b/src/main/java/Team5/SmartTowns/business/business.java
@@ -2,8 +2,10 @@ package Team5.SmartTowns.business;
 
 import lombok.AllArgsConstructor;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 @AllArgsConstructor
+@NoArgsConstructor
 @Data
 public class business {
     private String businessName;
diff --git a/src/main/resources/templates/business-data.html b/src/main/resources/templates/business-data.html
index 97bec483..8e0ead7a 100644
--- a/src/main/resources/templates/business-data.html
+++ b/src/main/resources/templates/business-data.html
@@ -3,42 +3,37 @@
 <head>
     <meta charset="UTF-8">
     <title>Businesses</title>
-    <link rel="stylesheet" th:href="@{css\templatingstyle.css}">
+    <link rel="stylesheet" th:href="@{css/landmarkFormStyle.css}">
+    <link rel="stylesheet" th:href="@{css/templatingstyle.css}">
 </head>
 <header th:insert="~{/towns/Templating.html::header}"></header>
 <body>
 <div id="container1">
     <h2>Enter your Business information</h2>
-    <form action="businesses.php" method="post" id="data">
-        <p>
-            <label for="businessName">Enter your business name</label>
-            <input type="text" name="business_name" id="businessName">
-        </p>
-        <p>
-            <label for="address1">Please enter first line of your address</label>
-            <input type="text" name="address_1" id="address1">
-        </p>
-        <p>
-            <label for="address2">Please enter second line of your address (optional)</label>
-            <input type="text" name="address_2" id="address2">
-        </p>
-        <p>
-            <label for="city">Please enter the City/Town</label>
-            <input type="text" name="city" id="city">
-        </p>
-        <p>
-            <label for="county">Please enter you county (optional)</label>
-            <input type="text" name="county" id="county">
-        </p>
-        <p>
-            <label for="postcode">Please enter your postcode</label>
-            <input type="text" name="post_code" id="postcode">
-        </p>
-        <p>
-            <label for="website">Please enter your website address</label>
-            <input type="url" name="web_site" id="website">
-        </p>
-        <input type="submit" value="Submit Data">
+    <form action="/business-data" id="data" name="data" method="post" th:object="${business}">
+        <br>
+        <label>Enter your business
+            <input type="text" th:field="*{businessName}">
+        </label><br><br>
+        <label>Please enter first line of your address
+            <input type="text" th:field="*{address1}">
+        </label><br><br>
+        <label>Please enter second line of your address (optional)
+            <input type="text" th:field="*{address2}">
+        </label><br><br>
+        <label>Please enter the City/Town
+            <input type="text" th:field="*{city}">
+        </label><br><br>
+        <label>Please enter you county (optional)
+            <input type="text" th:field="*{county}">
+        </label><br><br>
+        <label>Please enter your postcode
+            <input type="text" th:field="*{postcode}">
+        </label><br><br>
+        <label>Please enter your website address
+            <input type="text" th:field="*{website}">
+        </label><br><br>
+        <input type="submit">
     </form>
 </div>
 </body>
diff --git a/src/main/resources/templates/businesses.html b/src/main/resources/templates/businesses.html
index 4dbaef65..7e53bb87 100644
--- a/src/main/resources/templates/businesses.html
+++ b/src/main/resources/templates/businesses.html
@@ -3,19 +3,20 @@
 <head>
     <meta charset="UTF-8">
     <title>Businesses</title>
-    <link rel="stylesheet" th:href="@{css\businessesStyle.css}">
-    <link rel="stylesheet" th:href="@{css\templatingstyle.css}">
+    <link rel="stylesheet" th:href="@{css/landmarkFormStyle.css}">
+    <link rel="stylesheet" th:href="@{css/templatingstyle.css}">
 </head>
 <header th:insert="~{/towns/Templating.html::header}"></header>
 <body>
+<p>A business is an organised establishment in a professional manner in order to achieve your particular aim for owning a business.</p>
 <h3>Future Proof Businesses</h3>
 <h3>Compete with Online Retailers</h3>
 <h3>Drive Footfall to the high street</h3>
 <h3>Increase Sales</h3>
-<ul th:each="business:${business}">
+<ul th:each="business:${businesses}">
     <li th:text="${business}"></li>
 </ul>
-<button><a href="business-data.html" id="business">Businesses please enter here</a></button>
+<button><a href="/businessSub" id="business">Businesses please enter here</a></button>
 </body>
 <footer th:insert="~{/towns/Templating.html::footer}"></footer>
 </html>
\ No newline at end of file
-- 
GitLab