Index: src/main/java/com/example/moviezone/model/Category.java
===================================================================
--- src/main/java/com/example/moviezone/model/Category.java	(revision 0ba5d1a4ceb01672e94ae0277434a8d6e569b33f)
+++ src/main/java/com/example/moviezone/model/Category.java	(revision 8204d832fc62e700e271150659790c6932711403)
@@ -25,5 +25,5 @@
     @Column(name = "id_category", nullable = false)
     @GeneratedValue(strategy = GenerationType.IDENTITY)
-    Integer id_category;
+    Integer idcategory;
     String name;
     Integer extra_amount;
@@ -43,10 +43,10 @@
         if (o == null || getClass() != o.getClass()) return false;
         Category that = (Category) o;
-        return Objects.equals(id_category, that.id_category) && Objects.equals(name, that.name) && Objects.equals(extra_amount, that.extra_amount);
+        return Objects.equals(idcategory, that.idcategory) && Objects.equals(name, that.name) && Objects.equals(extra_amount, that.extra_amount);
     }
 
     @Override
     public int hashCode() {
-        return Objects.hash(id_category, name, extra_amount);
+        return Objects.hash(idcategory, name, extra_amount);
     }
 }
Index: src/main/java/com/example/moviezone/model/Ticket.java
===================================================================
--- src/main/java/com/example/moviezone/model/Ticket.java	(revision 0ba5d1a4ceb01672e94ae0277434a8d6e569b33f)
+++ src/main/java/com/example/moviezone/model/Ticket.java	(revision 8204d832fc62e700e271150659790c6932711403)
@@ -43,6 +43,25 @@
     }
 
+    public Ticket(LocalDate date_reserved, Customer customer, Projection projection, Seat seat) {
+        this.date_reserved = date_reserved;
+        this.customer = customer;
+        this.projection = projection;
+        this.seat = seat;
+    }
+
+    public Ticket( LocalDate date_reserved, Customer customer, Projection projection, Discount discount, Seat seat) {
+        this.date_reserved = date_reserved;
+        this.customer = customer;
+        this.projection = projection;
+        this.discount = discount;
+        this.seat = seat;
+    }
+
     public Ticket() {
 
     }
+
+    public void setPrice(long price) {
+        this.price = price;
+    }
 }
Index: src/main/java/com/example/moviezone/repository/CategoryRepository.java
===================================================================
--- src/main/java/com/example/moviezone/repository/CategoryRepository.java	(revision 0ba5d1a4ceb01672e94ae0277434a8d6e569b33f)
+++ src/main/java/com/example/moviezone/repository/CategoryRepository.java	(revision 8204d832fc62e700e271150659790c6932711403)
@@ -5,5 +5,8 @@
 import org.springframework.stereotype.Repository;
 
+import java.util.Optional;
+
 @Repository
 public interface CategoryRepository extends JpaRepository<Category,Integer>{
+    Optional<Category> getByIdcategory(int id);
 }
Index: src/main/java/com/example/moviezone/repository/Projection_RoomRepository.java
===================================================================
--- src/main/java/com/example/moviezone/repository/Projection_RoomRepository.java	(revision 0ba5d1a4ceb01672e94ae0277434a8d6e569b33f)
+++ src/main/java/com/example/moviezone/repository/Projection_RoomRepository.java	(revision 8204d832fc62e700e271150659790c6932711403)
@@ -4,5 +4,10 @@
 import com.example.moviezone.model.Projection_Room;
 import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.query.Procedure;
+
+import java.util.List;
 
 public interface Projection_RoomRepository extends JpaRepository<Projection_Room,Integer> {
+    @Procedure("project.getRoomsForProjection")
+    List<Projection_Room> getRoomsForProjection(int id);
 }
Index: src/main/java/com/example/moviezone/repository/SeatRepository.java
===================================================================
--- src/main/java/com/example/moviezone/repository/SeatRepository.java	(revision 0ba5d1a4ceb01672e94ae0277434a8d6e569b33f)
+++ src/main/java/com/example/moviezone/repository/SeatRepository.java	(revision 8204d832fc62e700e271150659790c6932711403)
@@ -1,4 +1,6 @@
 package com.example.moviezone.repository;
 
+import com.example.moviezone.model.Category;
+import com.example.moviezone.model.Projection;
 import com.example.moviezone.model.Projection_Room;
 import com.example.moviezone.model.Seat;
@@ -11,3 +13,4 @@
 public interface SeatRepository extends JpaRepository<Seat,Integer> {
     List<Seat> findAllByProjection(Projection_Room projection);
+    List<Seat> findAllByCategoryAndProjection(Category category, Projection_Room projectionRoom);
 }
