diff --git a/src/main/java/com/example/clientproject/data/misc/ShopTagLinkTable.java b/src/main/java/com/example/clientproject/data/misc/ShopTagLinkTable.java new file mode 100644 index 0000000000000000000000000000000000000000..f065c80479e8e6e10056ccbddff48af987a8b584 --- /dev/null +++ b/src/main/java/com/example/clientproject/data/misc/ShopTagLinkTable.java @@ -0,0 +1,12 @@ +package com.example.clientproject.data.misc; + +public class ShopTagLinkTable { + private int shopId; + private int tagId; + + public ShopTagLinkTable(int shopId, int tagId){ + this.shopId = shopId; + this.tagId = tagId; + + } +} diff --git a/src/main/java/com/example/clientproject/data/shops/Shops.java b/src/main/java/com/example/clientproject/data/shops/Shops.java index a51d201353334c410092f5f4a54cb0d0cdc6f77f..6cb00fbf9e6859217fa66a7630d98398be1b7b04 100644 --- a/src/main/java/com/example/clientproject/data/shops/Shops.java +++ b/src/main/java/com/example/clientproject/data/shops/Shops.java @@ -19,11 +19,13 @@ import java.util.List; @AllArgsConstructor @NoArgsConstructor @Entity +@Table(name="shops") public class Shops { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private String shopId; private String shopName; + private String shopDescription; private String shopWebsite; private int shopEarnings; private String shopImage; @@ -41,9 +43,10 @@ public class Shops { * @param countries - shop countries * @param active - shop active status */ - public Shops(String name, String website, int earnings, + public Shops(String name, String website, String description, int earnings, String image, String countries, boolean active) { this.shopName = name; + this.shopDescription = description; this.shopWebsite = website; this.shopEarnings = earnings; this.shopImage = image; diff --git a/src/main/java/com/example/clientproject/data/shops/ShopsRepo.java b/src/main/java/com/example/clientproject/data/shops/ShopsRepo.java index 2ee0113e97cf979609ad108fbcee80ce56ae1b05..0d2f3604e3e1ee9e289cd162e7327353b4c5d2fa 100644 --- a/src/main/java/com/example/clientproject/data/shops/ShopsRepo.java +++ b/src/main/java/com/example/clientproject/data/shops/ShopsRepo.java @@ -15,7 +15,7 @@ public interface ShopsRepo extends JpaRepository<Shops, Long> { * FindAll method * @return list of Shops found */ - List<Shops> findAll(); +// List<Shops> findAll(); /** * Save method diff --git a/src/main/java/com/example/clientproject/data/tags/Tags.java b/src/main/java/com/example/clientproject/data/tags/Tags.java index 72e5193e79d9b3e542644bbf1b55ca7516e73a64..0c077ee086e3d5ca12ec1ff11df5d423b9edb68d 100644 --- a/src/main/java/com/example/clientproject/data/tags/Tags.java +++ b/src/main/java/com/example/clientproject/data/tags/Tags.java @@ -23,6 +23,13 @@ public class Tags { private long tagId; private String tagName; + /** + * + */ + public Tags(String tagName){ + this.tagName = tagName; + } + @ManyToMany(mappedBy="shopTags") private List<Shops> relatedShops; diff --git a/src/main/java/com/example/clientproject/data/tags/TagsRepo.java b/src/main/java/com/example/clientproject/data/tags/TagsRepo.java index 0429026bbf9a63a5f9ed13cc4064a56961de4a35..cea220e420ca20f3081c205ad86eb2c3b277c241 100644 --- a/src/main/java/com/example/clientproject/data/tags/TagsRepo.java +++ b/src/main/java/com/example/clientproject/data/tags/TagsRepo.java @@ -1,6 +1,8 @@ package com.example.clientproject.data.tags; +import com.example.clientproject.data.shops.Shops; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; import java.util.List; @@ -21,4 +23,7 @@ public interface TagsRepo extends JpaRepository<Tags, Long> { * @return - the object */ Tags save(Tags tags); + + @Query("select t.tagId from Tags t where t.tagId = (select max(t.tagId) from Tags t)") + int findMostRecent(); } diff --git a/src/main/java/com/example/clientproject/data/users/Users.java b/src/main/java/com/example/clientproject/data/users/Users.java index dfcbb19de953a79940716e6a2028afb0b8ecfb6e..387152efa5067e00ac1da56924f31c6267c790d3 100644 --- a/src/main/java/com/example/clientproject/data/users/Users.java +++ b/src/main/java/com/example/clientproject/data/users/Users.java @@ -1,9 +1,10 @@ package com.example.clientproject.data.users; import com.example.clientproject.data.shops.Shops; +import com.example.clientproject.data.stampBoards.StampBoards; import com.example.clientproject.data.tags.Tags; import com.example.clientproject.data.twoFactorMethods.TwoFactorMethods; -import com.example.clientproject.data.userStampBoards.UserStampBoards; +import com.example.clientproject.services.TwoFactorAuthOBJ; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -28,7 +29,6 @@ public class Users { private String userLastName; private String userEmail; private String userPassword; - // TODO - implement a random salt generator and extra field here private String userProfilePicture; private String userResetCode; private String userResetCodeExpiry; @@ -71,7 +71,7 @@ public class Users { @OneToMany(cascade=CascadeType.ALL, orphanRemoval = true) @JoinColumn(name="User_Id", nullable = false) - private Set<UserStampBoards> userStampBoards; + private Set<StampBoards> stampBoards; @ManyToMany @JoinTable( diff --git a/src/main/java/com/example/clientproject/domain/AccountRegister.java b/src/main/java/com/example/clientproject/domain/AccountRegister.java new file mode 100644 index 0000000000000000000000000000000000000000..3f082c355f74fe7b3d83e3aad98bef737c82907c --- /dev/null +++ b/src/main/java/com/example/clientproject/domain/AccountRegister.java @@ -0,0 +1,50 @@ +package com.example.clientproject.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; + +import java.security.SecureRandom; +import java.util.Arrays; +import java.util.Base64; +import java.util.Random; + +@Data +public class AccountRegister { + private String name; + private String surname; + private String email; + private String password; + @Override + public String toString(){ + return this.getName() + ", " + this.getSurname() + ", " + this.getEmail() + ", " + this.getPassword(); + } + + public AccountRegister(String name, String surname, String email, String password){ + this.name = name; + this.surname = surname; + this.email = email; + this.password = password; + } + + public void setPassword(String password) { + final Random RANDOM = new SecureRandom(); + PasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); + + + byte[] salt = new byte[16];// credits to user "Assylias" https://stackoverflow.com/questions/18142745/how-do-i-generate-a-salt-in-java-for-salted-hash + RANDOM.nextBytes(salt); + String generatedSalt = Base64.getEncoder().encodeToString(salt); + + + //System.out.println(generatedSalt); + + + this.password = passwordEncoder.encode(password + generatedSalt); + + //System.out.println(this.password); + } + +} diff --git a/src/main/java/com/example/clientproject/services/BusinessRegisterDTO.java b/src/main/java/com/example/clientproject/services/BusinessRegisterDTO.java new file mode 100644 index 0000000000000000000000000000000000000000..17371abe8e5c2ecc5120d02baefb6f2028a3806f --- /dev/null +++ b/src/main/java/com/example/clientproject/services/BusinessRegisterDTO.java @@ -0,0 +1,37 @@ +package com.example.clientproject.services; + +import com.example.clientproject.web.forms.BusinessRegisterForm; +import lombok.AllArgsConstructor; +import lombok.Value; + +import java.util.ArrayList; + +@Value +@AllArgsConstructor +public class BusinessRegisterDTO { + String business_register_url; + String business_register_name; + String business_register_desc; + //String businessCategory; + ArrayList<String> businessTags; + //String instagram; + //String facebook; + //String twitter; + //String tiktok; + int earnings; + + public BusinessRegisterDTO(BusinessRegisterForm brf){ + this( + brf.getBusiness_register_url(), + brf.getBusiness_register_name(), + brf.getBusiness_register_desc(), + //brf.getBusinessCategory(), + brf.getBusinessTags(), + //brf.getInstagram(), + //brf.getFacebook(), + //brf.getTwitter(), + //brf.getTiktok(), + brf.getEarnings() + ); + } +} diff --git a/src/main/java/com/example/clientproject/services/BusinessRegisterSaver.java b/src/main/java/com/example/clientproject/services/BusinessRegisterSaver.java new file mode 100644 index 0000000000000000000000000000000000000000..c662f0f5c14edd2e54bc45cb1dd32d65bd44f543 --- /dev/null +++ b/src/main/java/com/example/clientproject/services/BusinessRegisterSaver.java @@ -0,0 +1,61 @@ +package com.example.clientproject.services; + +import com.example.clientproject.data.shops.Shops; +import com.example.clientproject.data.shops.ShopsRepo; +import com.example.clientproject.data.tags.Tags; +import com.example.clientproject.data.tags.TagsRepo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.stereotype.Service; + +import java.sql.ResultSet; +import java.util.List; + +@Service +public class BusinessRegisterSaver { + + @Autowired + ShopsRepo shopsRepo; + + @Autowired + TagsRepo tagsRepo; + + @Autowired + JdbcTemplate jdbc; + + public void save(BusinessRegisterDTO business){ + + Shops shop = new Shops(business.getBusiness_register_name(), + business.getBusiness_register_url(), + business.getBusiness_register_desc(), + business.getEarnings(), + "shopPic.png", + "UK United Kingdom", + false); + + shopsRepo.save(shop); + List<Tags> tagsList = tagsRepo.findAll(); + + for(String t: business.getBusinessTags()){ + if(tagsList.contains(new Tags(t))){ + // Link shop to tag + continue; + } + //long id = 0; + Tags tag = new Tags(t); + tagsRepo.save(tag); + + String query = "INSERT INTO Shop_Tag_Links (Shop_Id, Tag_Id) VALUES ("+ shop.getShopId() + + ","+tag.getTagId() + ")"; + + jdbc.execute(query); + + } + System.out.println(shop.getShopId()); + + System.out.println(tagsRepo.findAll()); + + System.out.println(shopsRepo.findByShopName(business.getBusiness_register_name())); + } + +} diff --git a/src/main/java/com/example/clientproject/services/TwoFactorAuthOBJ.java b/src/main/java/com/example/clientproject/services/TwoFactorAuthOBJ.java new file mode 100644 index 0000000000000000000000000000000000000000..79efc0b0bd50030ddc9b0bab9f1086f0f8da9210 --- /dev/null +++ b/src/main/java/com/example/clientproject/services/TwoFactorAuthOBJ.java @@ -0,0 +1,9 @@ +package com.example.clientproject.services; + +public class TwoFactorAuthOBJ { + private long twoFactorMethodId; + private String twoFactorMethodName; + + public TwoFactorAuthOBJ(long id, String twoFA_name) { + } +} diff --git a/src/main/java/com/example/clientproject/services/getAllTagsService.java b/src/main/java/com/example/clientproject/services/getAllTagsService.java new file mode 100644 index 0000000000000000000000000000000000000000..0c3dd75a0af628d59c4055c047f25180825a785e --- /dev/null +++ b/src/main/java/com/example/clientproject/services/getAllTagsService.java @@ -0,0 +1,10 @@ +package com.example.clientproject.services; + +import com.example.clientproject.data.tags.Tags; +import org.springframework.stereotype.Service; + +import java.util.List; + +public interface getAllTagsService { + List<Tags> findAll(); +} \ No newline at end of file diff --git a/src/main/java/com/example/clientproject/services/getAllTagsServiceStatic.java b/src/main/java/com/example/clientproject/services/getAllTagsServiceStatic.java new file mode 100644 index 0000000000000000000000000000000000000000..aed8326ea8aa38e655dc7893e772e0714a9968e5 --- /dev/null +++ b/src/main/java/com/example/clientproject/services/getAllTagsServiceStatic.java @@ -0,0 +1,20 @@ +package com.example.clientproject.services; + +import com.example.clientproject.data.tags.Tags; +import com.example.clientproject.data.tags.TagsRepo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class getAllTagsServiceStatic implements getAllTagsService{ + + @Autowired + TagsRepo tagsRepo; + + @Override + public List<Tags> findAll() { + return tagsRepo.findAll(); + } +} diff --git a/src/main/java/com/example/clientproject/services/newAccountDTO.java b/src/main/java/com/example/clientproject/services/newAccountDTO.java new file mode 100644 index 0000000000000000000000000000000000000000..21a6b2460a6217918b93df0ca25bbc4d8dfdb17c --- /dev/null +++ b/src/main/java/com/example/clientproject/services/newAccountDTO.java @@ -0,0 +1,32 @@ +package com.example.clientproject.services; +import com.example.clientproject.data.twoFactorMethods.TwoFactorMethods; +import com.example.clientproject.data.users.Users; +import com.example.clientproject.data.users.UsersRepo; +import com.example.clientproject.domain.AccountRegister; +import lombok.AllArgsConstructor; +import lombok.Value; +import org.springframework.context.annotation.Bean; +import com.example.clientproject.data.twoFactorMethods.TwoFactorMethods; +import com.example.clientproject.data.twoFactorMethods.TwoFactorMethodsRepo; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +@Value +@AllArgsConstructor +public class newAccountDTO { + String name; + String surname; + String email; + String password; + public newAccountDTO(AccountRegister aAccount){ + this( + aAccount.getName(), + aAccount.getSurname(), + aAccount.getEmail(), + aAccount.getPassword() + ); + } + + +} diff --git a/src/main/java/com/example/clientproject/services/registerUserService.java b/src/main/java/com/example/clientproject/services/registerUserService.java new file mode 100644 index 0000000000000000000000000000000000000000..72063566e986fe88aa97689177b2abc1f70b51e3 --- /dev/null +++ b/src/main/java/com/example/clientproject/services/registerUserService.java @@ -0,0 +1,7 @@ +package com.example.clientproject.services; + +public interface registerUserService{ + + public void save(newAccountDTO accountDTO); + +} diff --git a/src/main/java/com/example/clientproject/services/registerUserServiceStatic.java b/src/main/java/com/example/clientproject/services/registerUserServiceStatic.java new file mode 100644 index 0000000000000000000000000000000000000000..562926def43b62dbc3da197712cb53ddf9b22a38 --- /dev/null +++ b/src/main/java/com/example/clientproject/services/registerUserServiceStatic.java @@ -0,0 +1,37 @@ +package com.example.clientproject.services; + +import com.example.clientproject.data.twoFactorMethods.TwoFactorMethods; +import com.example.clientproject.data.twoFactorMethods.TwoFactorMethodsRepo; +import com.example.clientproject.data.users.Users; +import com.example.clientproject.data.users.UsersRepo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +@Service +public class registerUserServiceStatic implements registerUserService{ + @Autowired + UsersRepo usersRepo; + @Autowired + TwoFactorMethodsRepo twoFactorMethodsRepo; + + public void save(newAccountDTO accountDTO){ + long ID = 1; + TwoFactorMethods twoFactorMethods = new TwoFactorMethods(); + twoFactorMethods.setTwoFactorMethodId(ID); + twoFactorMethods.setTwoFactorMethodName("None"); + + twoFactorMethodsRepo.save(twoFactorMethods); + + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + Users newUser = new Users(accountDTO.getName(), accountDTO.getSurname(), accountDTO.getEmail(), accountDTO.getPassword(), + "", "", + LocalDateTime.now().format(formatter), twoFactorMethods); + usersRepo.save(newUser); + + System.out.println(usersRepo.findById(newUser.getUserId())); + + } +} diff --git a/src/main/java/com/example/clientproject/web/controllers/SignUp/SignUpController.java b/src/main/java/com/example/clientproject/web/controllers/SignUp/SignUpController.java new file mode 100644 index 0000000000000000000000000000000000000000..60e3be518bba3f4093ceff84125db5eca19d22b0 --- /dev/null +++ b/src/main/java/com/example/clientproject/web/controllers/SignUp/SignUpController.java @@ -0,0 +1,53 @@ +package com.example.clientproject.web.controllers.SignUp; + +import com.example.clientproject.data.twoFactorMethods.TwoFactorMethodsRepo; +import com.example.clientproject.data.twoFactorMethods.TwoFactorMethods; +import com.example.clientproject.data.users.Users; +import com.example.clientproject.data.users.UsersRepo; +import com.example.clientproject.domain.AccountRegister; +import com.example.clientproject.services.newAccountDTO; +import com.example.clientproject.services.registerUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + + +@Controller +public class SignUpController { + + + private registerUserService regUserService; + + @Autowired + public SignUpController(registerUserService rService) { + regUserService = rService; + } + + + @PostMapping("/signup") + public String signUp(Model model, AccountRegister accountRegister) { + newAccountDTO newAccountDTO1 = new newAccountDTO(accountRegister.getName(), accountRegister.getSurname(), accountRegister.getEmail(), accountRegister.getPassword()); + //System.out.println(accountRegister.getEmail()); + //System.out.println(accountRegister.getPassword()); + //DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + //TwoFactorMethods twoFactorMethods = twoFactorMethodsRepo.findByTwoFactorMethodId(1).get(); + //Users newUser = new Users(accountRegister.getName(), accountRegister.getSurname(), accountRegister.getEmail(), accountRegister.getPassword(), + //"", "", + //LocalDateTime.now().format(formatter), twoFactorMethods); + + //usersRepo.save(newUser); + regUserService.save(newAccountDTO1); + return "signup"; + } + + @GetMapping("/signup") + public String signupGet(Model model){ + return "signup"; + } + } \ No newline at end of file diff --git a/src/main/java/com/example/clientproject/web/controllers/selectCategories/selectCategoriesControllers.java b/src/main/java/com/example/clientproject/web/controllers/selectCategories/selectCategoriesControllers.java new file mode 100644 index 0000000000000000000000000000000000000000..b41af0d8d831e3264713d5fb602c44b5f7e4cddd --- /dev/null +++ b/src/main/java/com/example/clientproject/web/controllers/selectCategories/selectCategoriesControllers.java @@ -0,0 +1,39 @@ +package com.example.clientproject.web.controllers.selectCategories; + +import com.example.clientproject.data.tags.Tags; +import com.example.clientproject.services.getAllTagsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; + +import java.awt.desktop.ScreenSleepEvent; +import java.util.List; + +@Controller +public class selectCategoriesControllers { + + private getAllTagsService getTagService; + + @Autowired + public void getAllTagsController(getAllTagsService allTagsService) { getTagService = allTagsService;} + + @PostMapping("/selectCategories") + public String selectCategories(){ + + return("selectCategories"); + } + + + @GetMapping("/selectCategories") + public String selectCategories(Model model){ + List<Tags> allTags = getTagService.findAll(); + model.addAttribute("allTags", allTags); + for (Tags allTag : allTags) { + System.out.println(allTag); + } + System.out.println("Test"); + return("selectCategories"); + } +} diff --git a/src/main/java/com/example/clientproject/web/forms/BusinessRegisterForm.java b/src/main/java/com/example/clientproject/web/forms/BusinessRegisterForm.java new file mode 100644 index 0000000000000000000000000000000000000000..c40850ee6117f7b56265791336f2097581ce3cce --- /dev/null +++ b/src/main/java/com/example/clientproject/web/forms/BusinessRegisterForm.java @@ -0,0 +1,29 @@ +package com.example.clientproject.web.forms; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.Arrays; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class BusinessRegisterForm { + String business_register_url; + String business_register_name; + String business_register_desc; + String businessCategory; + ArrayList<String> businessTags; + String instagram; + String facebook; + String twitter; + String tiktok; + int earnings; + + public void setTags(String tempTags){ + this.businessTags = new ArrayList(Arrays.asList(tempTags.split(","))); + } + +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 0abc22771bf1db0e5a2c84c9fa182ffc525e78ff..2f8b1670b76488281cd85ae0f031790b51af792e 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1 +1,9 @@ spring.thymeleaf.cache=false + +spring.datasource.url=jdbc:mariadb://localhost:3306/mydb?useSSL=false&requireSSL=false&serverTimezone=UTC + +#set credentials explicitly +spring.datasource.username=root +spring.datasource.password=comsc + +spring.datasource.driver-class-name=org.mariadb.jdbc.Driver \ No newline at end of file diff --git a/src/main/resources/database/Data Script/script.sql b/src/main/resources/database/Data Script/script.sql index 1b6c36839158e347620f4745e3925e16d068472a..b2b727b59903ebdabf1d510806d4ded353480870 100644 --- a/src/main/resources/database/Data Script/script.sql +++ b/src/main/resources/database/Data Script/script.sql @@ -1,19 +1,13 @@ -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('Jorjah','U','JorjahU@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',1); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('Astrid','RISLE','AstridRISLE@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',1); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('RebeccaJane','ISENBURG','RebeccaJaneISENBURG@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',2); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('Fiona','ERHARDS','FionaERHARDS@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',2); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('Kayley','ICHISON','KayleyICHISON@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',2); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('Kole','AGNEW','KoleAGNEW@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',2); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('Anson','ESORD','AnsonESORD@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',1); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('Mustabshira','ERNANDEZLOPEZ','MustabshiraERNANDEZLOPEZ@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',2); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('AlexanderPreslav','WETHINGTON','AlexanderPreslavWETHINGTON@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',1); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('LeonJ','HURSH','LeonJHURSH@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',2); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('Denvyr','BLANCHE','DenvyrBLANCHE@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',1); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('KatieAnn','LAMINCK','KatieAnnLAMINCK@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',1); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('Mackenzie','ONTBRIAND','MackenzieONTBRIAND@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',1); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('Davey','AYNG','DaveyAYNG@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',2); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('OllieJames','LANTERMAN','OllieJamesLANTERMAN@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',2); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('Fahad','CHOUDHURY','FahadCHOUDHURY@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',1); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Katana","VITTORI","KatanaVITTORI@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",1); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Josef","DERBURGH","JosefDERBURGH@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",2); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Tunay","RASSESCHI","TunayRASSESCHI@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",2); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Mirryn","THORNTON","MirrynTHORNTON@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",1); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Brooklyn","BELLIZZI","BrooklynBELLIZZI@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",2); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Eevi","KARMAZYN","EeviKARMAZYN@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",2); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Sharice","HALTIWANGER","ShariceHALTIWANGER@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",1); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Zachariah","ATYNSKI","ZachariahATYNSKI@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",2); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Virgil","CORPIO","VirgilCORPIO@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",1); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Devlyn","DELIKAT","DevlynDELIKAT@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",2); INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (2,1,1); INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (3,1,1); INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (4,1,1); @@ -23,46 +17,66 @@ INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (7,1,1); INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (8,1,1); INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (9,1,1); INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (10,1,1); -INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (11,1,1); -INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (12,1,1); -INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (13,1,1); -INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (14,1,1); -INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (15,1,1); -INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (16,1,1); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('TillyMay','UYPERS','TillyMayUYPERS@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',1); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('Shanice','UHLE','ShaniceUHLE@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',2); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('StacyAnne','EAN','StacyAnneEAN@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',2); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('Faatamah','HOEPFNER','FaatamahHOEPFNER@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',2); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('Eduardo','MURABITO','EduardoMURABITO@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',1); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('Ayisha','ETGEN','AyishaETGEN@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',1); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('Jed','RISTOFIK','JedRISTOFIK@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',1); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('Radhia','AUHOF','RadhiaAUHOF@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',1); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('Alessio','AIDERON','AlessioAIDERON@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',1); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('Kamran','ARKOSKI','KamranARKOSKI@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',2); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Jazbia","MACIVER","JazbiaMACIVER@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",1); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Shahad","CAPON","ShahadCAPON@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",1); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Miri","LABORDE","MiriLABORDE@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",2); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Abbey","SHARMA","AbbeySHARMA@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",1); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("LillyAnne","YINGLING","LillyAnneYINGLING@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",2); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Susan","KOSKINEN","SusanKOSKINEN@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",2); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Waris","ARLTON","WarisARLTON@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",1); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Romara","ELWOOD","RomaraELWOOD@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",1); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Tajinderpal","ANARNAM","TajinderpalANARNAM@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",2); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("ErinLeigh","ARMANN","ErinLeighARMANN@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",2); +INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (11,1,2); +INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (12,1,2); +INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (13,1,2); +INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (14,1,2); +INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (15,1,2); +INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (16,1,2); INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (17,1,2); INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (18,1,2); INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (19,1,2); -INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (20,1,2); -INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (21,1,2); -INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (22,1,2); -INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (23,1,2); -INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (24,1,2); -INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (25,1,2); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('Dru','HILCHEY','DruHILCHEY@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',1); -INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ('MaxxJames','GILETTE','MaxxJamesGILETTE@email.com','$2a$10$PcJ0m/jmm.0jrTbU.T4Ah.qEMX20G7tawN5LyctF7e6uxze5KbS7q','testImage.png',1); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("KieyannaDior","DING","KieyannaDiorDING@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",2); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Rihanon","OBERMAYER","RihanonOBERMAYER@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",2); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Stanley","DENNISTON","StanleyDENNISTON@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",2); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Ekow","COUSAR","EkowCOUSAR@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",2); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Arij","DELLA","ArijDELLA@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",2); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("CharleeLouise","CASS","CharleeLouiseCASS@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",1); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Rana","ADA","RanaADA@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",2); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Gideon","ROHLINGER","GideonROHLINGER@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",2); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Tobechukwu","BALDE","TobechukwuBALDE@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",2); +INSERT INTO Users (User_First_Name, User_Last_Name, User_Email, User_Password, User_Profile_Picture, Two_Factor_Method_Id) VALUES ("Jade","ITTKOP","JadeITTKOP@email.com","52c0b42072654c96e249ccba358c0babb20c8829950241a092be12d69f2fbe72","testImage.png",1); +INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (20,1,3); +INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (21,1,3); +INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (22,1,3); +INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (23,1,3); +INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (24,1,3); +INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (25,1,3); INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (26,1,3); +INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (27,1,3); +INSERT INTO User_Permissions (User_ID, Shop_ID, Admin_Type_Id) VALUES (28,1,3); -INSERT INTO Shops (Shop_Name, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ('Hermiston, Konopelski and Thompson','HermistonKonopelskiandThompson.com','33207','DE Germany',1); -INSERT INTO Shops (Shop_Name, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ('Nolan - Rice','NolanRice.com','38464','IL Israel',2); -INSERT INTO Shops (Shop_Name, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ('Mann, Balistreri and Kunze','MannBalistreriandKunze.com','20625','NO Norway',2); -INSERT INTO Shops (Shop_Name, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ('Kozey, Carter and Ferry','KozeyCarterandFerry.com','14235','MZ Mozambique',1); -INSERT INTO Shops (Shop_Name, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ('Okuneva, Gottlieb and Bayer','OkunevaGottliebandBayer.com','38203','MH Marshall Islands',1); -INSERT INTO Shops (Shop_Name, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ('Mraz, Bahringer and Luettgen','MrazBahringerandLuettgen.com','5367','UA Ukraine',2); -INSERT INTO Shops (Shop_Name, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ('Koepp and Sons','KoeppandSons.com','17268','GM Gambia',2); -INSERT INTO Shops (Shop_Name, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ('Murazik - Sanford','MurazikSanford.com','37089','RW Rwanda',1); -INSERT INTO Shops (Shop_Name, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ('Anderson - Franecki','AndersonFranecki.com','25125','SZ Swaziland',2); -INSERT INTO Shops (Shop_Name, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ('Erdman - Shields','ErdmanShields.com','35306','GM Gambia',2); +INSERT INTO Shops (Shop_Name, Shop_Description, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ("Sauer, Rath and Pagac","","SauerRathandPagac.com","26076","MV Maldives",1); +INSERT INTO Shops (Shop_Name, Shop_Description, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ("Feil - Bernier","","FeilBernier.com","5489","GY Guyana",1); +INSERT INTO Shops (Shop_Name, Shop_Description, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ("Schmitt LLC","","SchmittLLC.com","7236","AM Armenia",1); +INSERT INTO Shops (Shop_Name, Shop_Description, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ("VonRueden LLC","","VonRuedenLLC.com","17625","CG Congo",1); +INSERT INTO Shops (Shop_Name, Shop_Description, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ("Turner - Tremblay","","TurnerTremblay.com","9752","MD Moldova Republic Of",2); +INSERT INTO Shops (Shop_Name, Shop_Description, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ("Quigley - Ward","","QuigleyWard.com","34854","KN Saint Kitts And Nevis",1); +INSERT INTO Shops (Shop_Name, Shop_Description, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ("Cole Inc","","ColeInc.com","23118","NA Namibia",2); +INSERT INTO Shops (Shop_Name, Shop_Description, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ("Kemmer - Ferry","","KemmerFerry.com","5229","VU Vanuatu",2); +INSERT INTO Shops (Shop_Name, Shop_Description, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ("Blanda - Rogahn","","BlandaRogahn.com","8059","SA Saudi Arabia",2); +INSERT INTO Shops (Shop_Name, Shop_Description, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ("Torp, Christiansen and Lebsack","","TorpChristiansenandLebsack.com","7439","MS Montserrat",2); +INSERT INTO Shops (Shop_Name, Shop_Description, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ("Steuber - Denesik","","SteuberDenesik.com","26523","SC Seychelles",2); +INSERT INTO Shops (Shop_Name, Shop_Description, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ("Grimes - Satterfield","","GrimesSatterfield.com","19676","BN Brunei Darussalam",2); +INSERT INTO Shops (Shop_Name, Shop_Description, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ("Cummings, Hirthe and Auer","","CummingsHirtheandAuer.com","39813","BV Bouvet Island",1); +INSERT INTO Shops (Shop_Name, Shop_Description, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ("Hamill and Sons","","HamillandSons.com","36253","IR Iran Islamic Republic Of",2); +INSERT INTO Shops (Shop_Name, Shop_Description, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ("Simonis, Dare and Crona","","SimonisDareandCrona.com","3606","ER Eritrea",1); +INSERT INTO Shops (Shop_Name, Shop_Description, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ("Hilpert - White","","HilpertWhite.com","7188","SH Saint Helena",2); +INSERT INTO Shops (Shop_Name, Shop_Description, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ("Koepp - Walsh","","KoeppWalsh.com","2680","RE Reunion",1); +INSERT INTO Shops (Shop_Name, Shop_Description, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ("Bins, Hermann and Botsford","","BinsHermannandBotsford.com","9116","TH Thailand",2); +INSERT INTO Shops (Shop_Name, Shop_Description, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ("Bahringer and Sons","","BahringerandSons.com","31439","TW Taiwan Province Of China",1); +INSERT INTO Shops (Shop_Name, Shop_Description, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ("Wolff - Pfeffer","","WolffPfeffer.com","12512","LY Libyan Arab Jamahiriya",2); diff --git a/src/main/resources/database/Data Script/tablePopulator.py b/src/main/resources/database/Data Script/tablePopulator.py index 0d7211d0b57ed067aac46e9898f0b15cf93ba64f..e5af481852f28eebe7c66b7d70ab4903773b847f 100644 --- a/src/main/resources/database/Data Script/tablePopulator.py +++ b/src/main/resources/database/Data Script/tablePopulator.py @@ -72,7 +72,7 @@ def namePopulator(amount, userType): # print(current_user_id) # print(current_user_id+amount) stringInsert = str(current_user_id) + ',' + '1' + ',' + str(userType) - insertArray.append(createInsert(stringInsert, "UserPermissions", "User_ID, Shop_ID, Admin_Type_Id")) + insertArray.append(createInsert(stringInsert, "User_Permissions", "User_ID, Shop_ID, Admin_Type_Id")) current_user_id = current_user_id + 1 return insertArray @@ -113,8 +113,8 @@ def companyPopulator(amount): countryi = random.randint(0, len(countries)-1) - stringInsert = '"' + companyNames[i] + '","' + websiteArray[i] + '","' + str(earnings) + '","' + countries[countryi] + '",' + str(random.randint(1, 2)) - insertArray.append(createInsert(stringInsert, "Shops", "Shop_Name, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active")) + stringInsert = '"' + companyNames[i] + '","' + "" + '","' + websiteArray[i] + '","' + str(earnings) + '","' + countries[countryi] + '",' + str(random.randint(1, 2)) + insertArray.append(createInsert(stringInsert, "Shops", "Shop_Name, Shop_Description, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active")) return insertArray diff --git a/src/main/resources/database/schema.sql b/src/main/resources/database/schema.sql index 967bc75b43fe67939108cd53ff0ed16598f4cfa7..715ad01a47321b31550285838de91df8017118c1 100644 --- a/src/main/resources/database/schema.sql +++ b/src/main/resources/database/schema.sql @@ -1,6 +1,3 @@ -SET MODE MYSQL; -SET IGNORECASE=TRUE; - -- ----------------------------------------------------- -- ----------------------------------------------------- -- Schema mydb @@ -25,6 +22,7 @@ CREATE TABLE IF NOT EXISTS `mydb`.`Two_Factor_Methods` ( CREATE TABLE IF NOT EXISTS `mydb`.`Shops` ( `Shop_Id` INT NOT NULL AUTO_INCREMENT, `Shop_Name` VARCHAR(45) NOT NULL, + `Shop_Description` VARCHAR(250) NOT NULL, `Shop_Website` VARCHAR(45) NOT NULL, `Shop_Earnings` INT NOT NULL, `Shop_Countries` VARCHAR(150) NOT NULL, @@ -237,8 +235,10 @@ CREATE TABLE IF NOT EXISTS `mydb`.`User_Stamp_Boards` ( INSERT INTO two_factor_methods (`Two_Factor_Method_Id`, `Two_Factor_Method_Name`) VALUES (1, 'None'); INSERT INTO two_factor_methods (`Two_Factor_Method_Id`, `Two_Factor_Method_Name`) VALUES (2, 'GAuth'); -INSERT INTO Shops (Shop_Name, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ('','',0,'',0); +INSERT INTO Shops (Shop_Name, Shop_Description, Shop_Website, Shop_Earnings, Shop_Countries, Shop_Active) VALUES ('','','',0,'',0); INSERT INTO Admin_Types (Admin_Type_Id, Admin_Type_Name) VALUES (1,'User'); INSERT INTO Admin_Types (Admin_Type_Id, Admin_Type_Name) VALUES (2,'Business Admin'); -INSERT INTO Admin_Types (Admin_Type_Id, Admin_Type_Name) VALUES (3,'Super Admin'); \ No newline at end of file +INSERT INTO Admin_Types (Admin_Type_Id, Admin_Type_Name) VALUES (3,'Super Admin'); + +INSERT INTO Tags (Tag_Name) VALUES ('Football'); \ No newline at end of file diff --git a/src/main/resources/static/css/business_container.css b/src/main/resources/static/css/business_container.css new file mode 100644 index 0000000000000000000000000000000000000000..d0acaebaadb599d5bb69383207f84491bf7cf994 --- /dev/null +++ b/src/main/resources/static/css/business_container.css @@ -0,0 +1,28 @@ +.business_container{ + border-radius: 20px; + display: flex; + justify-content: center; + flex-direction: column; + align-items: center; + width: 320px; + padding: 0; + margin: 20px; +} + +.business_container .image{ + width: 100%; + height: 80px; + border-top-right-radius: 20px; + border-top-left-radius: 20px; + background-color: saddlebrown; + background-position: center; /* Center the image */ + background-repeat: no-repeat; /* Do not repeat the image */ + background-size: cover; +} + +.business_container .content{ + border-bottom-right-radius: 20px; + border-bottom-left-radius: 20px; + width: 100%; + padding: 10px 15px; +} \ No newline at end of file diff --git a/src/main/resources/static/css/category.css b/src/main/resources/static/css/category.css new file mode 100644 index 0000000000000000000000000000000000000000..12ea21b040d619f55764ba312f1577861aca0b6c --- /dev/null +++ b/src/main/resources/static/css/category.css @@ -0,0 +1,45 @@ +.MainText { + float: left; + width: 100%; + height: 12vh; + text-align: center; + color: white; + font-size: 45px; + font-weight: bold; + background: rgb(1,126,255); + background: linear-gradient(90deg, rgba(0,76,255,1) 0%, rgba(1,126,255,1) 100%); +} + +.submit { + position: absolute; + background: rgb(1,126,255); + color: white !important; + width: 150px; + font-size: 15px; + margin: 10px; + background: transparent; + border-width: 2px; + border-color: white !important; + right: 20px; + top: 7px; +} + +.submit:hover{ + background: #0050ff; +} + +.categoyContainer { + float: left; + display: flex; + flex-wrap: wrap; +} + +.category-Button { + background: rgb(1,126,255); + color: white !important; + padding-left: 15px; + padding-right: 15px; + margin: 10px; +} + +body {background-color: #ededed;} diff --git a/src/main/resources/static/css/index.css b/src/main/resources/static/css/index.css index 88da082df27afdb606becc3d53dcf9d32247e281..180efd08c092800c6d3c6aaf788fc0a5d53009a9 100644 --- a/src/main/resources/static/css/index.css +++ b/src/main/resources/static/css/index.css @@ -8,6 +8,20 @@ white-space: nowrap; } -.horiz_scroll *{ - display: inline-block; +.horiz_scroll > *{ + display: inline-flex; } + +i.fas{ + color: gray; +} + +.gradient{ + background: rgb(1,126,255); + background: linear-gradient(90deg, rgba(1,126,255,1) 0%, rgba(0,76,255,1) 100%); + color: white!important; +} + +.gradient i{ + color: white!important; +} \ No newline at end of file diff --git a/src/main/resources/static/css/nav.css b/src/main/resources/static/css/nav.css index 4c88df3f8930dfe0e08e8c554b8ca524df9ad461..f2d676d598dda76550f9cfab79f9a2081421396a 100644 --- a/src/main/resources/static/css/nav.css +++ b/src/main/resources/static/css/nav.css @@ -30,4 +30,5 @@ nav{ .navbar-item.has-dropdown.is-active .navbar-link, .navbar-item.has-dropdown:focus .navbar-link, .navbar-item.has-dropdown:hover .navbar-link { background-color: transparent; } -} \ No newline at end of file +} + diff --git a/src/main/resources/static/css/registerbusiness.css b/src/main/resources/static/css/registerbusiness.css index 834dbe50403fa7b96acc7cc920dd28b9f8d2588c..f0dcc058f06195d9e031827d1695dd326f7988e0 100644 --- a/src/main/resources/static/css/registerbusiness.css +++ b/src/main/resources/static/css/registerbusiness.css @@ -78,6 +78,18 @@ url-centering{ #categoryContainer{ width:100%; display: flex; - flex-direction: row; + flex-direction: column; justify-content: center; + align-items: center; +} + +.socialInput{ + width:100%; + margin-right:5%; +} + +.socialContainer{ + display: flex; + flex-direction: row; + justify-content: flex-start; } \ No newline at end of file diff --git a/src/main/resources/static/css/reward_card.css b/src/main/resources/static/css/reward_card.css index 7f0a034f1332cb6d502fe9da0b9d8d35eb55b235..27fd580a7948aab1dcc3ef401b225c4e4794f145 100644 --- a/src/main/resources/static/css/reward_card.css +++ b/src/main/resources/static/css/reward_card.css @@ -1,3 +1,28 @@ .reward_card{ border-radius: 20px; + background-color: #e3e3e3; + width: 360px; + display: inline-flex; + flex-direction: row; + margin-right: 20px; +} + +.reward_card_content{ + height: 100%; + width: 70%; + padding: 10px 15px; + display: flex; + flex-direction: column; +} + +.reward_card_img{ + display: flex; + flex: 1; + width: 30%; + background-color: red; + border-bottom-right-radius: 20px; + border-top-right-radius: 20px; + background-position: center; /* Center the image */ + background-repeat: no-repeat; /* Do not repeat the image */ + background-size: cover; } \ No newline at end of file diff --git a/src/main/resources/static/css/signUp.css b/src/main/resources/static/css/signUp.css new file mode 100644 index 0000000000000000000000000000000000000000..c64bda2607c28c2d234e83f2e01f8316c2dbd57f --- /dev/null +++ b/src/main/resources/static/css/signUp.css @@ -0,0 +1,103 @@ +.flex-container { + display: flex; + height: 100vh; +} + +.vert-flex-container { + display: flex; + height: inherit; + flex-direction: column; + justify-content:center; + align-items:center; +} + +.name-box-container { + justify-content: space-between; + align-items: center; + height: auto; + width: 50% +} + +.loginPart { + background: rgb(1,126,255); + background: linear-gradient(90deg, rgba(1,126,255,1) 0%, rgba(0,76,255,1) 100%); + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + position: relative; +} + +h1 { + color: rgb(1,126,255); + font-size: 35px; + text-align: center; + margin-bottom: 20px; +} + +input { + color: #f4f8f7; +} + +.top-and-bottom-margin { + margin-top: 10px; + margin-bottom: 10px; +} + +.small-name-box { + margin-top: 10px; + margin-bottom: 10px; + width:46%; + background-color: #f4f8f7; +} + +.large-input-box { + margin: 10px; + width: 50%; + background-color: #f4f8f7; +} + +.signUp-Button { + margin: 10px; + background-color: rgb(1,126,255); + color: white; + width: 140px; +} + +h2 { + font-size: 40px; + font-family: sans-serif; + color: white; + font-weight: bold; + text-align: center; + margin-bottom: 20px; +} + +.special-text { + font-size: 35px; + font-family: sans-serif; + color: white; + margin-bottom: 20px; + text-align: center; + font-weight: 100; +} + +.loginUp-Button { + margin: 10px; + background-color: transparent; + border-color: white; + color: white !important; + width: 140px; + border-width: 2px; + font-weight: bold; +} + +.logo { + position: absolute !important; + top: 40px !important; +} + +img { + position: absolute !important; + top: 40px !important; +} diff --git a/src/main/resources/static/imgs/coffee.jpg b/src/main/resources/static/imgs/coffee.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4ad656e196e3c8bff2d194f0e1565ed2b1aaa766 Binary files /dev/null and b/src/main/resources/static/imgs/coffee.jpg differ diff --git a/src/main/resources/static/imgs/coke.jpg b/src/main/resources/static/imgs/coke.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d9929ae40587cdfa1f6c5e3d02552e0a92728968 Binary files /dev/null and b/src/main/resources/static/imgs/coke.jpg differ diff --git a/src/main/resources/static/js/registerbusiness.js b/src/main/resources/static/js/registerbusiness.js index 1a2af059dff477e4d5678a0968fe591b2751c277..ab72239cfba83f1c50dffd0ac0b56b7ed98c8700 100644 --- a/src/main/resources/static/js/registerbusiness.js +++ b/src/main/resources/static/js/registerbusiness.js @@ -1,4 +1,10 @@ var modalStage = 0 +var urlInput, urlPrefixInput, nameInput, descInput = null; + +function htmlDecode(input) { + var doc = new DOMParser().parseFromString(input, "text/html"); + return doc.documentElement.textContent; +} function setLoadingBar(){ let progressAmount = (modalStage+1)*20 @@ -11,19 +17,61 @@ function setLoadingBar(){ } function progress(){ + urlInput = document.getElementById("business_register_url"); + urlPrefixInput = document.getElementById("business_register_url_prefix"); + nameInput = document.getElementById("business_register_name"); + descInput = document.getElementById("business_register_desc"); + + if(document.getElementById("forwardButton").innerHTML == "Done"){ + document.getElementById("businessForm").submit(); + } + + if(modalStage==3) { + document.getElementById("forwardButton").innerHTML = "Done" + } + + if(modalStage<5){ modalStage += 1 + + if(modalStage == 1){ + nameInput.parentElement.classList.add("is-loading") + descInput.parentElement.classList.add("is-loading") + getBusinessInfo(urlPrefixInput.value + urlInput.value); + } let currentStageId = "modal_page" + modalStage.toString() let nextStageId = "modal_page"+ (modalStage+1).toString() let newHeight = (document.getElementById(nextStageId).offsetHeight)+40 document.getElementById("modal_container").style.height = newHeight.toString()+"px" - console.log(currentStageId) - console.log(document.getElementById(currentStageId)) - console.log(document.getElementById(currentStageId).style.transform) document.getElementById(currentStageId.toString()).style.transform = "translateX(-150%)" document.getElementById(nextStageId.toString()).style.transform = "translateX(0%)" } setLoadingBar() } + +function getBusinessInfo(url){ + fetch("http://localhost:8080/infoExtract?url=" + url) + .then(response => response.json()) + .then(data => handleInfo(data)); +} + +function handleInfo(data){ + nameInput.parentElement.classList.remove("is-loading") + descInput.parentElement.classList.remove("is-loading") + + let name = data.site_name; + let url = data.url; + let description = data.description; + if(description !== undefined){ + description = htmlDecode(unescape(description)); + } + + if(name !== undefined){ + nameInput.value = name; + } + if(description !== undefined){ + descInput.value = description; + } +} \ No newline at end of file diff --git a/src/main/resources/static/js/selectCategories.js b/src/main/resources/static/js/selectCategories.js new file mode 100644 index 0000000000000000000000000000000000000000..4f1141bf08e61e8b67c310279124feb02f6e9389 --- /dev/null +++ b/src/main/resources/static/js/selectCategories.js @@ -0,0 +1,14 @@ +const categoryID = 0; + +function toggle_onclick(categoryID){ + const selected = document.getElementById(categoryID); + const number = selected.value; + if (number == "0"){ + selected.style.backgroundColor = 'green' ; + selected.value = 1; + } else { + selected.style.backgroundColor = 'rgb(1,126,255)' ; + selected.value = 0; + } + +} \ No newline at end of file diff --git a/src/main/resources/templates/fragments/business_card.html b/src/main/resources/templates/fragments/business_card.html new file mode 100644 index 0000000000000000000000000000000000000000..4cd7da8746cdf745b84b119f99b20452de002460 --- /dev/null +++ b/src/main/resources/templates/fragments/business_card.html @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>Title</title> +</head> +<body th:fragment="business_card"> +<div class="business_container box"> + <div class="image" th:style="'background-image:url(' + ${img_path} + ');'"></div> + <div class="content"> + <h1 class="title is-4 mb-1" th:text="${title}"></h1> + <p class="mb-1" th:text="${reward_text}"></p> + <div class="is-full-width" style="display:flex;justify-content: space-between;align-items: center"> + <div class="level-left"> + <span class="icon is-small is-left ml-1 mr-1"> + <i class="fas fa-gift"></i> + </span> + <p th:text="${reward_amount}"></p> + </div> + <div class="level-right"> + <button class="button is-rounded gradient"> + View Shop + <span class="icon is-small is-left ml-1"> + <i class="fas fa-arrow-right"></i> + </span> + </button> + </div> + </div> + </div> +</div> +</body> +</html> \ No newline at end of file diff --git a/src/main/resources/templates/fragments/nav.html b/src/main/resources/templates/fragments/nav.html index 25f833adfb251f1e6b634838053ffc624b2c27ea..726855689af0193a31e6914dc40bdb483a414d78 100644 --- a/src/main/resources/templates/fragments/nav.html +++ b/src/main/resources/templates/fragments/nav.html @@ -20,36 +20,29 @@ <div id="ShopHubNav" class="navbar-menu"> <div class="navbar-start"> <a class="navbar-item" href="/">Dashboard</a> - <a class="navbar-item" href="/register">Register</a> </div> <div class="navbar-end"> <div class="navbar-item has-dropdown is-hoverable"> - <div th:if="${loggedIn}"> - <a class="navbar-link"> - Hi Alice! - <div class="nav_profile_img" style="background-image: url('imgs/profile.jpg')"></div> - </a> - - <div class="navbar-dropdown is-right"> - <a class="navbar-item"> - <span class="icon mr-2"><i class="fas fa-cog"></i></span> - Settings - </a> - <a class="navbar-item"> - <span class="icon mr-2"><i class="fas fa-briefcase"></i></span> - Business - </a> - <hr class="navbar-divider"> - <a class="navbar-item"> - <span class="icon mr-2"><i class="fas fa-sign-out-alt"></i></span> - Log Out - </a> - </div> - </div> + <a class="navbar-link"> + Hi Alice! + <div class="nav_profile_img" style="background-image: url('imgs/profile.jpg')"></div> + </a> - <div th:if="!loggedIn"> - <a class="navbar-link" href="/login">Login</a> + <div class="navbar-dropdown is-right"> + <a class="navbar-item"> + <span class="icon mr-2"><i class="fas fa-cog"></i></span> + Settings + </a> + <a class="navbar-item" href="/businessRegister"> + <span class="icon mr-2"><i class="fas fa-briefcase"></i></span> + Business + </a> + <hr class="navbar-divider"> + <a class="navbar-item"> + <span class="icon mr-2"><i class="fas fa-sign-out-alt"></i></span> + Log Out + </a> </div> </div> </div> diff --git a/src/main/resources/templates/fragments/reward_card.html b/src/main/resources/templates/fragments/reward_card.html new file mode 100644 index 0000000000000000000000000000000000000000..cb3b15b20b72946c7a390d158a0aa38ccefb6255 --- /dev/null +++ b/src/main/resources/templates/fragments/reward_card.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>Title</title> +</head> +<body th:fragment="reward_card"> +<div class="reward_card"> + <div class="reward_card_content"> + <h1 class="title is-4 mb-1" th:text="${title}"></h1> + <p class="mb-1" th:text="'You have ' + ${stamps} + ' stamps!'"></p> + <progress class="progress mb-1" th:value="${stamps}" th:max="${next_reward}"></progress> + <p class="mb-2" th:text="${next_reward}-${stamps} + ' to next reward'"></p> + <div class="is-full-width" style="display:flex;justify-content: space-between;align-items: center"> + <div class="level-left"> + <span class="icon is-small is-left ml-1 mr-1"> + <i class="fas fa-gift"></i> + </span> + <p th:text="${reward_amount_obtained} + '/' + ${total_reward_amount}"></p> + </div> + <div class="level-right"> + <button class="button is-rounded"> + Explore + <span class="icon is-small is-left ml-1"> + <i class="fas fa-arrow-right"></i> + </span> + </button> + </div> + </div> + </div> + <div class="reward_card_img" th:style="'background-image:url(' + ${img_path} + ');'"></div> +</div> +</body> +</html> \ No newline at end of file diff --git a/src/main/resources/templates/fragments/tag.html b/src/main/resources/templates/fragments/tag.html new file mode 100644 index 0000000000000000000000000000000000000000..1810a0b4619164964e6b38a92249a09cd86450b1 --- /dev/null +++ b/src/main/resources/templates/fragments/tag.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>Title</title> +</head> +<body th:fragment="tag"> +<div class="control mr-3"> + <div class="tags has-addons"> + <span class="tag gradient" th:text="${text}"></span> + <a class="tag is-delete"></a> + </div> +</div> +</body> +</html> \ No newline at end of file diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 120fc3c52297a24be811266a4c37d35b649da41b..2319ceca5c4eaf70deacef9fa5a7e12de4efb37b 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -1,4 +1,4 @@ -<!DOCTYPE html> + <!DOCTYPE html> <html> <head> <title>ShopHub | Dashboard</title> @@ -7,6 +7,7 @@ <link th:replace="fragments/nav.html :: nav-css"/> <link rel="stylesheet" href="/css/index.css"> <link rel="stylesheet" href="/css/reward_card.css"> + <link rel="stylesheet" href="/css/business_container.css"> </head> <body> <div th:replace="fragments/nav.html :: nav"></div> @@ -14,7 +15,7 @@ <div class="container"> <div class="rewards_container_top level"> <div class="level-left"> - <h1 class="title is-1">My rewards</h1> + <h1 class="title is-2">My rewards</h1> </div> <div class="level-right"> <div class="control has-icons-left"> @@ -26,12 +27,50 @@ </div> </div> <div class="horiz_scroll is-full-width mb-1"> - <div class="reward_card"> - - </div> + <!--Reward Card Here--> + <div th:replace="fragments/reward_card.html :: reward_card( + title='Coca Cola', + stamps=6, + next_reward=8, + reward_amount_obtained=2, + total_reward_amount=5, + img_path='imgs/coke.jpg' + )"></div> + <div th:replace="fragments/reward_card.html :: reward_card( + title='Cafe Nero', + stamps=2, + next_reward=4, + reward_amount_obtained=0, + total_reward_amount=4, + img_path='imgs/coffee.jpg' + )"></div> </div> + <a href="/">See All ></a> </div> </div> + <div class="search_bar section"> + <div class="container is-full-width is-flex is-justify-content-center is-align-items-center is-flex-direction-column mb-4"> + <h1 class="title is-3">Where else can I earn rewards?</h1> + <div class="control has-icons-left mb-2" style="width: 60%;"> + <input class="input" type="text" placeholder="Enter Brands or keywords e.g. Vegan, Clothing etc.."> + <span class="icon is-small is-left"> + <i class="fas fa-search"></i> + </span> + </div> + <!--Tags--> + <div class="field is-grouped is-grouped-multiline" style="width: 60%;"> + <div th:each="tag: ${tags}" th:include="fragments/tag.html :: tag" + th:with="text=${tag}"></div> + </div> + </div> + + <div class="container is-full-width is-flex is-justify-content-center is-align-items-center is-flex-wrap-wrap"> + <div th:each="shop,i: ${shops}" th:include="fragments/business_card.html :: business_card" + th:with="title=${shop.shopName}, reward_text='Free coffee at 6 stamps', reward_amount=4, + img_path=${shop.shopImage}"></div> + </div> + + </div> </body> </html> \ No newline at end of file diff --git a/src/main/resources/templates/registerbusiness.html b/src/main/resources/templates/registerbusiness.html index 3aadbdf8a2ecc4cd2c70fb1363a8d0b7ac3d9b69..4f2ba5b4b3fb80d654c912dece469e5197c27743 100644 --- a/src/main/resources/templates/registerbusiness.html +++ b/src/main/resources/templates/registerbusiness.html @@ -28,56 +28,133 @@ <div id="progressBar" class="progressBar"> <div style="width:20%"></div> </div> + <form id="businessForm" action="/businessRegister" th:method="post"> <section class="modal-card-body url-centering" id="modal_container"> - <div id="modal_page1" class="modal_page"> - <h5 class="title is-5" style="text-align:center">Enter your shop URL</h5> - <p class="control has-icons-left" style="min-width:50%; width:70%; margin:auto"> - <input class="input" type="url" placeholder="Business URL" style="width:100%; align-content:center"> - <span class="icon is-small is-left"> - <i class="fas fa-link"></i> - </span> - </p> - </div> - <div id="modal_page2" class="modal_page"> - <h5 class="title is-5" style="text-align:center">Shop Name</h5> - <p class="control has-icons-left" style="min-width:50%; width:70%; margin:auto"> - <input class="input" style="width:100%; align-content:center"> - <span class="icon is-small is-left"> - <i class="fas fa-store"></i> - </span> - </p> - <h5 class="title is-5" style="text-align:center">Description</h5> - <p class="control has-icons-left" style="min-width:50%; width:70%; margin:auto"> - <textarea class="textarea"></textarea> - </p> - </div> - <div id="modal_page3" class="modal_page"> - <h5 class="title is-5" style="text-align:center; margin-bottom: 2%">Choose a category</h5> - <div id="categoryContainer"> - <div class="dropdown is-hoverable"> - <div class="dropdown-trigger"> - <button class="button" aria-haspopup="true" aria-controls="dropdown-menu4"> - <span>Categories</span> - <span class="icon is-small"> - <i class="fas fa-angle-down" aria-hidden="true"></i> - </span> - </button> - </div> - <div class="dropdown-menu" id="dropdown-menu4" role="menu"> - <div class="dropdown-content"> - <div th:each="category: ${categories}" class="dropdown-item"> - <a th:text="${category}"></a> - </div> - </div> + <div id="modal_page1" class="modal_page"> + <h5 class="title is-5" style="text-align:center">Enter your shop URL</h5> + <div class="field has-addons" style="display: flex;justify-content: center"> + <p class="control"> + <span class="select"> + <select id="business_register_url_prefix"> + <option>https://</option> + <option>http://</option> + </select> + </span> + </p> + <p class="control"> + <input class="input" type="url" name="business_register_url" placeholder="Business URL" style="width:100%; align-content:center" + id="business_register_url"> + </p> + </div> + </div> + <div id="modal_page2" class="modal_page"> + <h5 class="title is-5" style="text-align:center">Shop Name</h5> + <p class="control has-icons-left" style="min-width:50%; width:70%; margin:auto"> + <input class="input" style="width:100%; align-content:center" id="business_register_name" name="business_register_name"> + <span class="icon is-small is-left"> + <i class="fas fa-store"></i> + </span> + </p> + <h5 class="title is-5" style="text-align:center; margin-bottom:5%; margin-top:5%">Description</h5> + <p class="control has-icons-left" style="min-width:50%; width:70%; margin:auto"> + <textarea class="textarea" name="business_register_desc" id="business_register_desc"></textarea> + </p> + </div> + <div id="modal_page3" class="modal_page"> + <h5 class="title is-5" style="text-align:center; margin-bottom: 2%">Choose a category</h5> + <div id="categoryContainer"> + <div class="select" name="businessCategory"> + <select> + <option th:each="category: ${categories}" th:text="${category}"></option> + </select> </div> </div> + <h5 class="title is-5" style="text-align:center; margin-bottom: 2%">Add tags that describe your business</h5> + <div style="width:100%;"> + <!-- Need to fix this, shouldn't be full width of modal --> + <textarea name="businessTags" maxlength="50" style="width:75%;" class="textarea" rows="2"></textarea> + </div> + </div> + <div id="modal_page4" class="modal_page"> + <h5 class="title is-5" style="text-align:center">Social Media Links</h5> - </div> + <div class="socialContainer"> + <span class="icon is-large is-left"> + <i class="fab fa-instagram"></i> + </span> + <div class="field has-addons" style="display: flex;justify-content: center"> + <p class="control"> + <input value="instagram.com/" class="input" disabled> + </p> + <p class="control"> + <input class="input" name="instagram" type="url" style="width:100%; align-content:center"> + </p> + </div> + <!-- <input class="input socialInput">--> + </div> + <div class="socialContainer"> + <span class="icon is-large is-left"> + <i class="fab fa-facebook-f"></i> + </span> + <div class="field has-addons" style="display: flex;justify-content: center"> + <p class="control"> + <input value="facebook.com/" class="input" disabled> + </p> + <p class="control"> + <input class="input" name="facebook" type="url" style="width:100%; align-content:center"> + </p> + </div> + <!-- <input class="input socialInput">--> + </div> + <div class="socialContainer"> + <span class="icon is-large is-left"> + <i class="fab fa-twitter"></i> + </span> + <div class="field has-addons" style="display: flex;justify-content: center"> + <p class="control"> + <input value="twitter.com/" class="input" disabled> + </p> + <p class="control"> + <input class="input" name="twitter" type="url" style="width:100%; align-content:center"> + </p> + </div> + <!-- <input class="input socialInput">--> + </div> + <div class="socialContainer"> + <span class="icon is-large is-left"> + <i class="fab fa-tiktok"></i> + </span> + <div class="field has-addons" style="display: flex;justify-content: center"> + <p class="control"> + <input value="tiktok.com/@" class="input" disabled> + </p> + <p class="control"> + <input class="input" name="tiktok" type="url" style="width:100%; align-content:center"> + </p> + </div> + <!-- <input class="input socialInput">--> + </div> + </div> + <div id="modal_page5" class="modal_page"> + <h5 class="title is-5" style="text-align:center">Average Monthly Sales</h5> + <div class="socialContainer"> + <p class="control has-icons-left" style="min-width:50%; width:70%; margin:auto"> + <span class="icon is-large is-left"> + <i class="fas fa-pound-sign"></i> + </span> + <input class="input socialInput" name="earnings" style="margin-bottom:5%"> + </p> + </div> + <p class="subtitle is-5" style="text-align: center; font-size:10px"> + We need to know this, so we can accurately start you on the correct pricing tier + </p> + </div> </section> <footer class="modal-card-foot modal-footer"> - <button class="button is-success" onclick="progress();">Next</button> + <button id="forwardButton" class="button is-success" onclick="progress();">Next</button> </footer> + </form> </div> </div> </body> diff --git a/src/main/resources/templates/selectCategories.html b/src/main/resources/templates/selectCategories.html new file mode 100644 index 0000000000000000000000000000000000000000..a8f7d8c4d96705b6ae11840c382e7a339c2026ac --- /dev/null +++ b/src/main/resources/templates/selectCategories.html @@ -0,0 +1,37 @@ +<!DOCTYPE html> +<link rel="stylesheet" type="text/css" href="css/bulma.min.css"> +<link rel="stylesheet" type="text/css" href="css/category.css"> +<script src="/js/selectCategories.js"></script> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>Categories</title> +</head> +<body> + <div class="MainText">Pick 3 categories or more + <img style="position: absolute; top: 20px; left: 20px;" src="imgs/Logo.png" width="112" height="28" class="logo"> + </div> + <button class="button submit">Submit</button> + <div class="categoyContainer" th:with="mycounter = 0"> + <button th:each="allTags : ${shopTags}" th:with="mycounter=${mycounter + 1}" onclick="toggle_onclick(${mycounter})" type="submit" id="${mycounter}" value="0" class="button is-rounded category-Button" th:text="${shopTags}"></button> + <!-- toggle_onclick("have server automatically pass ID here"), and also for id="" --> + <button type="submit" class="button is-rounded category-Button">Furniture</button> + <button type="submit" class="button is-rounded category-Button">Coffee</button> + <button type="submit" class="button is-rounded category-Button">Cooking</button> + <button type="submit" class="button is-rounded category-Button">Electronics</button> + <button type="submit" class="button is-rounded category-Button">Cars</button> + <button type="submit" class="button is-rounded category-Button">Clothing</button> + + + <tr th:each="charity : ${matches}"> + <th scope="row"> + <a th:id="@{charityLink{id} (id=${charity.id})}" + th:href="@{/charity/{id} (id=${charity.id})}"> + <span th:text="${charity.name}"></span> + </a> + </th> + <td th:text="${charity.registrationNumber}"></td> + </tr> + +</body> +</html> diff --git a/src/main/resources/templates/signUp.html b/src/main/resources/templates/signUp.html new file mode 100644 index 0000000000000000000000000000000000000000..8d12460f825c8d7c8b6c699a5f244df4cc45fed3 --- /dev/null +++ b/src/main/resources/templates/signUp.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<meta name="viewport" content="width=device-width, initial-scale=1"> + <link rel="stylesheet" type="text/css" href="css/bulma.min.css"> + <link rel="stylesheet" type="text/css" href="css/signUp.css"> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>SignUp</title> +</head> + +<body> + <div class="flex-container"> + <div class="vert-flex-container" style="flex-grow: 3;"> + <h1 class="has-text-weight-bold">Start collecting rewards <br>today!</h1> + <form action="/signup" th:method="post"> + <div class="flex-container name-box-container"> + <input class="input small-name-box" type="text" placeholder="Name" id="name" name="name"/> + <input class="input small-name-box" type="text" placeholder="Surname" id="surname" name="surname"/> + </div> + <input class="input large-input-box" type="email" placeholder="Email" id="email" name="email"/> + <input class="input large-input-box" type="password" placeholder="Password" id="password" name="password"/> + <button type="submit" class="button is-rounded signUp-Button">Sign Up</button> + </form> + </div> + <div class="loginPart" style="flex-grow: 4;"> + <img style="position: absolute; top: 45px" src="imgs/Logo.png" width="112" height="28" class="logo"> + <h2>Welcome!</h2> + <h3 class="special-text">Already a member of <br>ShopHub?<h3> + <button class="button is-rounded loginUp-Button">Sign in</button> + </div> + + </div> +</body> +</html> diff --git a/src/test/java/com/example/clientproject/data/shops/ShopsTests.java b/src/test/java/com/example/clientproject/data/shops/ShopsTests.java index 1ccb255aba1d5f727acc3443e2692ee449eb9799..0fd569e0acaff07f40922d1edcce1c2f7f43193b 100644 --- a/src/test/java/com/example/clientproject/data/shops/ShopsTests.java +++ b/src/test/java/com/example/clientproject/data/shops/ShopsTests.java @@ -27,7 +27,7 @@ public class ShopsTests { @Test public void shouldGet12ShopsAfterInsert() throws Exception { - Shops newShop = new Shops("", "", 0, "", "", true); + Shops newShop = new Shops("", "", "", 0, "", "", true); Shops shop = shopsRepo.save(newShop); List<Shops> shopsList = shopsRepo.findAll(); diff --git a/src/test/java/com/example/clientproject/data/userPermissions/UserPermissionsTests.java b/src/test/java/com/example/clientproject/data/userPermissions/UserPermissionsTests.java index 08cf7318421a298abcf3bd495ab9fcf346dd2f6b..ca22e74590709696dafbf95e20bbc12a897cd913 100644 --- a/src/test/java/com/example/clientproject/data/userPermissions/UserPermissionsTests.java +++ b/src/test/java/com/example/clientproject/data/userPermissions/UserPermissionsTests.java @@ -45,7 +45,7 @@ public class UserPermissionsTests { @Test public void shouldGet158PermissionsAfterInsert() throws Exception { - Shops newShop = new Shops("", "", 0, "", "", true); + Shops newShop = new Shops("", "", "", 0, "", "", true); shopsRepo.save(newShop); TwoFactorMethods twoFactorMethods = twoFactorMethodsRepo.findByTwoFactorMethodId(1).get(); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); diff --git a/src/test/java/com/example/clientproject/data/users/UsersTests.java b/src/test/java/com/example/clientproject/data/users/UsersTests.java index 8909ea7ab78d41ad568d2e887512ddf99cca9438..c803900290e4a06b1cea98e48188c4ba3a1a8af5 100644 --- a/src/test/java/com/example/clientproject/data/users/UsersTests.java +++ b/src/test/java/com/example/clientproject/data/users/UsersTests.java @@ -44,3 +44,4 @@ public class UsersTests { assertEquals(161, usersList.size()); } } +