From 21cb0bf19e57955adc591f86fe915ac13b7e448b Mon Sep 17 00:00:00 2001 From: Sewaaa Date: Sun, 7 Jan 2024 19:54:29 +0100 Subject: [PATCH 1/2] page for invite a new Patient --- src/main/java/controller/invitePatient.java | 25 +++++ src/main/webapp/CSS/invitePatient.css | 106 ++++++++++++++++++++ src/main/webapp/JSP/homeTherapist.jsp | 5 +- src/main/webapp/JSP/invitePatient.jsp | 48 +++++++++ 4 files changed, 183 insertions(+), 1 deletion(-) create mode 100644 src/main/java/controller/invitePatient.java create mode 100644 src/main/webapp/CSS/invitePatient.css create mode 100644 src/main/webapp/JSP/invitePatient.jsp 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..d198e7e --- /dev/null +++ b/src/main/webapp/CSS/invitePatient.css @@ -0,0 +1,106 @@ +* { + 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; +} + +#return{ + font-size: 30px; +} + + +#InvitePage{ + width: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + text-align: center; +} + +#InviteTitle{ + margin-top: 10%; + font-size: 3em; +} + + +#InviteForm{ + margin-top: 5%; + width: 70%; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; +} + +.inputDiv{ + width: 100%; + height: 10%; + display: flex; + flex-direction: row; + justify-content: space-between; + background-color: #f9fafb; + border: 2px solid #e8eaed; + border-radius: 500px; + margin-bottom: 4%; +} + +.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% 5%; + height: 90%; + width: 80%; + border: none; + background-color: #f9fafb; + font-size: 2em; +} + +.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: 2em; +} + + + diff --git a/src/main/webapp/JSP/homeTherapist.jsp b/src/main/webapp/JSP/homeTherapist.jsp index bb7231f..75a81fb 100644 --- a/src/main/webapp/JSP/homeTherapist.jsp +++ b/src/main/webapp/JSP/homeTherapist.jsp @@ -84,7 +84,7 @@
-
+
@@ -93,6 +93,9 @@ function viewPatient(i){ window.location.href = "view_patient.jsp?patientID="+i; } + function InvitePatient(){ + window.location.href = "invitePatient.jsp"; + } \ 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..1e4fc36 --- /dev/null +++ b/src/main/webapp/JSP/invitePatient.jsp @@ -0,0 +1,48 @@ + + + + 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 From a9c8d22423b1f4b3fcd92eb97ef23e05e723a2a7 Mon Sep 17 00:00:00 2001 From: Sewaaa Date: Sun, 7 Jan 2024 23:08:04 +0100 Subject: [PATCH 2/2] popup version --- src/main/webapp/CSS/invitePatient.css | 56 +++++++++++++------ .../JS/{searchBar.js => homeTherapist.js} | 13 ++++- src/main/webapp/JSP/homeTherapist.jsp | 16 ++---- src/main/webapp/JSP/invitePatient.jsp | 3 +- 4 files changed, 60 insertions(+), 28 deletions(-) rename src/main/webapp/JS/{searchBar.js => homeTherapist.js} (73%) diff --git a/src/main/webapp/CSS/invitePatient.css b/src/main/webapp/CSS/invitePatient.css index d198e7e..abfadde 100644 --- a/src/main/webapp/CSS/invitePatient.css +++ b/src/main/webapp/CSS/invitePatient.css @@ -14,25 +14,49 @@ body { a { color: #199a8e; text-decoration: none; + font-size: 13px; } -#return{ - font-size: 30px; -} - - -#InvitePage{ +/* Aggiunta di stili per il pop-up */ +#InvitePopupOverlay { + display: none; + position: fixed; + top: 0; + left: 0; width: 100%; - display: flex; - flex-direction: column; + 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: 10%; - font-size: 3em; + margin-top: -16%; + font-size: 20px;; } @@ -46,15 +70,14 @@ a { } .inputDiv{ - width: 100%; - height: 10%; + width: 217%; display: flex; flex-direction: row; justify-content: space-between; background-color: #f9fafb; border: 2px solid #e8eaed; border-radius: 500px; - margin-bottom: 4%; + margin-bottom: -1%; } .icon{ @@ -76,12 +99,13 @@ a { } .formInput{ - padding: 5% 5%; + padding: 5% 7%; height: 90%; width: 80%; border: none; + border-radius: 27px; background-color: #f9fafb; - font-size: 2em; + font-size: 15px; } .formInput:focus{ @@ -99,7 +123,7 @@ a { border-radius: 500px; margin-bottom: 20px; display: inline-block; - font-size: 2em; + 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 75a81fb..e946be5 100644 --- a/src/main/webapp/JSP/homeTherapist.jsp +++ b/src/main/webapp/JSP/homeTherapist.jsp @@ -84,18 +84,14 @@
-
+
- - + + + \ No newline at end of file diff --git a/src/main/webapp/JSP/invitePatient.jsp b/src/main/webapp/JSP/invitePatient.jsp index 1e4fc36..1b01e0a 100644 --- a/src/main/webapp/JSP/invitePatient.jsp +++ b/src/main/webapp/JSP/invitePatient.jsp @@ -9,8 +9,9 @@ %>
-

Invita Paziente

+

Invita Paziente

+