Index: src/main/java/com/example/moviezone/repository/TicketRepository.java
===================================================================
--- src/main/java/com/example/moviezone/repository/TicketRepository.java	(revision 0ba5d1a4ceb01672e94ae0277434a8d6e569b33f)
+++ src/main/java/com/example/moviezone/repository/TicketRepository.java	(revision 8204d832fc62e700e271150659790c6932711403)
@@ -4,4 +4,5 @@
 import com.example.moviezone.model.Ticket;
 import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.query.Procedure;
 import org.springframework.stereotype.Repository;
 
@@ -10,3 +11,5 @@
 public interface TicketRepository extends JpaRepository<Ticket,Integer> {
     List<Ticket> findAllByCustomer(Customer customer);
+    @Procedure("project.getPriceForTicket")
+    Integer getPriceForTicket(int id);
 }
Index: src/main/java/com/example/moviezone/service/CategoryService.java
===================================================================
--- src/main/java/com/example/moviezone/service/CategoryService.java	(revision 0ba5d1a4ceb01672e94ae0277434a8d6e569b33f)
+++ src/main/java/com/example/moviezone/service/CategoryService.java	(revision 8204d832fc62e700e271150659790c6932711403)
@@ -4,6 +4,8 @@
 
 import java.util.List;
+import java.util.Optional;
 
 public interface CategoryService {
     List<Category> findAllCategories();
+    Optional<Category> getCategoryById(int id);
 }
Index: src/main/java/com/example/moviezone/service/CustomerService.java
===================================================================
--- src/main/java/com/example/moviezone/service/CustomerService.java	(revision 0ba5d1a4ceb01672e94ae0277434a8d6e569b33f)
+++ src/main/java/com/example/moviezone/service/CustomerService.java	(revision 8204d832fc62e700e271150659790c6932711403)
@@ -5,6 +5,9 @@
 
 import java.util.List;
+import java.util.Optional;
+
 @Repository
 public interface CustomerService {
     List<Customer> findAllCustomers();
+    Optional<Customer> getCustomerById(int id);
 }
Index: src/main/java/com/example/moviezone/service/Impl/CategoryServiceImpl.java
===================================================================
--- src/main/java/com/example/moviezone/service/Impl/CategoryServiceImpl.java	(revision 0ba5d1a4ceb01672e94ae0277434a8d6e569b33f)
+++ src/main/java/com/example/moviezone/service/Impl/CategoryServiceImpl.java	(revision 8204d832fc62e700e271150659790c6932711403)
@@ -7,4 +7,5 @@
 
 import java.util.List;
+import java.util.Optional;
 
 @Service
@@ -20,3 +21,8 @@
         return categoryRepository.findAll();
     }
+
+    @Override
+    public Optional<Category> getCategoryById(int id) {
+        return categoryRepository.getByIdcategory(id);
+    }
 }
Index: src/main/java/com/example/moviezone/service/Impl/CustomerServiceImpl.java
===================================================================
--- src/main/java/com/example/moviezone/service/Impl/CustomerServiceImpl.java	(revision 0ba5d1a4ceb01672e94ae0277434a8d6e569b33f)
+++ src/main/java/com/example/moviezone/service/Impl/CustomerServiceImpl.java	(revision 8204d832fc62e700e271150659790c6932711403)
@@ -7,4 +7,5 @@
 
 import java.util.List;
+import java.util.Optional;
 
 @Service
@@ -20,3 +21,8 @@
         return customerRepository.findAll();
     }
+
+    @Override
+    public Optional<Customer> getCustomerById(int id) {
+        return customerRepository.findById(id);
+    }
 }
Index: src/main/java/com/example/moviezone/service/Impl/Projection_RoomServiceImpl.java
===================================================================
--- src/main/java/com/example/moviezone/service/Impl/Projection_RoomServiceImpl.java	(revision 0ba5d1a4ceb01672e94ae0277434a8d6e569b33f)
+++ src/main/java/com/example/moviezone/service/Impl/Projection_RoomServiceImpl.java	(revision 8204d832fc62e700e271150659790c6932711403)
@@ -20,3 +20,8 @@
         return projectionRoomRepository.findAll();
     }
+
+    @Override
+    public List<Projection_Room> getRoomByProjection(int id) {
+        return projectionRoomRepository.getRoomsForProjection(id);
+    }
 }
Index: src/main/java/com/example/moviezone/service/Impl/SeatServiceImpl.java
===================================================================
--- src/main/java/com/example/moviezone/service/Impl/SeatServiceImpl.java	(revision 0ba5d1a4ceb01672e94ae0277434a8d6e569b33f)
+++ src/main/java/com/example/moviezone/service/Impl/SeatServiceImpl.java	(revision 8204d832fc62e700e271150659790c6932711403)
@@ -1,4 +1,5 @@
 package com.example.moviezone.service.Impl;
 
