diff --git a/src/main/java/controller/InvitePatient.java b/src/main/java/controller/InvitePatient.java new file mode 100644 index 0000000..a6a0992 --- /dev/null +++ b/src/main/java/controller/InvitePatient.java @@ -0,0 +1,25 @@ +package controller; + +import model.service.condition.ConditionManager; +import model.service.registration.Registration; + +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import java.io.IOException; + + +@WebServlet("/invitePatient") +public class InvitePatient extends HttpServlet { + + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { + HttpSession session = request.getSession(); + model.service.registration.Registration registration=new Registration(); + registration.invitePatient((Integer) session.getAttribute("id"),(String) request.getParameter("email"),(String) request.getParameter("nome"),(String) request.getParameter("cognome")); + response.sendRedirect("JSP/homeTherapist.jsp"); + + } + +} \ No newline at end of file diff --git a/src/main/webapp/JSP/homeTherapist.jsp b/src/main/webapp/JSP/homeTherapist.jsp index 94fd079..171b747 100644 --- a/src/main/webapp/JSP/homeTherapist.jsp +++ b/src/main/webapp/JSP/homeTherapist.jsp @@ -17,27 +17,27 @@
PAZIENTI
-
+
- - - - - - - - - - - <% - if(session.getAttribute("type")!=null && session.getAttribute("type").equals("therapist")){ - @SuppressWarnings("unchecked") - ArrayList list_user= new UserData().getUsersAndPersonalInfoByIdTherapist((Integer) session.getAttribute("id")); - SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); +
Inizio Terapia Progressi
+ + + + + + + + + + <% + if(session.getAttribute("type")!=null && session.getAttribute("type").equals("therapist")){ + @SuppressWarnings("unchecked") + ArrayList list_user= new UserData().getUsersAndPersonalInfoByIdTherapist((Integer) session.getAttribute("id")); + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); - for(UserInfo u: list_user){ - %> - + for(UserInfo u: list_user){ + %> + @@ -51,16 +51,16 @@ Visualizza - - <% + + <% + } + } else { + response.sendRedirect("../errorPage/403.html"); } - } else { - response.sendRedirect("../errorPage/403.html"); - } - %> - -
Inizio Terapia Progressi
<%=u.getFirstname()%> <%=u.getLastname()%>
-
+ %> + + +
@@ -84,15 +84,14 @@
-
+
- - + + + \ No newline at end of file diff --git a/src/main/webapp/JSP/invitePatient.jsp b/src/main/webapp/JSP/invitePatient.jsp new file mode 100644 index 0000000..1b01e0a --- /dev/null +++ b/src/main/webapp/JSP/invitePatient.jsp @@ -0,0 +1,49 @@ + + + + Invita Paziente + + +<% + if(session.getAttribute("type")!=null && session.getAttribute("type").equals("therapist")){ +%> +
+
+

Invita Paziente

+
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ + < Torna alla home +
+
+ +<% + }else { + response.sendRedirect("../errorPage/403.html"); + } +%> + + \ No newline at end of file