Index: src/main/java/project/fmo/app/projcetfmo/Web/DostavaController.java
===================================================================
--- src/main/java/project/fmo/app/projcetfmo/Web/DostavaController.java	(revision d14176d864a9e378a444b7d3a7c0e15a27d0113d)
+++ src/main/java/project/fmo/app/projcetfmo/Web/DostavaController.java	(revision 1dd922639ddb0583e5e61efee73ed97f3f8aa165)
@@ -1,56 +1,2 @@
-package project.fmo.app.projcetfmo.Web;
-
-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 project.fmo.app.projcetfmo.Model.Dostava;
-import project.fmo.app.projcetfmo.Model.Dostavuvac;
-import project.fmo.app.projcetfmo.Model.Korisnik;
-import project.fmo.app.projcetfmo.Service.DostavaService;
-import project.fmo.app.projcetfmo.Service.DostavuvaceService;
-import project.fmo.app.projcetfmo.Service.KorisnikService;
-import project.fmo.app.projcetfmo.Service.NarackaService;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.List;
-
-@Controller
-@RequestMapping("/delivery")
-public class DostavaController {
-
-    private final DostavaService dostavaService;
-    private final DostavuvaceService dostavuvaceService;
-    private final KorisnikService korisnikService;
-    private final NarackaService narackaService;
-
-    public DostavaController(DostavaService dostavaService, DostavuvaceService dostavuvaceService, KorisnikService korisnikService, NarackaService narackaService) {
-        this.dostavaService = dostavaService;
-        this.dostavuvaceService = dostavuvaceService;
-        this.korisnikService = korisnikService;
-        this.narackaService = narackaService;
-    }
-
-
-    @GetMapping
-    public String getDelivery(Model model, HttpServletRequest req){
-        String username = req.getRemoteUser();
-        Korisnik korisnik = korisnikService.findbyImePrezime(username);
-        Dostavuvac dostavuvac = dostavuvaceService.findById(korisnik.getIdKorisnik());
-        List<Dostava> dostavaList = dostavaService.findByIdKorisnikAndStatus(dostavuvac, "za dostava");
-        model.addAttribute("user", korisnik);
-        model.addAttribute("orders", narackaService.findAll());
-        model.addAttribute("delivers", dostavaList);
-        model.addAttribute("bodyContent", "delivery");
-        return "master_template";
-    }
-
-    @PostMapping("/{id}")
-    public String OrderDelivered(@PathVariable Integer id){
-        dostavaService.edit(id);
-        return  "redirect:/delivery";
-    }
-
+package project.fmo.app.projcetfmo.Web;public class DostavaController {
 }
Index: src/main/java/project/fmo/app/projcetfmo/Web/HomeController.java
===================================================================
--- src/main/java/project/fmo/app/projcetfmo/Web/HomeController.java	(revision d14176d864a9e378a444b7d3a7c0e15a27d0113d)
+++ src/main/java/project/fmo/app/projcetfmo/Web/HomeController.java	(revision 1dd922639ddb0583e5e61efee73ed97f3f8aa165)
@@ -9,19 +9,11 @@
 @Controller
 @RequestMapping({"/","/home"})
-public class HomeController {
+public class StoreController {
 
 
     @GetMapping
-    public String getHomePage(Model model){
-        model.addAttribute("bodyContent", "home");
-        return "master_template";
+    public String getHomePage(){
+        return "home";
     }
 
-    @GetMapping("/access_denied")
-    public String getAccessDeniedPage(Model model) {
-        model.addAttribute("bodyContent", "access_denied");
-        return "master-template";
-    }
-
-
 }
Index: src/main/java/project/fmo/app/projcetfmo/Web/LoginController.java
===================================================================
--- src/main/java/project/fmo/app/projcetfmo/Web/LoginController.java	(revision d14176d864a9e378a444b7d3a7c0e15a27d0113d)
+++ src/main/java/project/fmo/app/projcetfmo/Web/LoginController.java	(revision 1dd922639ddb0583e5e61efee73ed97f3f8aa165)
@@ -1,46 +1,2 @@
-package project.fmo.app.projcetfmo.Web;
-
-
-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 project.fmo.app.projcetfmo.Model.Korisnik;
-import project.fmo.app.projcetfmo.Model.exception.InvalidUserCredentialsException;
-import project.fmo.app.projcetfmo.Service.AuthService;
-
-import javax.servlet.http.HttpServletRequest;
-
-@Controller
-@RequestMapping("/login")
-public class LoginController {
-
-    private final AuthService authService;
-
-    public LoginController(AuthService authService) {
-        this.authService = authService;
-    }
-
-    @GetMapping
-    public String getLoginPage(Model model) {
-        model.addAttribute("bodyContent","login");
-        return "master-template";
-    }
-
-    @PostMapping
-    public String login(HttpServletRequest request, Model model) {
-        Korisnik user = null;
-        try{
-            user = this.authService.login(request.getParameter("username"),
-                    request.getParameter("password"));
-            request.getSession().setAttribute("user", user);
-            return "redirect:/home";
-        }
-        catch (InvalidUserCredentialsException exception) {
-            model.addAttribute("hasError", true);
-            model.addAttribute("error", exception.getMessage());
-            return "login";
-        }
-    }
+package project.fmo.app.projcetfmo.Web;public class LoginController {
 }
Index: src/main/java/project/fmo/app/projcetfmo/Web/LogoutController.java
===================================================================
--- src/main/java/project/fmo/app/projcetfmo/Web/LogoutController.java	(revision d14176d864a9e378a444b7d3a7c0e15a27d0113d)
+++ src/main/java/project/fmo/app/projcetfmo/Web/LogoutController.java	(revision 1dd922639ddb0583e5e61efee73ed97f3f8aa165)
@@ -1,18 +1,2 @@
-package project.fmo.app.projcetfmo.Web;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import javax.servlet.http.HttpServletRequest;
-
-@Controller
-@RequestMapping("/logout")
-public class LogoutController {
-
-    @GetMapping
-    public String logout(HttpServletRequest request) {
-        request.getSession().invalidate();
-        return "redirect:/";
-    }
+package project.fmo.app.projcetfmo.Web;public class LogoutController {
 }
Index: src/main/java/project/fmo/app/projcetfmo/Web/NarackaController.java
===================================================================
--- src/main/java/project/fmo/app/projcetfmo/Web/NarackaController.java	(revision d14176d864a9e378a444b7d3a7c0e15a27d0113d)
+++ src/main/java/project/fmo/app/projcetfmo/Web/NarackaController.java	(revision 1dd922639ddb0583e5e61efee73ed97f3f8aa165)
@@ -1,76 +1,2 @@
-package project.fmo.app.projcetfmo.Web;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.*;
-import project.fmo.app.projcetfmo.Model.*;
-import project.fmo.app.projcetfmo.Service.*;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.List;
-
-@Controller
-@RequestMapping("/order")
-public class NarackaController {
-
-    private final NarackaService narackaService;
-    private final NarackaSodrziProduktService narackaSodrziProduktService;
-    private final KorisnikService korisnikService;
-    private final KupuvacService kupuvacService;
-    private final CenaService cenaService;
-
-    private final ProduktService produktService;
-
-    public NarackaController(NarackaService narackaService, NarackaSodrziProduktService narackaSodrziProduktService, KorisnikService korisnikService, KupuvacService kupuvacService, CenaService cenaService, ProduktService produktService) {
-        this.narackaService = narackaService;
-        this.narackaSodrziProduktService = narackaSodrziProduktService;
-        this.korisnikService = korisnikService;
-        this.kupuvacService = kupuvacService;
-        this.cenaService = cenaService;
-        this.produktService = produktService;
-    }
-
-    @GetMapping
-    public String getShoppingCartPage(@RequestParam(required = false) String error,
-                                      HttpServletRequest req,
-                                      Model model) {
-        if (error != null && !error.isEmpty()) {
-            model.addAttribute("hasError", true);
-            model.addAttribute("error", error);
-        }
-        String username = req.getRemoteUser();
-        Korisnik korisnik = korisnikService.findbyImePrezime(username);
-        Kupuvac kupuvac = kupuvacService.findById(korisnik.getIdKorisnik());
-        Naracka naracka = this.narackaService.findByIdKorisniktAndStatus(kupuvac.getIdKorisnik(),"aktivna");
-        if(naracka == null){
-            model.addAttribute("bodyContent", "home");
-            return "master_template";
-        }
-        List<NarackaSodrziProdukt> narackaSodrziProdukt = narackaSodrziProduktService.findByIdNaracka(naracka.getIdNaracka());
-        List<Produkt> produktList =  produktService.findAll();
-        model.addAttribute("order", naracka);
-        model.addAttribute("products", produktList);
-        model.addAttribute("po", narackaSodrziProdukt);
-        model.addAttribute("prices", cenaService.findAll());
-        model.addAttribute("bodyContent", "cart");
-        return "master_template";
-    }
-
-    @PostMapping("/{id}/success")
-    public String processOrder(@PathVariable Integer id,HttpServletRequest req,@RequestParam(required = false) String address){
-        Naracka n = narackaService.findByIdNaracka(id);
-        String username = req.getRemoteUser();
-        Korisnik korisnik = korisnikService.findbyImePrezime(username);
-        Kupuvac kupuvac = kupuvacService.findById(korisnik.getIdKorisnik());
-        if(address!=null) {
-            narackaService.edit(0, "se sprema", address, kupuvac.getIdKorisnik(), n.getIdNaracka());
-        }
-        else {
-            narackaService.edit(0, "se sprema", "/", kupuvac.getIdKorisnik(), n.getIdNaracka());
-        }
-        return "redirect:/products";
-    }
-
-
-
+package project.fmo.app.projcetfmo.Web;public class NarackaController {
 }
Index: src/main/java/project/fmo/app/projcetfmo/Web/ProductController.java
===================================================================
--- src/main/java/project/fmo/app/projcetfmo/Web/ProductController.java	(revision d14176d864a9e378a444b7d3a7c0e15a27d0113d)
+++ src/main/java/project/fmo/app/projcetfmo/Web/ProductController.java	(revision 1dd922639ddb0583e5e61efee73ed97f3f8aa165)
@@ -1,185 +1,2 @@
-package project.fmo.app.projcetfmo.Web;
-
-
-import org.springframework.format.annotation.DateTimeFormat;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.*;
-import project.fmo.app.projcetfmo.Model.*;
-import project.fmo.app.projcetfmo.Service.*;
-
-
-import java.sql.Date;
-import java.text.ParseException;
-
-import java.time.LocalDate;
-import java.util.List;
-
-
-@Controller
-@RequestMapping("/products")
-public class ProductController {
-
-    private final ProduktService produktService;
-    private final KategorijaService kategorijaService;
-    private final ProduktEOdKategorijaService produktEOdKategorijaService;
-    private final CenaService cenaService;
-    private final NarackaService narackaService;
-    private final NarackaSodrziProduktService narackaSodrziProduktService;
-    private final KupuvacService kupuvacService;
-    private final KorisnikService korisnikService;
-
-    public ProductController(ProduktService produktService, KategorijaService kategorijaService, ProduktEOdKategorijaService produktEOdKategorijaService, CenaService cenaService, NarackaService narackaService, NarackaSodrziProduktService narackaSodrziProduktService, KupuvacService kupuvacService, KorisnikService korisnikService) {
-        this.produktService = produktService;
-        this.kategorijaService = kategorijaService;
-        this.produktEOdKategorijaService = produktEOdKategorijaService;
-        this.cenaService = cenaService;
-        this.narackaService = narackaService;
-        this.narackaSodrziProduktService = narackaSodrziProduktService;
-        this.kupuvacService = kupuvacService;
-        this.korisnikService = korisnikService;
-    }
-
-    @GetMapping
-    public String getProductPage(Model model) {
-        List<Produkt> products = this.produktService.findAll();
-        model.addAttribute("products", products);
-        model.addAttribute("kat", kategorijaService.findAll());
-        model.addAttribute("categories", produktEOdKategorijaService.findAll());
-        model.addAttribute("prices", cenaService.findAll());
-        model.addAttribute("bodyContent", "products");
-        return "master_template";
-    }
-
-    @GetMapping("/{id}")
-    public String getProductInfo(Model model, @PathVariable Integer id){
-        Produkt p = produktService.findById(id).orElse(null);
-        Cena c = cenaService.findByIdProdukt(id);
-        ProduktEOdKategorija pk = produktEOdKategorijaService.findByIdProdukt(id);
-        List<Kategorija> k = kategorijaService.findAll();
-        Kategorija kat = null;
-        for ( Kategorija kategorija : k){
-            if (kategorija.getIdKategorija() == pk.getIdKategorija()){
-                kat=kategorija;
-            }
-        }
-        model.addAttribute("product", p);
-        model.addAttribute("price", c);
-        model.addAttribute("category",pk);
-        if(kat != null) {
-            model.addAttribute("kat", kat);
-        }
-        model.addAttribute("bodyContent", "product_info");
-        return "master_template";
-    }
-
-    @PostMapping("{id}/add-to-cart")
-    public String addProductToCart(@PathVariable Integer id,
-                                   @RequestParam String idKorisnik,
-                                   @RequestParam int cena,
-                                   @RequestParam int quantity){
-        Korisnik kOrisnik = korisnikService.findbyImePrezime(idKorisnik);
-        Kupuvac k = kupuvacService.findById(kOrisnik.getIdKorisnik());
-        Naracka n = narackaService.findByIdKorisniktAndStatus(k.getIdKorisnik(),"aktivna");
-            if (n == null){
-                //Naracka narackaNova = new Naracka(cena*quantity, Date.valueOf(LocalDate.now()), "aktivna", "/", k);
-                Naracka narackaNova = narackaService.save(cena*quantity, Date.valueOf(LocalDate.now()), "aktivna", "/", k);
-                NarackaSodrziProdukt nsp = new NarackaSodrziProdukt(id,narackaNova.getIdNaracka(),quantity,cena);
-                narackaSodrziProduktService.save(id,narackaNova.getIdNaracka(),quantity,cena);
-
-                return "redirect:/products";
-            }
-            else {
-                narackaService.edit(cena*quantity,n.getStatus(),n.getAdresa(),k.getIdKorisnik(),n.getIdNaracka());
-                NarackaSodrziProdukt narackaSodrziProdukt = narackaSodrziProduktService.findByIdProduktAndIdNaracka(id,n.getIdNaracka());
-                if(narackaSodrziProdukt == null){
-                    NarackaSodrziProdukt nova = new NarackaSodrziProdukt(id,n.getIdNaracka(),quantity,cena);
-                    narackaSodrziProduktService.save(id,n.getIdNaracka(),quantity,cena);
-                }
-                else{
-                    narackaSodrziProduktService.edit(id,n.getIdNaracka(),quantity,cena);
-                }
-                return "redirect:/products";
-          }
-    }
-
-    @DeleteMapping("/delete/{id}")
-    public String deleteProduct(@PathVariable Integer id,Model model) {
-        if(narackaSodrziProduktService.findByIdProdukt(id).size() != 0){
-            model.addAttribute("bodyContent", "not_valid_delete");
-            return "master_template";
-        }
-        this.cenaService.deleteByIdProdukt(id);
-        this.produktEOdKategorijaService.deleteByIdProdukt(id);
-        this.produktService.deleteById(id);
-        return "redirect:/products";
-    }
-
-    @GetMapping("/edit-form/{id}")
-    public String editProductPage(@PathVariable Integer id, Model model) {
-        if (this.produktService.findById(id).isPresent()) {
-            Produkt product = this.produktService.findById(id).get();
-            Cena c = cenaService.findByIdProdukt(product.getIdProdukt());
-            ProduktEOdKategorija produktEOdKategorija = produktEOdKategorijaService.findByIdProdukt(product.getIdProdukt());
-            model.addAttribute("chosen", produktEOdKategorija);
-            model.addAttribute("price", c);
-            List<Kategorija> categories = this.kategorijaService.findAll();
-            model.addAttribute("categories", categories);
-            model.addAttribute("product", product);
-            model.addAttribute("bodyContent", "add_product");
-            return "master_template";
-        }
-        return "redirect:/products";
-    }
-
-    @GetMapping("/add-form")
-    public String addProductPage(Model model) {
-        List<Kategorija> categories = this.kategorijaService.findAll();
-        model.addAttribute("categories", categories);
-        model.addAttribute("bodyContent", "add_product");
-        return "master_template";
-    }
-
-    @PostMapping("/add")
-    public String saveProduct(
-            @RequestParam(required = false) Integer id,
-            @RequestParam String name,
-            @RequestParam(required = false) String description,
-            @RequestParam Integer category,
-            @RequestParam Date date,
-            @RequestParam(required = false)  String dateTo,
-            @RequestParam int price) throws ParseException {
-            if(dateTo.length() != 0) {
-                Date d = Date.valueOf(dateTo);
-
-                if (id != null) {
-                    this.produktService.edit(id, name, description);
-                    this.cenaService.edit(id, date, d, price);
-                    this.produktEOdKategorijaService.edit(id, category);
-
-                } else {
-                    Produkt p = this.produktService.save(name, description);
-                    this.cenaService.save(p.getIdProdukt(), date, d, price);
-                    this.produktEOdKategorijaService.save(p.getIdProdukt(), category);
-                }
-            }
-            else{
-                if (id != null) {
-                this.produktService.edit(id, name, description);
-                this.cenaService.edit(id, date, null, price);
-                this.produktEOdKategorijaService.edit(id, category);
-
-            } else {
-                Produkt p = this.produktService.save(name, description);
-                this.cenaService.save(p.getIdProdukt(), date, null, price);
-                this.produktEOdKategorijaService.save(p.getIdProdukt(), category);
-            }
-
-            }
-        return "redirect:/products";
-    }
-
-
-
-
+package project.fmo.app.projcetfmo.Web;public class ProductController {
 }
Index: src/main/java/project/fmo/app/projcetfmo/Web/RegisterController.java
===================================================================
--- src/main/java/project/fmo/app/projcetfmo/Web/RegisterController.java	(revision d14176d864a9e378a444b7d3a7c0e15a27d0113d)
+++ src/main/java/project/fmo/app/projcetfmo/Web/RegisterController.java	(revision 1dd922639ddb0583e5e61efee73ed97f3f8aa165)
@@ -1,50 +1,2 @@
-package project.fmo.app.projcetfmo.Web;
-
-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 org.springframework.web.bind.annotation.RequestParam;
-import project.fmo.app.projcetfmo.Service.KorisnikService;
-
-@Controller
-@RequestMapping("/register")
-public class RegisterController {
-
-    private final KorisnikService korisnikService;
-
-
-    public RegisterController(KorisnikService korisnikService) {
-        this.korisnikService = korisnikService;
-    }
-
-
-    @GetMapping
-    public String getRegisterPage(@RequestParam(required = false) String error, Model model) {
-        if(error != null && !error.isEmpty()) {
-            model.addAttribute("hasError", true);
-            model.addAttribute("error", error);
-        }
-        model.addAttribute("bodyContent","register");
-        return "master_template";
-    }
-
-    @PostMapping
-    public String register(@RequestParam String name_surname,
-                           @RequestParam String password,
-                           @RequestParam String repeatedPassword,
-                           @RequestParam String mail,
-                           @RequestParam String number) {
-        try{
-            if(korisnikService.findbyImePrezime(name_surname) != null) throw  new RuntimeException();
-            this.korisnikService.register(name_surname, password, repeatedPassword, mail, number);
-            return "redirect:/home";
-        } catch (RuntimeException r) {
-            return "redirect:/register?error=InvalidRegistration";
-        }
-    }
-
-
-
+package project.fmo.app.projcetfmo.Web;public class RegisterController {
 }
Index: src/main/java/project/fmo/app/projcetfmo/Web/StatisticsController.java
===================================================================
--- src/main/java/project/fmo/app/projcetfmo/Web/StatisticsController.java	(revision d14176d864a9e378a444b7d3a7c0e15a27d0113d)
+++ src/main/java/project/fmo/app/projcetfmo/Web/StatisticsController.java	(revision 1dd922639ddb0583e5e61efee73ed97f3f8aa165)
@@ -1,47 +1,2 @@
-package project.fmo.app.projcetfmo.Web;
-
-import org.springframework.data.domain.Page;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import project.fmo.app.projcetfmo.Model.Korisnik;
-import project.fmo.app.projcetfmo.Model.Produkt;
-import project.fmo.app.projcetfmo.Service.KorisnikService;
-import project.fmo.app.projcetfmo.Service.ProduktService;
-
-import java.util.ArrayList;
-import java.util.List;
-
-@Controller
-@RequestMapping("/statistics")
-public class StatisticsController {
-    private final ProduktService produktService;
-    private final KorisnikService korisnikService;
-
-    public StatisticsController(ProduktService produktService, KorisnikService korisnikService) {
-        this.produktService = produktService;
-        this.korisnikService = korisnikService;
-    }
-
-    @GetMapping
-    public String getStatistics(Model model){
-        List<Object> korisnikList = korisnikService.statistics2();
-        List<String> ime = new ArrayList<>();
-        List<String> id = new ArrayList<>();
-        List<Integer> vkupno_naracki = new ArrayList<>();
-        List<Float> prosecna_suma_na_naracka_za_site_kupuvaci = new ArrayList<>();
-        List<Integer> vkupno_suma_od_site_naracki_na_kupuvacot = new ArrayList<>();
-        List<Integer> vkupno_naracki_nad_prosek_na_korisnikot = new ArrayList<>();
-        List<Integer> vkupno_suma_na_naracki_nad_prosek_za_korisnikot = new ArrayList<>();
-//        for(int i =0 ; i< korisnikList.size();i++) {
-//            ime.add(korisnikList.get(i)[0].toString());
-//        }
-        List<Object> produktList = produktService.statistics1();
-        model.addAttribute("products", produktList);
-        model.addAttribute("users", korisnikList);
-        model.addAttribute("bodyContent", "statistics");
-        return "master_template";
-
-    }
+package project.fmo.app.projcetfmo.Web;public class StatisticsController {
 }