+import com.example.moviezone.model.Category;
 import com.example.moviezone.model.Projection_Room;
 import com.example.moviezone.model.Seat;
@@ -8,7 +9,10 @@
 
 import java.util.List;
+import java.util.Optional;
 
 @Service
 public class SeatServiceImpl implements SeatService {
+
+
     private final SeatRepository seatRepository;
 
@@ -26,3 +30,13 @@
         return seatRepository.findAllByProjection(projection_room);
     }
+
+    @Override
+    public List<Seat> findAllByRoomAndCategory(Projection_Room projectionRoom, Category category) {
+        return seatRepository.findAllByCategoryAndProjection(category,projectionRoom);
+    }
+
+    @Override
+    public Optional<Seat> getSeatById(int id) {
+        return Optional.of(seatRepository.getById(id));
+    }
 }
Index: src/main/java/com/example/moviezone/service/Impl/TicketServiceImpl.java
===================================================================
--- src/main/java/com/example/moviezone/service/Impl/TicketServiceImpl.java	(revision 0ba5d1a4ceb01672e94ae0277434a8d6e569b33f)
+++ src/main/java/com/example/moviezone/service/Impl/TicketServiceImpl.java	(revision 8204d832fc62e700e271150659790c6932711403)
@@ -1,10 +1,10 @@
 package com.example.moviezone.service.Impl;
 
-import com.example.moviezone.model.Customer;
-import com.example.moviezone.model.Ticket;
+import com.example.moviezone.model.*;
 import com.example.moviezone.repository.TicketRepository;
 import com.example.moviezone.service.TicketService;
 import org.springframework.stereotype.Service;
 
+import java.time.LocalDate;
 import java.util.List;
 
@@ -28,6 +28,23 @@
 
     @Override
+    public Ticket saveWithDiscount(LocalDate date, Customer customer, Projection projection, Discount discount, Seat seat) {
+        Ticket t=new Ticket(date,customer,projection,discount,seat);
+        return ticketRepository.save(t);
+    }
+
+    @Override
+    public Ticket saveWithout(LocalDate date, Customer customer, Projection projection, Seat seat) {
+        Ticket t=new Ticket(date,customer,projection,seat);
+        return ticketRepository.save(t);
+    }
+
+    @Override
     public Ticket save(long price, Customer customer) {
         return ticketRepository.save(new Ticket(price,customer));
     }
+
+    @Override
+    public Integer priceForTicket(int id) {
+        return ticketRepository.getPriceForTicket(id);
+    }
 }
Index: src/main/java/com/example/moviezone/service/Projection_RoomService.java
===================================================================
--- src/main/java/com/example/moviezone/service/Projection_RoomService.java	(revision 0ba5d1a4ceb01672e94ae0277434a8d6e569b33f)
+++ src/main/java/com/example/moviezone/service/Projection_RoomService.java	(revision 8204d832fc62e700e271150659790c6932711403)
@@ -2,4 +2,5 @@
 
 import com.example.moviezone.model.Projection_Room;
+import org.springframework.data.jpa.repository.query.Procedure;
 
 import java.util.List;
@@ -7,3 +8,5 @@
 public interface Projection_RoomService {
     List<Projection_Room> findAllProjectionRooms();
+
+    List<Projection_Room> getRoomByProjection(int id);
 }
Index: src/main/java/com/example/moviezone/service/SeatService.java
===================================================================
--- src/main/java/com/example/moviezone/service/SeatService.java	(revision 0ba5d1a4ceb01672e94ae0277434a8d6e569b33f)
+++ src/main/java/com/example/moviezone/service/SeatService.java	(revision 8204d832fc62e700e271150659790c6932711403)
@@ -1,11 +1,15 @@
 package com.example.moviezone.service;
 
+import com.example.moviezone.model.Category;
 import com.example.moviezone.model.Projection_Room;
 import com.example.moviezone.model.Seat;
 
 import java.util.List;
+import java.util.Optional;
 
 public interface SeatService {
     List<Seat> findAllSeats();
     List<Seat> findAllByProjection_Room(Projection_Room projection_room);
+    List<Seat> findAllByRoomAndCategory(Projection_Room projectionRoom, Category category);
+    Optional<Seat> getSeatById(int id);
 }
Index: src/main/java/com/example/moviezone/service/TicketService.java
===================================================================
--- src/main/java/com/example/moviezone/service/TicketService.java	(revision 0ba5d1a4ceb01672e94ae0277434a8d6e569b33f)
+++ src/main/java/com/example/moviezone/service/TicketService.java	(revision 8204d832fc62e700e271150659790c6932711403)
@@ -1,7 +1,7 @@
 package com.example.moviezone.service;
 
