Index: src/main/java/com/example/moviezone/config/WebSecurityConfig.java
===================================================================
--- src/main/java/com/example/moviezone/config/WebSecurityConfig.java	(revision 40935d39c559d7bead40536a999735ce35ae220b)
+++ src/main/java/com/example/moviezone/config/WebSecurityConfig.java	(revision 1e7126f5a33606e77623e4ac53fe5e67aa7c19fc)
@@ -34,5 +34,6 @@
                 .antMatchers("/","/films","/home/projections","/home/events","/home/getProjections/**","/home/films","/home/getFilm/**","/getFilm/**","/home/getEvent/**","/getEvent/**","/login","/events","/projections" ,"/home", "/assets/**", "/register", "/registerWorker","/api/**").permitAll()
                 .antMatchers("/","/finishRegister","/registerWorker","/films","/home/projections","/home/events","/home/getProjections/**","/home/films","/home/getFilm/**","/getFilm/**","/home/getEvent/**","/getEvent/**","redirect:/login","/login","/events","/projections" ,"/home", "/assets/**", "/register", "/api/**").permitAll()
-                .antMatchers("/home/getSeats/**","/myTickets","/home/addInterestedEvent/**","/home/deleteInterestedEvent/**","/home/addRating/**","/addRating/**","/getProjection/**","/home/makeReservation","/profileUser").hasRole("USER")
+                .antMatchers("/home/getSeats/**","/myTickets","/home/addInterestedEvent/**","/home/deleteInterestedEvent/**","/home/addRating/**","/addRating/**","/getProjection/**","/home/makeReservation","/profileUser","/cancelTicket/**").hasRole("USER")
+                .antMatchers("/profileWorker").hasRole("WORKER")
                 .antMatchers("/**").hasRole("ADMIN")
                 .anyRequest()
Index: src/main/java/com/example/moviezone/model/Discount.java
===================================================================
--- src/main/java/com/example/moviezone/model/Discount.java	(revision 40935d39c559d7bead40536a999735ce35ae220b)
+++ src/main/java/com/example/moviezone/model/Discount.java	(revision 1e7126f5a33606e77623e4ac53fe5e67aa7c19fc)
@@ -29,3 +29,13 @@
     String type;
     Integer percent;
+
+    public Discount() {
+    }
+
+    public Discount(LocalDate validity, String code, String type, Integer percent) {
+        this.validity = validity;
+        this.code = code;
+        this.type = type;
+        this.percent = percent;
+    }
 }
Index: src/main/java/com/example/moviezone/model/Projection.java
===================================================================
--- src/main/java/com/example/moviezone/model/Projection.java	(revision 40935d39c559d7bead40536a999735ce35ae220b)
+++ src/main/java/com/example/moviezone/model/Projection.java	(revision 1e7126f5a33606e77623e4ac53fe5e67aa7c19fc)
@@ -8,4 +8,5 @@
 
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 
 @Getter
@@ -20,7 +21,7 @@
     Integer id_projection;
 
-    LocalDate date_time_start;
+    LocalDateTime date_time_start;
     String type_of_technology;
-    LocalDate date_time_end;
+    LocalDateTime date_time_end;
     @ManyToOne
     @JoinColumn(name = "id_film")
@@ -33,9 +34,10 @@
     Discount discount;
 
