From d92758101ba53966da7abc2a859b5b3b08daeffa Mon Sep 17 00:00:00 2001 From: DDDrag0 Date: Tue, 2 Jan 2024 01:53:32 +0100 Subject: [PATCH] fixed and finished the dummy jsp for schedule prenotation and gestion --- src/main/java/controller/ScheduleServlet.java | 3 - src/main/webapp/JSP/schedule.jsp | 343 ++++++++++++++---- 2 files changed, 269 insertions(+), 77 deletions(-) diff --git a/src/main/java/controller/ScheduleServlet.java b/src/main/java/controller/ScheduleServlet.java index 90217e9..8b1a22e 100644 --- a/src/main/java/controller/ScheduleServlet.java +++ b/src/main/java/controller/ScheduleServlet.java @@ -1,11 +1,8 @@ package controller; -import model.entity.Schedule; import model.service.schedule.ScheduleManager; import java.io.IOException; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; diff --git a/src/main/webapp/JSP/schedule.jsp b/src/main/webapp/JSP/schedule.jsp index 8d2dbab..cebafd9 100644 --- a/src/main/webapp/JSP/schedule.jsp +++ b/src/main/webapp/JSP/schedule.jsp @@ -1,7 +1,23 @@ +<%@ page import="java.util.*" %> +<%@ page import="model.service.user.UserData" %> +<%@ page import="model.entity.User" %> +<%@ page import="model.service.user.UserRegistry" %> +<%@ page import="model.entity.PersonalInfo" %> +<%@ page import="model.entity.Schedule" %> +<%@ page import="model.service.schedule.ScheduleManager" %> +<% + /*if(session.getAttribute("id") == "null") { + response.sendRedirect("../errorPage/403.html"); + } + else { + int userId = (Integer) session.getAttribute("id");*/ +%> - + - schedule + <%@page contentType="text/html;charset=UTF-8"%> + + TalkAId - Schedule Prenotazioni @@ -13,89 +29,268 @@
- +
-

paziente

-

prenotazioni disponibili

- - - - - - - - - - - - - - - - -
TerapistaDataOrarioPaziente
row 1row 1row 1row 1row 1
-

le mie prenotazioni

- - - - - - - - - - - - - - - - -
TerapistaDataOrarioPaziente
row 1row 1row 1row 1row 1
+ + + + + + +

logopedista

le mie prenotate

- - - - - - - - - - - - - - - - -
TerapistaDataOrarioPaziente
row 1row 1row 1row 1row 1
+ + + + + + + + + + <% + ScheduleManager scheduleManager = new ScheduleManager(); + List list = scheduleManager.retrieveAllPrenotedSchedules(9); + if(list!=null){ + for(Schedule schedule : list) { + UserRegistry ur = new UserRegistry(); + PersonalInfo data1 = ur.getPersonalInfo(schedule.getIdTherapist()); + PersonalInfo data2 = ur.getPersonalInfo(schedule.getReserved()); + %> +
+
+ + + + <% + if(schedule.getReserved()==0){ + %> + + <% + }else{ + %> + + <% + } + %> + + + + + + + + <% + } + }else{ + %> + + + + <% + } + %> +
TerapistaDataOrarioPaziente
<%=data1.getFirstname()%> <%=data1.getLastname()%><%=schedule.getDate()%><%=schedule.getTimeSlot()%>nessuno<%=data2.getFirstname()%> <%=data2.getLastname()%> + +
ancora nessuna prenotazione ricevuta
+ + + +

le mie schedule

- - - - - - - - - - - - - - - - -
TerapistaDataOrarioPaziente
row 1row 1row 1row 1row 1
+ + + + + + + + + + <% + ScheduleManager scheduleManager2 = new ScheduleManager(); + List list2 = scheduleManager2.retrieveAllTherapistSchedules(9); + if(list2!=null){ + for(Schedule schedule : list2) { + UserRegistry ur = new UserRegistry(); + PersonalInfo data1 = ur.getPersonalInfo(schedule.getIdTherapist()); + PersonalInfo data2 = ur.getPersonalInfo(schedule.getReserved()); + %> +
+
+ + + + <% + if(schedule.getReserved()==0){ + %> + + <% + }else{ + %> + + <% + } + %> + + + + + + + + <% + } + }else{ + %> + + + + <% + } + %> +
TerapistaDataOrarioPaziente
<%=data1.getFirstname()%> <%=data1.getLastname()%><%=schedule.getDate()%><%=schedule.getTimeSlot()%>nessuno<%=data2.getFirstname()%> <%=data2.getLastname()%> + +
+ +
ancora nessuna prenotazione ricevuta
+ + + + + + + +

paziente

+

prenotazioni disponibili

+ + + + + + + + + + <% + ScheduleManager scheduleManager3 = new ScheduleManager(); + List list3 = scheduleManager3.retrieveAllNotPrenotedSchedules(9); + if(list3!=null){ + for(Schedule schedule : list3) { + UserRegistry ur = new UserRegistry(); + PersonalInfo data1 = ur.getPersonalInfo(schedule.getIdTherapist()); + PersonalInfo data2 = ur.getPersonalInfo(schedule.getReserved()); + %> +
+
+ + + + <% + if(schedule.getReserved()==0){ + %> + + <% + }else{ + %> + + <% + } + %> + + + + + + + + <% + } + }else{ + %> + + + + <% + } + %> +
TerapistaDataOrarioPaziente
<%=data1.getFirstname()%> <%=data1.getLastname()%><%=schedule.getDate()%><%=schedule.getTimeSlot()%>nessuno<%=data2.getFirstname()%> <%=data2.getLastname()%> + +
ancora nessuna prenotazione ricevuta
+ + + + +

le mie prenotazioni

+ + + + + + + + + + <% + ScheduleManager scheduleManager4 = new ScheduleManager(); + List list4 = scheduleManager4.retrieveAllPatientSchedules(15); + if(list4!=null){ + for(Schedule schedule : list4) { + UserRegistry ur = new UserRegistry(); + PersonalInfo data1 = ur.getPersonalInfo(schedule.getIdTherapist()); + PersonalInfo data2 = ur.getPersonalInfo(schedule.getReserved()); + %> +
+
+ + + + <% + if(schedule.getReserved()==0){ + %> + + <% + }else{ + %> + + <% + } + %> + + + + + + + + <% + } + }else{ + %> + + + + <% + } + %> +
TerapistaDataOrarioPaziente
<%=data1.getFirstname()%> <%=data1.getLastname()%><%=schedule.getDate()%><%=schedule.getTimeSlot()%>nessuno<%=data2.getFirstname()%> <%=data2.getLastname()%> + +
ancora nessuna prenotazione ricevuta
+ + + + +<% + //} +%> \ No newline at end of file