From 35f736d2085df432c03760c63340f47b79e087d6 Mon Sep 17 00:00:00 2001 From: Rhys Nute <nuterd@cardiff.ac.uk> Date: Sat, 9 Dec 2023 18:43:42 +0000 Subject: [PATCH] Towns database added --- src/main/resources/WorkWith/towns-data.html | 31 +++++++++++++++++++++ src/main/resources/WorkWith/towns.html | 1 + src/main/resources/data.sql | 7 ++++- src/main/resources/schema.sql | 12 ++++++++ 4 files changed, 50 insertions(+), 1 deletion(-) diff --git a/src/main/resources/WorkWith/towns-data.html b/src/main/resources/WorkWith/towns-data.html index 8f27a175..5ed858c6 100644 --- a/src/main/resources/WorkWith/towns-data.html +++ b/src/main/resources/WorkWith/towns-data.html @@ -3,8 +3,39 @@ <head> <meta charset="UTF-8"> <title>Towns</title> + <link rel="stylesheet" href="static/css/templatingstyle.css"> </head> <body> +<div id="container1"> + <h2>Enter your Local authority</h2> + <form action="local-auth-data.php" method="post" id="data"> + <p> + <label for="townName">Enter your town</label> + <input type="text" name="town_Name" id="townName"> + </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> + <input type="submit" value="Submit Data"> + </form> +</div> </body> </html> \ No newline at end of file diff --git a/src/main/resources/WorkWith/towns.html b/src/main/resources/WorkWith/towns.html index 5fa1c03e..71fd80f6 100644 --- a/src/main/resources/WorkWith/towns.html +++ b/src/main/resources/WorkWith/towns.html @@ -11,6 +11,7 @@ <p>Giving local businesses a voice in the community</p> <h1>Empowering Community Spirit</h1> <h1>Creating the towns Identity</h1> +<button id="submit">Towns log in here</button><a href="towns-data.html"></a> </body> <footer th:insert="~{/towns/Templating.html::footer}"></footer> </html> \ No newline at end of file diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql index e40208ba..342be16c 100644 --- a/src/main/resources/data.sql +++ b/src/main/resources/data.sql @@ -54,4 +54,9 @@ insert into badgeprogress (userID, badgeID, progress) value ('2', '2', '70'); delete from stickerprogress; insert into stickerprogress (userID, stickerID, hasSticker) value ('1', '1', true); insert into stickerprogress (userID, stickerID, hasSticker) value ('1', '3', true); -insert into stickerprogress (userID, stickerID, hasSticker) value ('2', '2', true); \ No newline at end of file +insert into stickerprogress (userID, stickerID, hasSticker) value ('2', '2', true); + +delete from townswithtrails +insert into townswithtrails (townName, address1, address2, city, county, postcode) value ('Caerphilly Town', 'Castle Street', '', 'Caerphilly', '', 'CF83 1NU'); +insert into townswithtrails (townName, address1, address2, city, county, postcode) value ('Penarth Town', '1 Windsor Arcade', '', 'Penarth', '', 'CF64 1JA'); +insert into townswithtrails (townName, address1, address2, city, county, postcode) value ('Risca Town', '47 Tredegar Street', 'Pontymister, Risca West', 'Newport', 'Caerphilly County Borough', 'NP11 6BW'); \ No newline at end of file diff --git a/src/main/resources/schema.sql b/src/main/resources/schema.sql index 92b8d4e0..7c2c19d1 100644 --- a/src/main/resources/schema.sql +++ b/src/main/resources/schema.sql @@ -57,4 +57,16 @@ create table if not exists stickerProgress userID bigint, stickerID bigint, hasSticker boolean /*Has sticker or not*/ +) engine=InnoDB; + +drop table if exists townsWithTrails; +create table if not exists townsWithTrails +( + townsWithTrailsID bigint auto_increment primary key, + townName varchar(128), + address1 varchar(128), + address2 varchar(128), + city varchar(128), + county varchar(128), + postcode varchar(15) ) engine=InnoDB; \ No newline at end of file -- GitLab