-import com.example.moviezone.model.Customer;
-import com.example.moviezone.model.Ticket;
+import com.example.moviezone.model.*;
 
+import java.time.LocalDate;
 import java.util.List;
 
@@ -9,5 +9,7 @@
     List<Ticket> findAllTickets();
     List<Ticket> findAllByCustomer(Customer customer);
-
+    Ticket saveWithDiscount(LocalDate date, Customer customer, Projection projection, Discount discount, Seat seat);
+    Ticket saveWithout(LocalDate date,Customer customer,Projection projection,Seat seat);
     Ticket save(long price,Customer customer);
+    Integer priceForTicket(int id);
 }
Index: src/main/java/com/example/moviezone/web/HomeController.java
===================================================================
--- src/main/java/com/example/moviezone/web/HomeController.java	(revision 0ba5d1a4ceb01672e94ae0277434a8d6e569b33f)
+++ src/main/java/com/example/moviezone/web/HomeController.java	(revision 8204d832fc62e700e271150659790c6932711403)
@@ -38,6 +38,9 @@
 private final ProjectionIsPlayedInRoomService projectionIsPlayedInRoomService;
 private final CategoryService categoryService;
-
-    public HomeController(FilmService filmService, UserService userService, ProjectionService projectionService, EventService eventService, TicketService ticketService, WorkerService workerService, CustomerRatesFilmService customerRatesFilmService, CinemaService cinemaService, CinemaOrganizesEventService cinemaOrganizesEventService, CinemaPlaysFilmService cinemaPlaysFilmService, ProjectionIsPlayedInRoomService projectionIsPlayedInRoomService, CategoryService categoryService)
+private final SeatService seatService;
+private final CustomerService customerService;
+private final Projection_RoomService projectionRoomService;
+
+    public HomeController(FilmService filmService, UserService userService, ProjectionService projectionService, EventService eventService, TicketService ticketService, WorkerService workerService, CustomerRatesFilmService customerRatesFilmService, CinemaService cinemaService, CinemaOrganizesEventService cinemaOrganizesEventService, CinemaPlaysFilmService cinemaPlaysFilmService, ProjectionIsPlayedInRoomService projectionIsPlayedInRoomService, CategoryService categoryService, SeatService seatService, CustomerService customerService, Projection_RoomService projectionRoomService)
     {
 
@@ -54,4 +57,7 @@
         this.projectionIsPlayedInRoomService = projectionIsPlayedInRoomService;
         this.categoryService = categoryService;
+        this.seatService = seatService;
+        this.customerService = customerService;
+        this.projectionRoomService = projectionRoomService;
     }
 
@@ -95,4 +101,19 @@
         model.addAttribute("categories",categoryService.findAllCategories());
         model.addAttribute("bodyContent", "projectionsForFilm");
+
+        return "master-template";
+    }
+    @GetMapping("/getSeats/{id}")
+    @Transactional
+    public String getSeats(@PathVariable Long id, Model model,@RequestParam Long id_category,@RequestParam Long film) {
+        Category category=categoryService.getCategoryById(id_category.intValue()).get();
+        Projection projection=projectionService.findById(id.intValue());
+        model.addAttribute("film",filmService.getFilmById(film).get());
+        model.addAttribute("projection",projection);
+        model.addAttribute("category",category);
+
+        List<Seat> seats=seatService.findAllByRoomAndCategory(projectionRoomService.getRoomByProjection(projection.getId_projection()).get(0),category);
+        model.addAttribute("seats",seats);
+        model.addAttribute("bodyContent", "seats");
 
         return "master-template";
@@ -316,7 +337,17 @@
 
     @PostMapping("/makeReservation")
-    public String createTicketForReservation()
-    {
-        return "redirect:/myTickets";
+    @Transactional
+    public String createTicketForReservation(@RequestParam Long film,@RequestParam Long projection,@RequestParam Long id_seat,@RequestParam String discount)
+    {
+        Ticket t;
+        Projection projection1=projectionService.findById(projection.intValue());
+        if(projection1.getDiscount().equals(discount)){
+            t=ticketService.saveWithDiscount(LocalDate.now(),customerService.getCustomerById(2).get(),projection1,projection1.getDiscount(),seatService.getSeatById(id_seat.intValue()).get());
+        }else{
+            t=ticketService.saveWithout(LocalDate.now(),customerService.getCustomerById(4).get(),projection1,seatService.getSeatById(id_seat.intValue()).get());
+        }
+        Integer price=ticketService.priceForTicket(t.getId_ticket());
+        t.setPrice(price);
+        return "redirect:/home";
     }
 
