diff --git a/src/main/java/controller/invitePatient.java b/src/main/java/controller/invitePatient.java new file mode 100644 index 0000000..81bb25e --- /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"); + + } + +} diff --git a/src/main/webapp/CSS/invitePatient.css b/src/main/webapp/CSS/invitePatient.css new file mode 100644 index 0000000..abfadde --- /dev/null +++ b/src/main/webapp/CSS/invitePatient.css @@ -0,0 +1,130 @@ +* { + margin: 0; + padding: 0; + font-family: Georgia, sans-serif; +} + +body { + height: 100%; + width: 100%; + display: flex; + flex-direction: column; +} + +a { + color: #199a8e; + text-decoration: none; + font-size: 13px; +} + +/* Aggiunta di stili per il pop-up */ +#InvitePopupOverlay { + display: none; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.5); + z-index: 1000; + justify-content: center; + align-items: center; +} + +#InvitePage { + width: 154px; + background-color: #fff; + padding: 80px; + border-radius: 10px; + text-align: center; + position: fixed; + top: 43%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 1001; + border: 2px solid #000; +} + + +.homeTherapistOverlay { + transition: opacity 0.3s ease; +} + +#InvitePopupOverlay.visible .homeTherapistOverlay { + opacity: 0.5; +} + +#InviteTitle{ + margin-top: -16%; + font-size: 20px;; +} + + +#InviteForm{ + margin-top: 5%; + width: 70%; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; +} + +.inputDiv{ + width: 217%; + display: flex; + flex-direction: row; + justify-content: space-between; + background-color: #f9fafb; + border: 2px solid #e8eaed; + border-radius: 500px; + margin-bottom: -1%; +} + +.icon{ + display: flex; + justify-content: center; + align-items: center; + text-align: center; + width: 10%; +} + +.iconLeft{ + margin-left: 3%; +} + + + +.icon > img{ + width: 50%; +} + +.formInput{ + padding: 5% 7%; + height: 90%; + width: 80%; + border: none; + border-radius: 27px; + background-color: #f9fafb; + font-size: 15px; +} + +.formInput:focus{ + border: none; + outline: none; +} + + +#InviteButton{ + color: white; + width: 100%; + background-color: #199a8e; + border: none; + padding: 5% 10%; + border-radius: 500px; + margin-bottom: 20px; + display: inline-block; + font-size: 21px; +} + + + diff --git a/src/main/webapp/JS/searchBar.js b/src/main/webapp/JS/homeTherapist.js similarity index 73% rename from src/main/webapp/JS/searchBar.js rename to src/main/webapp/JS/homeTherapist.js index 9219285..b3373a9 100644 --- a/src/main/webapp/JS/searchBar.js +++ b/src/main/webapp/JS/homeTherapist.js @@ -21,4 +21,15 @@ $(document).ready(function () { } }); }); -}); \ No newline at end of file +}); +/*POPUP INVITE PATIENT*/ +function openInvitePopup() { + document.getElementById("invitePopup").style.display = "block"; +} +function InvitePatient(){ + window.location.href = "invitePatient.jsp"; +} +/*VIEW PATIENT*/ +function viewPatient(i){ + window.location.href = "view_patient.jsp?patientID="+i; +} diff --git a/src/main/webapp/JSP/homeTherapist.jsp b/src/main/webapp/JSP/homeTherapist.jsp index 94fd079..e69de29 100644 --- a/src/main/webapp/JSP/homeTherapist.jsp +++ b/src/main/webapp/JSP/homeTherapist.jsp @@ -1,98 +0,0 @@ -<%@ page import="model.entity.*"%> -<%@ page import="model.service.user.UserData"%> -<%@ page import="java.util.ArrayList"%> -<%@ page import="java.text.SimpleDateFormat" %> - - - - - - - - Home - - -
-
-
-
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"); - - for(UserInfo u: list_user){ - %> - - - - - - - - - - <% - } - } else { - response.sendRedirect("../errorPage/403.html"); - } - %> - -
Inizio Terapia Progressi
<%=u.getFirstname()%> <%=u.getLastname()%><%= sdf.format(u.getActivationDate()) %> -
72%
-
- - - Visualizza -
-
- -
-
- -
-
-
-
- - - -
- - - -
Dr.
<%=(String) session.getAttribute("name") + " " + (String)session.getAttribute("surname")%>
- -
-
- - -
-
-
-
-
-
- - - - \ 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