-    public Projection(LocalDate date_time_start, String type_of_technology, LocalDate date_time_end, Film film) {
+    public Projection(LocalDateTime date_time_start, String type_of_technology, LocalDateTime date_time_end, Film film, Discount discount) {
         this.date_time_start = date_time_start;
         this.type_of_technology = type_of_technology;
         this.date_time_end = date_time_end;
         this.film = film;
+        this.discount = discount;
     }
 
Index: src/main/java/com/example/moviezone/model/Role.java
===================================================================
--- src/main/java/com/example/moviezone/model/Role.java	(revision 40935d39c559d7bead40536a999735ce35ae220b)
+++ src/main/java/com/example/moviezone/model/Role.java	(revision 1e7126f5a33606e77623e4ac53fe5e67aa7c19fc)
@@ -6,5 +6,5 @@
 public enum Role implements GrantedAuthority {
 
-    ROLE_USER, ROLE_ADMIN;
+    ROLE_USER, ROLE_ADMIN, ROLE_WORKER;
 
     @Override
Index: src/main/java/com/example/moviezone/model/Worker.java
===================================================================
--- src/main/java/com/example/moviezone/model/Worker.java	(revision 40935d39c559d7bead40536a999735ce35ae220b)
+++ src/main/java/com/example/moviezone/model/Worker.java	(revision 1e7126f5a33606e77623e4ac53fe5e67aa7c19fc)
@@ -59,5 +59,9 @@
     @Override
     public Collection<? extends GrantedAuthority> getAuthorities() {
-        return Collections.singletonList(Role.ROLE_ADMIN);
+        if (position.equalsIgnoreCase("admin"))
+            return Collections.singletonList(Role.ROLE_ADMIN);
+        else{
+            return Collections.singletonList(Role.ROLE_WORKER);
+        }
     }
 
Index: src/main/java/com/example/moviezone/model/enums/GenreEnum.java
===================================================================
--- src/main/java/com/example/moviezone/model/enums/GenreEnum.java	(revision 40935d39c559d7bead40536a999735ce35ae220b)
+++ src/main/java/com/example/moviezone/model/enums/GenreEnum.java	(revision 1e7126f5a33606e77623e4ac53fe5e67aa7c19fc)
@@ -1,2 +1,11 @@
-package com.example.moviezone.model;public enum GenreEnum {
+package com.example.moviezone.model.enums;
+
+public enum GenreEnum {
+    Animation,
+    Adventure,
+    Comedy,
+    Fantasy,
+    Crime,
+    Drama,
+    Thriller
 }
Index: src/main/java/com/example/moviezone/model/manytomany/ProjectionIsPlayedInRoom.java
===================================================================
--- src/main/java/com/example/moviezone/model/manytomany/ProjectionIsPlayedInRoom.java	(revision 40935d39c559d7bead40536a999735ce35ae220b)
+++ src/main/java/com/example/moviezone/model/manytomany/ProjectionIsPlayedInRoom.java	(revision 1e7126f5a33606e77623e4ac53fe5e67aa7c19fc)
@@ -30,4 +30,7 @@
     Integer idroom;
 
-
+    public ProjectionIsPlayedInRoom(Integer idprojection, Integer idroom) {
+        this.idprojection = idprojection;
+        this.idroom = idroom;
+    }
 }
Index: src/main/java/com/example/moviezone/model/procedures/TicketsCancelClass.java
===================================================================
--- src/main/java/com/example/moviezone/model/procedures/TicketsCancelClass.java	(revision 40935d39c559d7bead40536a999735ce35ae220b)
+++ src/main/java/com/example/moviezone/model/procedures/TicketsCancelClass.java	(revision 1e7126f5a33606e77623e4ac53fe5e67aa7c19fc)
@@ -1,2 +1,16 @@
-package com.example.moviezone.model.procedures;public class TicketsCancelClass {
+package com.example.moviezone.model.procedures;
+
+import com.example.moviezone.model.Ticket;
+
+public class TicketsCancelClass {
+    public Ticket ticket;
+    public boolean canCancel;
+
+    public TicketsCancelClass(Ticket ticket, boolean canCancel) {
+        this.ticket = ticket;
+        this.canCancel = canCancel;
+    }
+
+    public TicketsCancelClass() {
+    }
 }
Index: src/main/java/com/example/moviezone/repository/DiscountRepository.java
===================================================================
--- src/main/java/com/example/moviezone/repository/DiscountRepository.java	(revision 40935d39c559d7bead40536a999735ce35ae220b)
+++ src/main/java/com/example/moviezone/repository/DiscountRepository.java	(revision 1e7126f5a33606e77623e4ac53fe5e67aa7c19fc)
@@ -2,6 +2,14 @@
 
 import com.example.moviezone.model.Discount;
+import com.example.moviezone.model.Projection;
 import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.query.Procedure;
 
+import javax.transaction.Transactional;
+import java.util.List;
+
+@Transactional
 public interface DiscountRepository extends JpaRepository<Discount,Integer> {
+    @Procedure("project.getValidDiscounts")
+    List<Discount> getValidDiscounts();
 }
Index: src/main/java/com/example/moviezone/repository/ProjectionRepository.java
===================================================================
--- src/main/java/com/example/moviezone/repository/ProjectionRepository.java	(revision 40935d39c559d7bead40536a999735ce35ae220b)
+++ src/main/java/com/example/moviezone/repository/ProjectionRepository.java	(revision 1e7126f5a33606e77623e4ac53fe5e67aa7c19fc)
@@ -12,3 +12,5 @@
     @Procedure("project.getProjectionsForFilms")
     List<Projection> getProjectionsForFilms(int id);
+    @Procedure("project.getProjectionsNow")
+    List<Projection> getProjectionsNow();
 }
Index: src/main/java/com/example/moviezone/service/CustomerService.java
===================================================================
--- src/main/java/com/example/moviezone/service/CustomerService.java	(revision 40935d39c559d7bead40536a999735ce35ae220b)
+++ src/main/java/com/example/moviezone/service/CustomerService.java	(revision 1e7126f5a33606e77623e4ac53fe5e67aa7c19fc)
@@ -7,5 +7,4 @@
 import java.util.Optional;
 
-@Repository
 public interface CustomerService {
     List<Customer> findAllCustomers();
Index: src/main/java/com/example/moviezone/service/DiscountService.java
===================================================================
--- src/main/java/com/example/moviezone/service/DiscountService.java	(revision 40935d39c559d7bead40536a999735ce35ae220b)
+++ src/main/java/com/example/moviezone/service/DiscountService.java	(revision 1e7126f5a33606e77623e4ac53fe5e67aa7c19fc)
@@ -1,2 +1,13 @@
-package com.example.moviezone.service;public interface DiscountService {
+package com.example.moviezone.service;
+
+import com.example.moviezone.model.Discount;
+import org.springframework.stereotype.Repository;
+
+import java.time.LocalDate;
+import java.util.List;
+
+
+public interface DiscountService {
+    Discount save(String code, String type, LocalDate validity, Integer percent);
+    List<Discount> getValidDiscounts();
 }
Index: src/main/java/com/example/moviezone/service/Impl/DiscountServiceImpl.java
===================================================================
--- src/main/java/com/example/moviezone/service/Impl/DiscountServiceImpl.java	(revision 40935d39c559d7bead40536a999735ce35ae220b)
+++ src/main/java/com/example/moviezone/service/Impl/DiscountServiceImpl.java	(revision 1e7126f5a33606e77623e4ac53fe5e67aa7c19fc)
@@ -1,2 +1,28 @@
-package com.example.moviezone.service.Impl;public class DiscountServiceImpl {
+package com.example.moviezone.service.Impl;
+
+import com.example.moviezone.model.Discount;
+import com.example.moviezone.repository.DiscountRepository;
+import com.example.moviezone.service.DiscountService;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDate;
+import java.util.List;
+
+@Service
+public class DiscountServiceImpl implements DiscountService {
+    private final DiscountRepository discountRepository;
+
+    public DiscountServiceImpl(DiscountRepository discountRepository) {
+        this.discountRepository = discountRepository;
+    }
+
+    @Override
+    public Discount save(String code, String type, LocalDate validity, Integer percent) {
+        return discountRepository.save(new Discount(validity,code,type,percent));
+    }
+
+    @Override
+    public List<Discount> getValidDiscounts() {
+        return discountRepository.getValidDiscounts();
+    }
 }
Index: src/main/java/com/example/moviezone/service/Impl/ProjectionServiceImpl.java
===================================================================
--- src/main/java/com/example/moviezone/service/Impl/ProjectionServiceImpl.java	(revision 40935d39c559d7bead40536a999735ce35ae220b)
+++ src/main/java/com/example/moviezone/service/Impl/ProjectionServiceImpl.java	(revision 1e7126f5a33606e77623e4ac53fe5e67aa7c19fc)
@@ -1,7 +1,11 @@
 package com.example.moviezone.service.Impl;
 
+import com.example.moviezone.model.Discount;
 import com.example.moviezone.model.Film;
 import com.example.moviezone.model.Projection;
+import com.example.moviezone.model.manytomany.ProjectionIsPlayedInRoom;
+import com.example.moviezone.repository.DiscountRepository;
 import com.example.moviezone.repository.FilmRepository;
+import com.example.moviezone.repository.ProjectionIsPlayedInRoomRepository;
 import com.example.moviezone.repository.ProjectionRepository;
 import com.example.moviezone.service.ProjectionService;
@@ -9,4 +13,5 @@
 
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.util.List;
 
@@ -14,8 +19,12 @@
 public class ProjectionServiceImpl implements ProjectionService {
     private final ProjectionRepository projectionRepository;
+    private final ProjectionIsPlayedInRoomRepository projectionIsPlayedInRoomRepository;
     private final FilmRepository filmRepository;
-    public ProjectionServiceImpl(ProjectionRepository projectionRepository, FilmRepository filmRepository) {
+    private final DiscountRepository discountRepository;
+    public ProjectionServiceImpl(ProjectionRepository projectionRepository, ProjectionIsPlayedInRoomRepository projectionIsPlayedInRoomRepository, FilmRepository filmRepository, DiscountRepository discountRepository) {
         this.projectionRepository = projectionRepository;
+        this.projectionIsPlayedInRoomRepository = projectionIsPlayedInRoomRepository;
         this.filmRepository = filmRepository;
+        this.discountRepository = discountRepository;
     }
 
@@ -31,4 +40,9 @@
 
     @Override
+    public List<Projection> getProjectionsNow() {
+        return projectionRepository.getProjectionsNow();
+    }
+
+    @Override
     public Projection findById(Integer id_projection) {
         return projectionRepository.findById(id_projection).orElseThrow(RuntimeException::new);
@@ -37,7 +51,10 @@
 
     @Override
-    public Projection save(LocalDate date_time_start, LocalDate date_time_end, String type_of_technology, Integer id_film) {
+    public Projection save(LocalDateTime date_time_start, LocalDateTime date_time_end, String type_of_technology, Integer id_film, Integer id_room, Integer id_discount) {
        Film film=filmRepository.findById(id_film).orElseThrow(RuntimeException::new);
-        return projectionRepository.save(new Projection(date_time_start,type_of_technology,date_time_end,film));
+        Discount discount = discountRepository.findById(id_discount).orElseThrow(RuntimeException::new);
+        Projection projection =  projectionRepository.save(new Projection(date_time_start,type_of_technology,date_time_end,film,discount));
+        projectionIsPlayedInRoomRepository.save(new ProjectionIsPlayedInRoom(projection.getId_projection(),id_room));
+        return projection;
     }
 
Index: src/main/java/com/example/moviezone/service/Impl/SeatServiceImpl.java
===================================================================
--- src/main/java/com/example/moviezone/service/Impl/SeatServiceImpl.java	(revision 40935d39c559d7bead40536a999735ce35ae220b)
+++ src/main/java/com/example/moviezone/service/Impl/SeatServiceImpl.java	(revision 1e7126f5a33606e77623e4ac53fe5e67aa7c19fc)
@@ -1,8 +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;
-import com.example.moviezone.model.Ticket;
+import com.example.moviezone.model.*;
 import com.example.moviezone.model.manytomany.ProjectionIsPlayedInRoom;
 import com.example.moviezone.repository.ProjectionIsPlayedInRoomRepository;
@@ -43,33 +40,16 @@
 
     @Override
-    public List<Seat> findAllByRoomAndCategory(Projection_Room projectionRoom, Category category) {
+    public List<Seat> findAllByRoomAndCategory(Projection projection, Projection_Room projectionRoom, Category category) {
         List<Ticket> tickets=ticketService.findAllTickets();
         List<Seat> seats=seatRepository.findAllByCategoryAndProjection(category,projectionRoom);
-        List<Seat> s=new ArrayList<>();
-        List<Projection_Room> projection_rooms=new ArrayList<>();
+
         for (int i = 0; i < tickets.size(); i++) {
-            List<ProjectionIsPlayedInRoom> projectionIsPlayedInRooms= projectionIsPlayedInRoomRepository.findAllByProjectionId(tickets.get(i).getProjection().getId_projection());
-            for (int j = 0; j < projectionIsPlayedInRooms.size(); j++) {
-                projection_rooms.add(projection_roomRepository.getById(projectionIsPlayedInRooms.get(j).getIdroom()));
+            if(tickets.get(i).getProjection()==projection){
+                if(seats.contains(tickets.get(i).getSeat())){
+                    seats.remove(tickets.get(i).getSeat());
+                }
             }
         }
-        int f=0;
-        for (int i = 0; i < seats.size(); i++) {
-            for (int j = 0; j < tickets.size(); j++) {
-                if(seats.get(i).getId_seat().equals(tickets.get(j).getSeat().getId_seat())){
-                    for (int k = 0; k < projection_rooms.size(); k++) {
-                        if(seats.get(i).getProjection().getId_room().equals(projection_rooms.get(k).getId_room()))
-                            f=1;
-                    }
-                }
-
-            }
-
-            if(f==0){
-                s.add(seats.get(i));
-            }
-            f=0;
-        }
-        return s;
+        return seats;
     }
 
Index: src/main/java/com/example/moviezone/service/Impl/TicketServiceImpl.java
===================================================================
--- src/main/java/com/example/moviezone/service/Impl/TicketServiceImpl.java	(revision 40935d39c559d7bead40536a999735ce35ae220b)
+++ src/main/java/com/example/moviezone/service/Impl/TicketServiceImpl.java	(revision 1e7126f5a33606e77623e4ac53fe5e67aa7c19fc)
@@ -48,3 +48,8 @@
         return ticketRepository.getPriceForTicket(id);
     }
+
+    @Override
+    public void delete(int id) {
+        ticketRepository.deleteById(id);
+    }
 }
Index: src/main/java/com/example/moviezone/service/ProjectionService.java
===================================================================
--- src/main/java/com/example/moviezone/service/ProjectionService.java	(revision 40935d39c559d7bead40536a999735ce35ae220b)
+++ src/main/java/com/example/moviezone/service/ProjectionService.java	(revision 1e7126f5a33606e77623e4ac53fe5e67aa7c19fc)
@@ -5,4 +5,5 @@
 
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.util.List;
 
@@ -10,5 +11,6 @@
     List<Projection> findAllProjections();
     List<Projection> getProjectionsForFilms(int id);
+    List<Projection> getProjectionsNow();
     Projection findById(Integer id_projection);
-Projection save(LocalDate date_time_start,LocalDate date_time_end, String type_of_technology, Integer id_film );
+    Projection save(LocalDateTime date_time_start, LocalDateTime date_time_end, String type_of_technology, Integer id_film, Integer id_room, Integer id_discount);
 }
Index: src/main/java/com/example/moviezone/service/SeatService.java
===================================================================
--- src/main/java/com/example/moviezone/service/SeatService.java	(revision 40935d39c559d7bead40536a999735ce35ae220b)
+++ src/main/java/com/example/moviezone/service/SeatService.java	(revision 1e7126f5a33606e77623e4ac53fe5e67aa7c19fc)
@@ -2,4 +2,5 @@
 
 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,5 +12,5 @@
     List<Seat> findAllSeats();
     List<Seat> findAllByProjection_Room(Projection_Room projection_room);
-    List<Seat> findAllByRoomAndCategory(Projection_Room projectionRoom, Category category);
+    List<Seat> findAllByRoomAndCategory(Projection projection, 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 40935d39c559d7bead40536a999735ce35ae220b)
+++ src/main/java/com/example/moviezone/service/TicketService.java	(revision 1e7126f5a33606e77623e4ac53fe5e67aa7c19fc)
@@ -13,3 +13,4 @@
     Ticket save(long price,Customer customer);
     Integer priceForTicket(int id);
+    void delete(int id);
 }
Index: src/main/java/com/example/moviezone/web/HomeController.java
===================================================================
--- src/main/java/com/example/moviezone/web/HomeController.java	(revision 40935d39c559d7bead40536a999735ce35ae220b)
+++ src/main/java/com/example/moviezone/web/HomeController.java	(revision 1e7126f5a33606e77623e4ac53fe5e67aa7c19fc)
@@ -3,4 +3,5 @@
 
 import com.example.moviezone.model.*;
+import com.example.moviezone.model.enums.GenreEnum;
 import com.example.moviezone.model.exceptions.PasswordsDoNotMatchException;
 
@@ -10,4 +11,5 @@
 import com.example.moviezone.model.procedures.FilmsReturnTable;
 
+import com.example.moviezone.model.procedures.TicketsCancelClass;
 import com.example.moviezone.service.*;
 import org.springframework.format.annotation.DateTimeFormat;
@@ -22,4 +24,7 @@
 import java.io.IOException;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.temporal.ChronoUnit;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.LinkedList;
@@ -47,6 +52,7 @@
 private final Projection_RoomService projectionRoomService;
 private final CustomerIsInterestedInEventService customerIsInterestedInEventService;
-
-    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, CustomerIsInterestedInEventService customerIsInterestedInEventService)
+private final DiscountService discountService;
+
+    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, CustomerIsInterestedInEventService customerIsInterestedInEventService, DiscountService discountService)
     {
 
@@ -67,4 +73,5 @@
         this.projectionRoomService = projectionRoomService;
         this.customerIsInterestedInEventService = customerIsInterestedInEventService;
+        this.discountService = discountService;
     }
 
@@ -127,5 +134,5 @@
         model.addAttribute("category",category);
 
-        List<Seat> seats=seatService.findAllByRoomAndCategory(projectionRoomService.getRoomByProjection(projection.getId_projection()).get(0),category);
+        List<Seat> seats=seatService.findAllByRoomAndCategory(projection,projectionRoomService.getRoomByProjection(projection.getId_projection()).get(0),category);
         model.addAttribute("seats",seats);
         model.addAttribute("bodyContent", "seats");
@@ -231,4 +238,5 @@
     public String getFilmsPage1(Model model,@RequestParam(required = false) Integer id_cinema){
         model.addAttribute("cinemas",cinemaService.findAllCinemas());
+        model.addAttribute("genres", GenreEnum.values());
         if (id_cinema!=null) {
             model.addAttribute("films",filmService.getFilmsFromCinema(id_cinema));
@@ -272,17 +280,41 @@
     {
         Customer customer=customerService.findByUsername(request.getRemoteUser());
-        model.addAttribute("tickets",ticketService.findAllByCustomer(customer));
+        List<Ticket> tickets = ticketService.findAllByCustomer(customer);
+        List<TicketsCancelClass> ticketsCancelClass = new ArrayList<>();
+        LocalDateTime oneDayLater = LocalDateTime.now().plus(1, ChronoUnit.DAYS);
+        for (int i = 0; i < tickets.size(); i++) {
+            if(tickets.get(i).getProjection().getDate_time_start().isAfter(oneDayLater)){
+                ticketsCancelClass.add(new TicketsCancelClass(tickets.get(i),true));
+            }else{
+                ticketsCancelClass.add(new TicketsCancelClass(tickets.get(i),false));
+            }
+        }
+        model.addAttribute("tickets",ticketsCancelClass);
         model.addAttribute("bodyContent","myTickets");
         return "master-template";
     }
+
+    @PostMapping("/cancelTicket/{id}")
+    public String getSeats(@PathVariable Long id, Model model) {
+        ticketService.delete(id.intValue());
+        return "redirect:/myTickets";
+    }
+
     @GetMapping("/addProjection")
+    @Transactional
     public  String getAddProjectionPage(Model model)
     {
         model.addAttribute("films",filmService.findAllFilms());
+        model.addAttribute("projection_rooms", projectionRoomService.findAllProjectionRooms());
+        model.addAttribute("discounts",discountService.getValidDiscounts());
         model.addAttribute("bodyContent","addProjection");
         return "master-template";
     }
-
-
+    @GetMapping("/addDiscount")
+    public  String getAddDiscountPage(Model model)
+    {
+        model.addAttribute("bodyContent","addDiscount");
+        return "master-template";
+    }
     @GetMapping("/addEvent")
     public  String getAddEventPage(Model model)
@@ -298,11 +330,23 @@
     }
 
+    @PostMapping("/addD")
+    public String saveEvent(@RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate validity,
+                            @RequestParam String type,
+                            @RequestParam String code,
+                            @RequestParam Integer percent)
+    {
+        discountService.save(code,type,validity,percent);
+        return "redirect:/home";
+    }
+
     @PostMapping("/addP")
-    public String saveProjection(@RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date_time_start,
-                                 @RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date_time_end,
+    public String saveProjection(@RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime date_time_start,
+                                 @RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime date_time_end,
                                  @RequestParam String type_of_technology,
-                                 @RequestParam Integer id_film)
-    {
-        projectionService.save(date_time_start,date_time_end,type_of_technology,id_film);
+                                 @RequestParam Integer id_film,
+                                @RequestParam Integer id_room,
+                                @RequestParam Integer id_discount)
+    {
+        projectionService.save(date_time_start,date_time_end,type_of_technology,id_film,id_room,id_discount);
          return "redirect:/home";
     }
@@ -350,4 +394,5 @@
         return "master-template";
     }
+
     @PostMapping("/addCinemaOrganizesEvent")
     public String saveCinemaOrganizesEvent(@RequestParam Integer id_cinema,
@@ -356,5 +401,5 @@
 
        cinemaOrganizesEventService.save(id_cinema,id_event);
-        return "redirect:/home";
+       return "redirect:/home";
     }
     @GetMapping("/addFilmToCinema")
