Index: src/main/java/com/example/web/HomeController.java
===================================================================
--- src/main/java/com/example/web/HomeController.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
+++ src/main/java/com/example/web/HomeController.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
@@ -0,0 +1,85 @@
+package com.example.web;
+
+import com.example.model.Enumerations.Status;
+import com.example.model.Event;
+import com.example.service.BandService;
+import com.example.service.CateringService;
+import com.example.service.EventService;
+import com.example.service.PhotographerService;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.List;
+
+@Controller
+@RequestMapping(value = {"/", "/home"})
+public class HomeController {
+
+    private final EventService eventService;
+
+    private final BandService bandService;
+    private final PhotographerService photographerService;
+    private final CateringService cateringService;
+
+    public HomeController(EventService eventService, BandService bandService,
+                          PhotographerService photographerService, CateringService cateringService) {
+        this.eventService = eventService;
+        this.bandService = bandService;
+        this.photographerService = photographerService;
+        this.cateringService = cateringService;
+    }
+
+
+    @GetMapping
+    public String getHomePage() {
+        return "home";
+    }
+
+    @GetMapping("/event/{id}")
+    public String getEventInfo(@PathVariable Integer id, Model model) {
+        Event event = eventService.findById(id);
+
+        List<String> bandList = new ArrayList<>();
+        for (int i = 0; i < event.getBandList().size(); i++) {
+            bandList.add(event.getBandList().get(i).getName());
+        }
+
+        List<String> cateringList = new ArrayList<>();
+        for (int i = 0; i < event.getCateringList().size(); i++) {
+            cateringList.add(event.getCateringList().get(i).getName());
+        }
+
+        List<String> photographerList = new ArrayList<>();
+        for (int i = 0; i < event.getPhotographerList().size(); i++) {
+            photographerList.add(event.getPhotographerList().get(i).getName());
+        }
+
+        model.addAttribute("event", event);
+        model.addAttribute("bandList", bandList);
+        model.addAttribute("cateringList", cateringList);
+        model.addAttribute("photographerList", photographerList);
+        return "more_details";
+    }
+
+    @PostMapping("/approveEvent/{id}")
+    public String  approveEvent(@PathVariable Integer id, HttpServletResponse response){
+        Event event = eventService.findById(id);
+        event.setStatus(Status.APPROVED);
+        eventService.update(event);
+        return "redirect:/my_events";
+    }
+
+    @PostMapping("/rejectEvent/{id}")
+    public String  rejectEvent(@PathVariable Integer id, HttpServletResponse response){
+        Event event = eventService.findById(id);
+        event.setStatus(Status.REJECTED);
+        eventService.update(event);
+        return "redirect:/my_events";
+    }
+}
Index: src/main/java/com/example/web/HostEventController.java
===================================================================
--- src/main/java/com/example/web/HostEventController.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
+++ src/main/java/com/example/web/HostEventController.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
@@ -0,0 +1,126 @@
+package com.example.web;
+
+import com.example.model.*;
+import com.example.repository.*;
+import com.example.service.UserService;
+import org.springframework.format.annotation.DateTimeFormat;
+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.RequestParam;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import javax.transaction.Transactional;
+import java.time.LocalDate;
+import java.util.List;
+import java.util.NoSuchElementException;
+
+@Controller
+public class HostEventController {
+
+    private final EventRepository eventRepository;
+    private final UserRepository userRepository;
+    private final LocationRepository locationRepository;
+    private final ClientRepository clientRepository;
+    private final BandRepository bandRepository;
+    private final CateringRepository cateringRepository;
+    private final PhotographerRepository photographerRepository;
+    private final UserService userService;
+
+    private final WaiterRepository waiterRepository;
+    public HostEventController(EventRepository eventRepository, UserRepository userRepository,
+                               LocationRepository locationRepository, ClientRepository clientRepository,
+                               BandRepository bandRepository, CateringRepository cateringRepository,
+                               PhotographerRepository photographerRepository, UserService userService, WaiterRepository waiterRepository) {
+        this.eventRepository = eventRepository;
+        this.userRepository = userRepository;
+        this.locationRepository = locationRepository;
+        this.clientRepository = clientRepository;
+        this.bandRepository = bandRepository;
+        this.cateringRepository = cateringRepository;
+        this.photographerRepository = photographerRepository;
+        this.userService = userService;
+        this.waiterRepository = waiterRepository;
+    }
+
+    @GetMapping("/host_event")
+    public String getHostEventPage(Model model) {
+        model.addAttribute("locations", locationRepository.findAll());
+        model.addAttribute("bands", bandRepository.findAll());
+        model.addAttribute("caterings", cateringRepository.findAll());
+        model.addAttribute("photographers", photographerRepository.findAll());
+        return "host_event";
+    }
+
+    @Transactional
+    @PostMapping("/host_event")
+    public String handleHostEvent(@RequestParam String time,
+                                  @RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date,
+                                  @RequestParam String location,
+                                  @RequestParam String type,
+                                  @RequestParam(required = false) String description,
+                                  @RequestParam List<Band> bands,
+                                  @RequestParam List<Catering> caterings,
+                                  @RequestParam List<Photographer> photographers,
+                                  HttpServletRequest req,
+                                  HttpServletResponse resp,
+                                  HttpSession session) {
+        Event event = null;
+        try {
+            Location location2 = locationRepository.findByAddress(location);
+
+            User user = (User) userService.findByUsername((String) req.getSession().getAttribute("username")).get();
+            Client client = (Client) clientRepository.findById(user.getId()).get();
+            Admin admin = (Admin) userService.findByUsername("admin1").get();
+            admin.setNumber_events(admin.getNumber_events()+1);
+            client.setNumber_events(client.getNumber_events()+1);
+            eventRepository.save(new Event(time, date, location2, type, description, client, bands,caterings, photographers, admin));
+
+            return "redirect:/home?UspeshnoZakazanNastan";
+        } catch (Exception e) {
+            return "redirect:/?error=" + e.getMessage();
+        }
+    }
+
+    @GetMapping("/my_events")
+    public String getEventsForUser(HttpServletRequest req, Model model) {
+        User user = (User) userService.findByUsername((String) req.getSession().getAttribute("username")).get();
+        List<Event> events = null;
+        try {
+            Client client = (Client) clientRepository.findById(user.getId()).get();
+            events = client.getEvent();
+        }
+        catch (NoSuchElementException exception){
+            try{
+                Catering catering = (Catering) cateringRepository.findById(user.getId()).get();
+                events = catering.getEventList();
+            }
+            catch (NoSuchElementException exception1){
+                try {
+                    Band band = (Band) bandRepository.findById(user.getId()).get();
+                    events = band.getEventList();
+                }
+                catch (NoSuchElementException e){
+                    try{
+                        Photographer photographer = (Photographer) photographerRepository.findById(user.getId()).get();
+                        events = photographer.getEventList();
+                    }
+                    catch (NoSuchElementException exception2){
+                        try{
+                            Waiter waiter = (Waiter) waiterRepository.findById(user.getId()).get();
+                            events = waiter.getEventList();
+                        }
+                        catch (NoSuchElementException exception3){
+                            events = eventRepository.findAll();
+                        }
+                    }
+                }
+            }
+        }
+        model.addAttribute("events",events);
+        return "my_events";
+    }
+}
Index: src/main/java/com/example/web/LoginController.java
===================================================================
--- src/main/java/com/example/web/LoginController.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
+++ src/main/java/com/example/web/LoginController.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
@@ -0,0 +1,63 @@
+package com.example.web;
+
+import com.example.exceptions.InvalidUserCredentialsException;
+import com.example.exceptions.InvalidUsernameOrPasswordException;
+import com.example.model.User;
+import com.example.service.AuthService;
+import com.example.service.UserService;
+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.RequestParam;
+
+import javax.servlet.http.HttpServletRequest;
+
+@Controller
+public class LoginController {
+
+    private final AuthService authService;
+    private final UserService userService;
+
+    public LoginController(AuthService authService, UserService userService) {
+        this.authService = authService;
+        this.userService = userService;
+    }
+
+    @GetMapping("/login")
+    public String getLoginPage() {
+        return "login";
+    }
+
+    @PostMapping("/login")
+    public String handleLogin(@RequestParam String username,
+                              @RequestParam String password,
+                              HttpServletRequest request,
+                              Model model) {
+//                              HttpServletResponse resp) throws IOException {
+        User user = null;
+        try {
+            user = authService.login(username, password);
+            request.getSession().setAttribute("user", user);
+            request.getSession().setAttribute("username",username);
+            request.getSession().setAttribute("role",
+                    userService.findByUsername(username).get().getRole().toString());
+            System.out.println(request.getSession().getAttribute("role").toString());
+            return "redirect:/home";
+        } catch (InvalidUserCredentialsException exception) {
+            model.addAttribute("hasError", true);
+            model.addAttribute("error", exception.getMessage());
+            return "login";
+        } catch (InvalidUsernameOrPasswordException exception) {
+            model.addAttribute("hasError", true);
+            model.addAttribute("error", exception.getMessage());
+            return "login";
+        }
+    }
+
+    @GetMapping("/logout")
+    public String getLogout(HttpServletRequest request) {
+        request.getSession().invalidate();
+        return "redirect:/login";
+    }
+}
Index: src/main/java/com/example/web/RegisterController.java
===================================================================
--- src/main/java/com/example/web/RegisterController.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
+++ src/main/java/com/example/web/RegisterController.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
@@ -0,0 +1,169 @@
+package com.example.web;
+
+import com.example.exceptions.InvalidArgumentsException;
+import com.example.exceptions.NoSuchUsernameException;
+import com.example.model.Catering;
+import com.example.model.Enumerations.Role;
+import com.example.repository.CateringRepository;
+import com.example.service.AuthService;
+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.RequestParam;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.io.IOException;
+import java.util.Objects;
+
+@Controller
+public class RegisterController {
+
+    private final AuthService authService;
+
+    private final CateringRepository cateringRepository;
+
+
+    public RegisterController(AuthService authService, CateringRepository cateringRepository) {
+        this.authService = authService;
+        this.cateringRepository = cateringRepository;
+    }
+
+    @GetMapping("/register")
+    public String getRegistgerPage() {
+        return "register";
+    }
+
+    @PostMapping("/register")
+    public String handleRegister(@RequestParam String name,
+                                 @RequestParam String username,
+                                 @RequestParam String number,
+                                 @RequestParam String password,
+                                 @RequestParam String rpassword,
+                                 @RequestParam String role,
+                                 HttpSession session) {
+        session.setAttribute("username", username);
+        session.setAttribute("name", name);
+        session.setAttribute("password", password);
+        session.setAttribute("rpassword", rpassword);
+        session.setAttribute("number", number);
+        session.setAttribute("role", role);
+        if (Objects.equals(role, "client")) {
+            authService.registerClient(name, username, number, password, rpassword, String.valueOf(Role.ROLE_CLIENT));
+            try {
+                return "redirect:/login";
+            } catch (InvalidArgumentsException exception) {
+                return "redirect:/register?error=" + exception.getMessage();
+
+            }
+        } else if (Objects.equals(role, "band")) {
+            try {
+                return "registerBand";
+            } catch (InvalidArgumentsException exception) {
+                return "redirect:/register?error=" + exception.getMessage();
+            }
+        } else if (Objects.equals(role, "photographer")) {
+            try {
+                return "registerPhotographer";
+            } catch (InvalidArgumentsException exception) {
+                return "redirect:/register?error=" + exception.getMessage();
+            }
+        }
+        if (Objects.equals(role, "waiter")) {
+            try {
+                return "redirect:/registerWaiter";
+            } catch (InvalidArgumentsException exception) {
+                return "redirect:/register?error=" + exception.getMessage();
+            }
+        }
+        if (Objects.equals(role, "catering")) {
+            try {
+                return "registerCatering";
+            } catch (InvalidArgumentsException exception) {
+                return "redirect:/register?error=" + exception.getMessage();
+            }
+        }
+        return "register";
+    }
+
+    @PostMapping("/finishRegisterBand")
+    public void handleBandRegister(@RequestParam Integer price,
+                                   HttpServletResponse response,
+                                   HttpSession session) {
+        String username = (String) session.getAttribute("username");
+        String name = (String) session.getAttribute("name");
+        String password = (String) session.getAttribute("password");
+        String rpassword = (String) session.getAttribute("rpassword");
+        String number = (String) session.getAttribute("number");
+        authService.registerBand(name, username, number, password, rpassword, String.valueOf(Role.ROLE_BAND), price);
+        try {
+            response.sendRedirect("/login");
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    @PostMapping("/finishRegisterPhotographer")
+    public void handlePhotographerRegister(@RequestParam Integer price,
+                                           @RequestParam(required = false) String portfolio,
+                                           HttpServletResponse response,
+                                           HttpSession session) {
+        String username = (String) session.getAttribute("username");
+        String name = (String) session.getAttribute("name");
+        String password = (String) session.getAttribute("password");
+        String rpassword = (String) session.getAttribute("rpassword");
+        String number = (String) session.getAttribute("number");
+        authService.registerPhotographer(name, username, number, password, rpassword, String.valueOf(Role.ROLE_PHOTOGRAPHER), price, portfolio);
+        try {
+            response.sendRedirect("/login");
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    @GetMapping("/registerWaiter")
+    public String getSelectPage(Model model) {
+        model.addAttribute("caterings", cateringRepository.findAll());
+        return "registerWaiter";
+    }
+
+    @PostMapping("/finishRegisterWaiter")
+    public void handleWaiterRegister(@RequestParam Integer free_day,
+                                     @RequestParam Integer experience,
+                                     @RequestParam String catering_name,
+                                     HttpServletResponse response,
+                                     HttpSession session) {
+        String username = (String) session.getAttribute("username");
+        String name = (String) session.getAttribute("name");
+        String password = (String) session.getAttribute("password");
+        String rpassword = (String) session.getAttribute("rpassword");
+        String number = (String) session.getAttribute("number");
+        Catering catering = cateringRepository.findAllByName(catering_name).stream().findFirst()
+                .orElseThrow(NoSuchUsernameException::new);
+        authService.registerWaiter(name, username, number, password, rpassword, String.valueOf(Role.ROLE_WAITER), free_day, experience, catering);
+        try {
+            response.sendRedirect("/login");
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    @PostMapping("/finishRegisterCatering")
+    public void handleCateringRegister(@RequestParam Integer price,
+                                       @RequestParam String address,
+                                       HttpServletResponse response,
+                                       HttpSession session) {
+        String username = (String) session.getAttribute("username");
+        String name = (String) session.getAttribute("name");
+        String password = (String) session.getAttribute("password");
+        String rpassword = (String) session.getAttribute("rpassword");
+        String number = (String) session.getAttribute("number");
+        authService.registerCatering(name, username, number, password, rpassword, String.valueOf(Role.ROLE_CATERING), price, address);
+        try {
+            response.sendRedirect("/login");
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+}
