Changeset bcb4acc
- Timestamp:
- 08/24/23 03:31:06 (15 months ago)
- Branches:
- master
- Children:
- 4158cac
- Parents:
- 1e7126f
- Location:
- src/main
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/moviezone/service/Impl/SeatServiceImpl.java
r1e7126f rbcb4acc 43 43 List<Ticket> tickets=ticketService.findAllTickets(); 44 44 List<Seat> seats=seatRepository.findAllByCategoryAndProjection(category,projectionRoom); 45 45 List<Seat> pom = new ArrayList<>(); 46 46 for (int i = 0; i < tickets.size(); i++) { 47 47 if(tickets.get(i).getProjection()==projection){ 48 if( seats.contains(tickets.get(i).getSeat())){49 seats.remove(tickets.get(i).getSeat());48 if(!seats.contains(tickets.get(i).getSeat())){ 49 pom.add(seats.get(i)); 50 50 } 51 51 } 52 52 } 53 return seats;53 return pom; 54 54 } 55 55 -
src/main/java/com/example/moviezone/web/HomeController.java
r1e7126f rbcb4acc 236 236 @GetMapping("/films") 237 237 @Transactional 238 public String getFilmsPage1(Model model,@RequestParam(required = false) Integer id_cinema ){238 public String getFilmsPage1(Model model,@RequestParam(required = false) Integer id_cinema, @RequestParam(required = false) Integer id_genre){ 239 239 model.addAttribute("cinemas",cinemaService.findAllCinemas()); 240 model.addAttribute("genres", GenreEnum.values()); 240 List<GenreEnum> genres = List.of(GenreEnum.values()); 241 model.addAttribute("genres", genres); 242 List<Film> films = filmService.findAllFilms(); 241 243 if (id_cinema!=null) { 242 model.addAttribute("films",filmService.getFilmsFromCinema(id_cinema)); 243 }else{ 244 List<FilmsReturnTable> pom=new LinkedList<>(); 245 model.addAttribute("films",filmService.findAllFilms()); 246 } 244 films = filmService.getFilmsFromCinema(id_cinema); 245 } 246 if ( id_genre != null){ 247 List<Film> pom= new ArrayList<>(); 248 for (int i = 0; i < films.size(); i++) { 249 if(films.get(i).getGenre().contains(genres.get(id_genre).name().toLowerCase())){ 250 pom.add(films.get(i)); 251 } 252 } 253 films=pom; 254 } 255 model.addAttribute("films",films); 247 256 model.addAttribute("bodyContent","films"); 248 257 return "master-template"; … … 270 279 model.addAttribute("events",eventService.getEventsFromCinema(id_cinema)); 271 280 }else{ 272 List<FilmsReturnTable> pom=new LinkedList<>();273 281 model.addAttribute("events",eventService.getEventsNow()); 274 282 } -
src/main/resources/templates/events.html
r1e7126f rbcb4acc 207 207 <label style="color: white;font-size: 20px;font-weight: bold">Избери Кино:</label> 208 208 <select name="id_cinema" class="form-control" id="id_cinema"> 209 <option th:value="${null}" text="Please Select"></option> 209 210 <option 210 th:selected="${cinemas.get(1)}"211 211 th:each="cinema : ${cinemas}" 212 212 th:value="${cinema.getId_cinema()}" -
src/main/resources/templates/films.html
r1e7126f rbcb4acc 207 207 <label style="color: white;font-size: 20px;font-weight: bold">Избери Кино:</label> 208 208 <select name="id_cinema" class="form-control" id="id_cinema"> 209 <option th:value="${null}" text="Please Select"></option> 209 210 <option 210 th:selected="${cinemas.get(1)}"211 211 th:each="cinema : ${cinemas}" 212 212 th:value="${cinema.getId_cinema()}" … … 218 218 <div class="form-group"> 219 219 <label style="color: white;font-size: 20px;font-weight: bold">Избери Жарн:</label> 220 <select name="id_cinema" class="form-control" id="id_cinema"> 220 <select name="id_genre" class="form-control" id="id_genre"> 221 <option th:value="${null}" text="Please Select"></option> 221 222 <option 222 th:selected="${genres.get(1)}"223 223 th:each="genre : ${genres}" 224 th:value="${ }"225 th:text="${ cinema.getName()}">224 th:value="${genre.ordinal}" 225 th:text="${genre.name}"> 226 226 </option> 227 227 </select> -
src/main/resources/templates/projections.html
r1e7126f rbcb4acc 206 206 <label style="color: white;font-size: 20px;font-weight: bold">Избери Кино:</label> 207 207 <select name="id_cinema" class="form-control" id="id_cinema"> 208 <option th:value="${null}" text="Please Select"></option> 208 209 <option 209 th:selected="${cinemas.get(1)}"210 210 th:each="cinema : ${cinemas}" 211 211 th:value="${cinema.getId_cinema()}"
Note:
See TracChangeset
for help on using the changeset viewer.