Skip to content
Snippets Groups Projects
Commit aa9d0003 authored by Connor Brock's avatar Connor Brock
Browse files

Merge remote-tracking branch 'origin/main' into...

Merge remote-tracking branch 'origin/main' into 81-as-a-child-i-want-a-very-flashy-and-modern-looking-webpage-that-will-draw-me-in-and-keep-me

# Conflicts:
#	src/main/resources/schema.sql
#	src/test/java/Team5/SmartTownsOld/DataSourceConfig.java
#	src/test/java/Team5/SmartTownsOld/DataSourceConfigahhhh.java
parents 0061869c 97b7a1dc
No related branches found
No related tags found
1 merge request!43Resolve "As a child, I want a very flashy and modern looking webpage that will draw me in and keep me entertained while following the dragons tale trail."
Showing
with 521 additions and 426 deletions
package Team5.SmartTowns.Organisation;
import Team5.SmartTowns.business.Business;
import Team5.SmartTowns.business.BusinessRepository;
import Team5.SmartTowns.localauthority.LocalAuthority;
import Team5.SmartTowns.localauthority.LocalAuthorityRepository;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.stereotype.Controller;
import java.util.List;
@Controller
public class OrganisationControllers {
@Autowired
private LocalAuthorityRepository localAuthorityRepository;
@Autowired
private BusinessRepository businessRepository;
@GetMapping("/local-authorities")
public ModelAndView getLocalAuthoritiesPage(){
ModelAndView mav = new ModelAndView("local-authorities");
List<LocalAuthority> localAuthority = localAuthorityRepository.getAllLocalAuthority();
mav.addObject("localAuth", localAuthority);
return mav;
}
@GetMapping("/localForm")
public ModelAndView getLocalAuthForm(){
ModelAndView modelAndView = new ModelAndView("local-auth-data");
modelAndView.addObject("localAuthority",new LocalAuthority());
return modelAndView;
}
@GetMapping("/businesses")
public ModelAndView getBusinessPage() {
ModelAndView modelAndView = new ModelAndView("businesses");
List<Business> business = businessRepository.getAllBusinesses();
modelAndView.addObject("busiSub", business);
return modelAndView;
}
@GetMapping("/businessSub")
public ModelAndView getBusinessSubPage() {
ModelAndView modelAndView = new ModelAndView("business-data");
modelAndView.addObject("business", new Business());
return modelAndView;
}
@PostMapping("/local-authorities")
public ModelAndView localAuthoritySent(@Valid @ModelAttribute("local-auth-data") LocalAuthority localAuthority, BindingResult bindingResult, Model model) {
ModelAndView modelAndView = new ModelAndView("local-authorities");
if (bindingResult.hasErrors()) {
LocalAuthority loc = new LocalAuthority(localAuthority.getLocalAuthorityName(), localAuthority.getAddress1(), localAuthority.getAddress2(), localAuthority.getCity(), localAuthority.getCounty(), localAuthority.getPostcode(), localAuthority.getWebsite());
System.out.println(loc);
localAuthorityRepository.addLocalAuthority(loc); //add local authority to local authority table
List<LocalAuthority> localAuthorities = localAuthorityRepository.getAllLocalAuthority();
modelAndView.addObject("localAuth", localAuthorities);
} else {
LocalAuthority loc = new LocalAuthority(localAuthority.getLocalAuthorityName(), localAuthority.getAddress1(), localAuthority.getAddress2(), localAuthority.getCity(), localAuthority.getCounty(), localAuthority.getPostcode(), localAuthority.getWebsite());
System.out.println(loc);
localAuthorityRepository.addLocalAuthority(loc); //add local authority to local authority table
List<LocalAuthority> localAuthorities = localAuthorityRepository.getAllLocalAuthority();
modelAndView.addObject("localAuth", localAuthorities);
}
return modelAndView;
}
@PostMapping("/businesses")
public ModelAndView businessSent (@Valid @ModelAttribute("local-auth-data") Business business, BindingResult bindingResult, Model model ){
if (bindingResult.hasErrors()) {
ModelAndView modelAndView = new ModelAndView("businesses", model.asMap());
return modelAndView;
} else { // converts user input using the organisation constructor into a submittable format to the sql table
Business bus = new Business(business.getBusinessName(), business.getAddress1(), business.getAddress2(), business.getCity(), business.getCounty(), business.getPostcode(), business.getWebsite());
businessRepository.addBusiness(bus); //add local authority to local authority table
ModelAndView modelAndView = new ModelAndView("businesses");
List<Business> localBusiness = businessRepository.getAllBusinesses();
modelAndView.addObject("busiSub", localBusiness);
return modelAndView;
}
}
@GetMapping("/consumers")
public ModelAndView getConsumersPage () {
ModelAndView modelAndView = new ModelAndView("WorkWith/consumers.html");
return modelAndView;
}
@GetMapping("/towns")
public ModelAndView getTownsPage () {
ModelAndView modelAndView = new ModelAndView("WorkWith/towns.html");
return modelAndView;
}
}
package Team5.SmartTowns.business;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
@Data
public class Business {
private String businessName;
private String address1;
private String address2;
private String city;
private String county;
private String postcode;
private String website;
@Override
public String toString(){
return "Business:" + " " +
businessName + '\'' + " " +
address1 + '\'' + " " +
address2 + '\'' + " " +
city + '\'' + " " +
county + '\'' + " " +
postcode + '\'' + " " +
website +
" ";
}
public String getBusinessName() {
return businessName;
}
public String getAddress1() {
return address1;
}
public String getAddress2() {
return address2;
}
public String getCity() {
return city;
}
public String getCounty() {
return county;
}
public String getPostcode() {
return postcode;
}
public String getWebsite() {
return website;
}
}
package Team5.SmartTowns.business;
import java.util.List;
public interface BusinessRepository {
List<Business> getAllBusinesses();
void addBusiness(Business bus);
}
package Team5.SmartTowns.business;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public class BusinessRepositoryJDBC implements BusinessRepository {
private JdbcTemplate jdbc;
private RowMapper<Business> businessMapper;
public BusinessRepositoryJDBC(JdbcTemplate ajdbc){
this.jdbc = ajdbc;
setbusinessMapper();
}
private void setbusinessMapper(){
businessMapper = (rs, i) -> new Business(
rs.getString("businessName"),
rs.getString("address1"),
rs.getString("address2"),
rs.getString("city"),
rs.getString("county"),
rs.getString("postcode"),
rs.getString("website")
);
}
public List<Business> getAllBusinesses(){
String sql = "SELECT * FROM businesses";
return jdbc.query(sql, businessMapper);
}
@Override
public void addBusiness(Business bus) {
String sql = "INSERT INTO businesses( businessName, address1, address2, city, county, postcode, website) values (?, ?, ?, ?, ?, ?, ?)";
jdbc.update(sql, bus.getBusinessName(),bus.getAddress1(),bus.getAddress2(),bus.getCity(),bus.getCounty(),bus.getPostcode(),bus.getWebsite());
}
}
......@@ -60,7 +60,6 @@ public class Location {
public boolean isLocationApproved() {
return locationApproved;
}
......
......@@ -12,7 +12,7 @@ public interface LocationRepository {
List<Location> getAllApprovedLocations();
int nametoLocationID(String name);
int nametoLocationID(String name);
// List<Location> getApprovedLocations2(List<Location> list);
......
......@@ -41,16 +41,7 @@ public class LocationRepositoryJDBC implements LocationRepository {
String sql= "SELECT * FROM locations";
return jdbc.query(sql, locationMapper);
}
// public LocationRepositoryJDBC() {
// JdbcTemplate ajdbc = new JdbcTemplate();
// this.jdbc =ajdbc;
// setlocationMapper();
//
// }
// public LocationRepositoryJDBC(JdbcTemplate jdbc, RowMapper<Location> locationMapper) {
// this.jdbc = jdbc;
// this.locationMapper = locationMapper;
// }
@Override
public List<Location> getAllApprovedLocations(){
......
......@@ -79,15 +79,16 @@ public class LandmarksController {
int locationID = locationRepository.nametoLocationID(location.getLocationName());
// converts valid response using Location constructor into a submittable format to the sql table
System.out.println(locCoord.getLocationCoordsLong());
LocationsCoordinates ALocCoord = new LocationsCoordinates(locationID, locCoord.getLocationCoordsLat(), locCoord.getLocationCoordsLong());
boolean checkIfCoorsWithinBoundaries = placesCoordinatesRepo.checkIfCoordsAreWithinTownBoundary(ALocCoord);
if (checkIfCoorsWithinBoundaries==false){ // if coords outside associated town, form is returned to original state
return new ModelAndView("redirect:/checkpointApproval");
return new ModelAndView("redirect:/checkpointApproval?error");
}
placesCoordinatesRepo.addLocationCoord(ALocCoord); // adds valid landmark to locations table
locationRepository.updateApprovalStatus(locationID); // updates approval status accordingly
System.out.println(placesCoordinatesRepo.getAllLocationCoords());
ModelAndView modelAndView = new ModelAndView("redirect:/home"); //redirects back top form in case admin wants to input second location
ModelAndView modelAndView = new ModelAndView("redirect:/mobile-home"); //redirects back top form in case admin wants to input second location
return modelAndView;
// }
......
package Team5.SmartTowns.localauthority;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
@Data
public class LocalAuthority {
private String localAuthorityName;
private String address1;
private String address2;
private String city;
private String county;
private String postcode;
private String website;
@Override
public String toString() {
return "Local Authority:" + " " +
localAuthorityName + '\'' + " " +
address1 + '\'' + " " +
address2 + '\'' + " " +
city + '\'' + " " +
county + '\'' + " " +
postcode + '\'' + " " +
website +
" ";
}
public String getLocalAuthorityName() {
return localAuthorityName;
}
public String getAddress1() { return address1; }
public String getAddress2() {
return address2;
}
public String getCity() {
return city;
}
public String getCounty() {
return county;
}
public String getPostcode() {
return postcode;
}
public String getWebsite() {
return website;
}
}
package Team5.SmartTowns.localauthority;
import java.util.List;
public interface LocalAuthorityRepository {
List<LocalAuthority> getAllLocalAuthority();
void addLocalAuthority(LocalAuthority loc);
}
package Team5.SmartTowns.localauthority;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public class LocalAuthorityRepositoryJDBC implements LocalAuthorityRepository {
private JdbcTemplate jdbc;
private RowMapper<LocalAuthority> localAuthorityMapper;
public LocalAuthorityRepositoryJDBC(JdbcTemplate ajdbc){
this.jdbc = ajdbc;
setlocalauthorityMapper();
}
private void setlocalauthorityMapper(){
localAuthorityMapper = (rs, i) -> new LocalAuthority(
rs.getString("localAuthorityName"),
rs.getString("address1"),
rs.getString("address2"),
rs.getString("city"),
rs.getString("county"),
rs.getString("postcode"),
rs.getString("website")
);
}
public List<LocalAuthority> getAllLocalAuthority(){
String sql = "SELECT * FROM localAuthority";
return jdbc.query(sql, localAuthorityMapper);
}
@Override
public void addLocalAuthority(LocalAuthority loc){
String sql = "INSERT INTO localAuthority( localAuthorityName, address1, address2, city, county, postcode, website) values (?, ?, ?, ?, ?, ?, ?)";
jdbc.update(sql, loc.getLocalAuthorityName(),loc.getAddress1(),loc.getAddress2(),loc.getCity(),loc.getCounty(),loc.getPostcode(),loc.getWebsite());
}
}
......@@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
......@@ -35,6 +37,70 @@ public class PlacesController {
private RewardsRepository rewardsRepository;
@GetMapping("/towns")
public ModelAndView getTownPages(){
ModelAndView modelAndView = new ModelAndView("towns/townsPageList.html");
List<TownWithTrails> townsList = placeRepo.getAllTownCoords();
List<Trail> trailslocations = trailsRepo.getAllTrails();
modelAndView.addObject("trails", trailslocations);
modelAndView.addObject("towns", townsList);
return modelAndView;
}
@RequestMapping(value="/town", method= RequestMethod.POST)
public String sendHtmlFragmentTown(Model map) {
map.addAttribute("foo", "bar");
return "checkpoint/checkpoint";
}
@GetMapping("/towns/{town}")
public ModelAndView getResultBySearchKeyTowns(@PathVariable String town) {
List<TownWithTrails> townsList = placeRepo.getAllTownCoords();
List<Trail> trailslocations = trailsRepo.getAllTrails();
List<Trail> correctTrails = new ArrayList<>();
String townNamee="";
int indexTown=999;
for (int i=0;i<townsList.size();i++){
if (Objects.equals(townsList.get(i).getTownName(), town)){
indexTown=i;
townNamee=town;
}
}
if (indexTown!=999){
int townIDFromTable= placeRepo.getTownIDFromName(townNamee);
for (int i=0;i<trailslocations.size();i++){
int trailID = trailsRepo.getTrailIDFromTrailName(trailslocations.get(i).getTrailName());
if ((trailID>100)&&(trailID<200)&&(Objects.equals(townNamee, "Caerphilly"))){
correctTrails.add(trailslocations.get(i));
}
if ((trailID>200)&&(trailID<300)&&(Objects.equals(townNamee, "Risca"))){
correctTrails.add(trailslocations.get(i));
}
if ((trailID>300)&&(trailID<400)&& (Objects.equals(townNamee, "Penarth")) ){
correctTrails.add(trailslocations.get(i));
}
}
}
ModelAndView modelAndView= new ModelAndView("fragments/townsPageFrags :: townSection");
modelAndView.addObject("town", townsList.get(indexTown));
modelAndView.addObject("trails", correctTrails);
return modelAndView;}
@GetMapping("/checkpoints")
public ModelAndView getLocationPages(){
ModelAndView modelAndView = new ModelAndView("landmarks/locationPage.html");
......@@ -42,7 +108,7 @@ public class PlacesController {
List<Location> approvedLocations = locationRepo.getAllApprovedLocations();
modelAndView.addObject("location", approvedLocations);
modelAndView.addObject("locationCoords", locCoords);
modelAndView.addObject("locationCoords", reorderCoordsWRTLocations(locCoords));
return modelAndView;
}
......@@ -55,19 +121,19 @@ public class PlacesController {
@GetMapping("/checkpoints/{location}")
@GetMapping("/checkpoints/{location}")
public ModelAndView getResultBySearchKeyLocation(@PathVariable String location) {
List<LocationsCoordinates> locCoords = placeRepo.getAllLocationCoords();
List<Location> approvedLocations = locationRepo.getAllApprovedLocations();
List<LocationsCoordinates> locCoords = reorderCoordsWRTLocations(placeRepo.getAllLocationCoords());
List<Location> approvedLocations = locationRepo.getAllApprovedLocations();
int locationID = 999;
for (int i=0;i<approvedLocations.size();i++){
if ( (approvedLocations.get(i).getLocationName().replace(' ', '-').trim().equals(location)) ){
locationID= i;
}
int locationID = 999;
for (int i=0;i<approvedLocations.size();i++){
if ( (approvedLocations.get(i).getLocationName().replace(' ', '-').trim().equals(location)) ){
locationID= i;
}
}
String trailName=trailsRepo.getTrailNameWithID(approvedLocations.get(locationID).getLocationTrailID()).replace(' ', '-').trim();
String trailName=trailsRepo.getTrailNameWithID(approvedLocations.get(locationID).getLocationTrailID()).replace(' ', '-').trim();
ModelAndView modelAndView= new ModelAndView("fragments/locationPageFrags :: locationSection");
modelAndView.addObject("locCoord", locCoords.get(locationID));
modelAndView.addObject("trail", trailName);
......@@ -90,7 +156,7 @@ public class PlacesController {
modelAndView.addObject("trails", trailslocations);
modelAndView.addObject("locations", approvedLocations);
modelAndView.addObject("locationCoords", locCoords);
modelAndView.addObject("locationCoords", reorderCoordsWRTLocations(locCoords));
return modelAndView;
}
......@@ -131,5 +197,41 @@ public class PlacesController {
modelAndView.addObject("stickers", rewardsRepository.getAllStickersFromPack(1));
return modelAndView;
}
// public List<LocationsCoordinates> reorderCoordsWRTLocations(List<LocationsCoordinates> locCoords){
// List<Location> approvedList = locationRepo.getAllLocation();
//// List<LocationsCoordinates> locCoords = placeRepo.getAllLocationCoords();
// List<Integer> locationID= new ArrayList<Integer>();
// System.out.println(locCoords);
// System.out.println("///////");
// Collections.swap(locCoords,0,10);
// for(int i=0;i<locCoords.size();i++){
// if (i==locCoords.size()-1){
// if (locCoords.get(i).getLocationID()<locCoords.get(i-1).getLocationID()){
// Collections.swap(locCoords,i,i--);
// i=0;
// }
//
// }
// if (locCoords.get(i).getLocationID()>locCoords.get(i++).getLocationID()){
// System.out.println("ASDSADASD");
// Collections.swap(locCoords,i,i++);
// i=0;
// }
//
// } System.out.println(locCoords);
// return locCoords;
//
//
//
// }
// When adding to the locationsCoordinates table, the order is not based on LocationID order, therefore it is needed to rearrange this list to
// follow ascending locationID so that any new coordinates match up with their intended locations.
public List<LocationsCoordinates> reorderCoordsWRTLocations(List<LocationsCoordinates> locCoords){
Collections.sort(locCoords,
Comparator.comparingInt(LocationsCoordinates::getLocationID));
return locCoords;
}
}
......@@ -18,6 +18,7 @@ public class PlacesCoordinatesRepositoryJDBC implements PlacesCoordinatesReposit
private JdbcTemplate jdbc;
private RowMapper<LocationsCoordinates> locationCoordMapper;
private RowMapper<TownWithTrails> townCoordMapper;
public PlacesCoordinatesRepositoryJDBC(JdbcTemplate aJdbc) {
this.jdbc = aJdbc;
setLocationCoordsMapper();
......@@ -65,7 +66,7 @@ public class PlacesCoordinatesRepositoryJDBC implements PlacesCoordinatesReposit
public void addLocationCoord(LocationsCoordinates locCoords) {
String sql = "insert into locationCoordinates(locationID, locationCoordsLat,locationCoordsLong) values (?,?,?)";
jdbc.update(sql,locCoords.getLocationID(), locCoords.getLocationCoordsLong(),locCoords.getLocationCoordsLat());
jdbc.update(sql,locCoords.getLocationID(), locCoords.getLocationCoordsLat(),locCoords.getLocationCoordsLong());
}
@Override
......@@ -217,369 +218,3 @@ public class PlacesCoordinatesRepositoryJDBC implements PlacesCoordinatesReposit
/// if location id == unapproved location id,-> make sure coords within boundaries, -> approve and append lcoations table and add to coords table.
// List<String> unapprovedLocationTowns = new ArrayList<String>();
// for (int i=1;unapprovedLocations.size()>i;i++ ){
// if (Objects.equals(unapprovedLocations.get(i).getLocationPlace(), town)){
// }
//
////
// // unapproved list
// // if matches name, approve
// // add long/lat coords
// //use to update table
// }
//}
spring.datasource.url=jdbc:mariadb://localhost:3306/
spring.datasource.url=jdbc:mariadb://localhost:3306/towns
spring.datasource.username=root
spring.datasource.password=comsc
......
......@@ -54,10 +54,6 @@ INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (3, 1,
INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (3, 2, 'Welsh Outline', 'Welsh Heritage', '1');
INSERT INTO stickers (packID, stickerID, name, description, rarity) VALUE (3, 3, 'Welsh Spoon', 'Welsh Heritage', '1');
# 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);
delete from locationCoordinates;
insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (2, 51.57623, -3.21910 );
......@@ -73,19 +69,17 @@ insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLon
insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (20, 51.43547, -3.16789 );
delete from localauthority;
insert into localauthority ( localAuthorityName, address1, address2, city, county, postcode, website) value ( 'Caerphilly County Borough Council', 'Tredomen Park','', 'Ystrad Mynach, Hengoed', '', 'CF82 7PG', 'https://www.caerphilly.gov.uk/main.aspx?lang=en-GB');
insert into localauthority ( localAuthorityName, address1, address2, city, county, postcode, website) value ( 'Risca Town Council', 'Unit B, 75 Tredegar Street', '', 'Risca', '', 'NP11 6BW', 'https://www.riscatowncouncil.org.uk/');
insert into localauthority ( localAuthorityName, address1, address2, city, county, postcode, website) value ( 'Penarth Town Council West House', 'Stanwell Road', '', 'Penarth', '', 'CF64 2YG', 'https://www.penarthtowncouncil.gov.uk/your-council/');
delete from businesses;
insert into businesses ( businessName, address1, address2, city, county, postcode, website) value ( 'Caerphilly Castle', 'Castle Street','', 'Caerphilly', '', 'CF836 1JD', 'https://cadw.gov.wales/visit/places-to-visit/caerphilly-castle');
insert into businesses ( businessName, address1, address2, city, county, postcode, website) value ( 'Risca Museum', 'Grove Road', '', 'Risca', '', 'NP11 6GN', 'https://riscamuseum.wales/');
insert into businesses ( businessName, address1, address2, city, county, postcode, website) value ( 'Penarth Pier Pavillion Cinema', 'Windsor Court', 'The Esplanade', 'Penarth', '', 'CF64 3AU', 'https://www.valeofglamorgan.gov.uk/en/enjoying/Coast-and-Countryside/Dog-Beach-Ban.aspx');
# insert into stickerprogress (userID, packID, stickerID) value (1, 1, 1);
# insert into stickerprogress (userID, packID, stickerID) value (1, 1, 2);
# insert into stickerprogress (userID, packID, stickerID) value (1, 1, 3);
# insert into stickerprogress (userID, packID, stickerID) value (1, 1, 5);
# insert into stickerprogress (userID, packID, stickerID) value (1, 2, 1);
# insert into stickerprogress (userID, packID, stickerID) value (1, 2, 3);
#
delete from townsWithTrails;
insert into townsWithTrails (townName, townCentreCoordsLat, townCentreCoordsLong, townUppermostCoordsLat, townLowermostCoordsLat, townLeftmostCoordsLong, townRightmostCoordsLong) value ('Caerphilly', '51.57903','-3.22075 ','51.60418','51.55093','-3.25222','-3.17696');
insert into townsWithTrails (townName, townCentreCoordsLat, townCentreCoordsLong, townUppermostCoordsLat, townLowermostCoordsLat, townLeftmostCoordsLong, townRightmostCoordsLong) value ('Risca','51.61195','-3.09648','51.63039','51.59175','-3.12129','-3.06438');
......
......@@ -14,7 +14,8 @@ DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS stickers;
DROP TABLE IF EXISTS packs;
DROP TABLE IF EXISTS stickerProgress;
DROP TABLE IF EXISTS dragonstale;
/****************************************************************/
......@@ -27,8 +28,7 @@ create table if not exists trails
city varchar(128)
) engine=InnoDB;
drop table if exists locationCoordinates;
drop table if exists locations;
create table if not exists locations
(
locationID bigint auto_increment primary key,
......@@ -40,6 +40,7 @@ create table if not exists locations
locationApproved boolean
) engine=InnoDB;
CREATE TABLE IF NOT EXISTS users (
username varchar(30) primary key NOT NULL,
id bigint auto_increment unique, /*DEPRECATED COLUMN, LEFT IN WHILE SOME OTHER FUNCTIONS STILL USE IT*/
......@@ -71,7 +72,6 @@ CREATE TABLE IF NOT EXISTS stickers (
description text NOT NULL,
rarity tinyint
);
CREATE TABLE IF NOT EXISTS stickerProgress (
id bigint auto_increment primary key,
username varchar(30) NOT NULL,
......@@ -101,7 +101,8 @@ create table if not exists locationCoordinates
)engine=InnoDB;
drop table if exists townsWithTrails;
create table if not exists townsWithTrails
(
townID bigint auto_increment primary key,
......@@ -115,12 +116,30 @@ create table if not exists townsWithTrails
)engine=InnoDB;
CREATE TABLE IF NOT EXISTS dragonstale
create table if not exists localAuthority
(
localAuthorityID bigint auto_increment primary key,
localAuthorityName varchar(250),
address1 varchar(250),
address2 varchar(250),
city varchar(100),
county varchar(75),
postcode varchar(15),
website varchar(250)
) engine=InnoDB;
create table if not exists businesses
(
landmarkID bigint auto_increment primary key,
landmarkName varchar(255),
landmarkDescription varchar(2000),
imgPath varchar(255)
businessID bigint auto_increment primary key,
businessName varchar(250),
address1 varchar(250),
address2 varchar(250),
city varchar(100),
county varchar(75),
postcode varchar(15),
website varchar(250)
) engine=InnoDB;
)engine=InnoDB;
body{
background-color: rgb(41, 41, 41)
}
h3{
color: wheat;
}
ul{
list-style: none;
}
ul li{
color: wheat;
list-style: none;
}
\ No newline at end of file
......@@ -13,6 +13,11 @@ and (min-device-width: 1000px) {
grid-area: submitButton;
}
.reviewLand{
grid-area: reviewButton;
}
.Banner {
margin-top: 20px;
background-color: darkslategrey;
......@@ -146,14 +151,15 @@ and (min-device-width: 1000px) {
.gridContainer1 {
display: grid;
display:grid;
grid-template-columns: 10% 10% 60% 5% 5% 10%;
grid-template-rows: auto;
grid-template-areas:
". pageTitle pageTitle pageTitle pageTitle ."
". . . submitButton submitButton .";
". reviewButton . submitButton submitButton .";
}
.gridContainer2 {
display: grid;
grid-template-columns: 10% 10% 60% 5% 5% 10%;
......
body{
background-color: rgb(41, 41, 41)
}
h1{
color: wheat;
}
h3{
color: wheat;
}
ul{
list-style: none;
}
ul li{
color: wheat;
list-style: none;
}
\ No newline at end of file
body{
background: rgb(41, 41, 41);
color: wheat;
}
/*body{*/
/* background: rgb(41, 41, 41);*/
/* color: wheat;*/
/*}*/
main {
background-color: rgb(206, 153, 253);
color: black;
......@@ -9,10 +9,12 @@ main {
align-content: center;
text-align: center;
border-radius: 25px;
max-width: 620px;
max-width: 80vw;
margin: 0 auto
}
.coordError{
color:darkred;
}
#formHeader{
padding-top: 10px;
color:white;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment