From 130b2ce043de400c02c513120e8824ee019f9797 Mon Sep 17 00:00:00 2001 From: Sewaaa Date: Tue, 16 Jan 2024 20:00:36 +0100 Subject: [PATCH 01/11] FE and BE Exercise reccomendation + fix FE Condition manager --- src/main/java/model/DAO/DAOExercise.java | 3 + .../java/model/DAO/DAOExerciseGlossary.java | 69 ++++++++++++++ .../service/exercise/ExerciseManager.java | 4 + .../exercise/ExerciseManagerInterface.java | 16 ++++ .../CSS/RecommendationAndConditionManager.css | 18 ++++ .../webapp/JSP/exerciseRecommendation.jsp | 93 +++++++++++++++++++ .../webapp/JSP/patientConditionManager.jsp | 9 +- src/main/webapp/JSP/viewPatient.jsp | 5 +- 8 files changed, 211 insertions(+), 6 deletions(-) create mode 100644 src/main/webapp/CSS/RecommendationAndConditionManager.css create mode 100644 src/main/webapp/JSP/exerciseRecommendation.jsp diff --git a/src/main/java/model/DAO/DAOExercise.java b/src/main/java/model/DAO/DAOExercise.java index e59658d..b2ae1bf 100644 --- a/src/main/java/model/DAO/DAOExercise.java +++ b/src/main/java/model/DAO/DAOExercise.java @@ -1,6 +1,7 @@ package model.DAO; import model.entity.Exercise; +import model.entity.ExerciseGlossary; import model.entity.Schedule; import model.entity.SlimmerExercise; @@ -173,6 +174,8 @@ public List retrieveAllPatientExerciseDone(int userID) { return exercises; } + + public Blob getExerciseExecution(int userID, int exerciseID, Date insertDate) { String query = "SELECT Execution FROM exercise WHERE ID_user = ? AND ID_exercise = ? AND InsertionDate = ?"; PreparedStatement preparedStatement = null; diff --git a/src/main/java/model/DAO/DAOExerciseGlossary.java b/src/main/java/model/DAO/DAOExerciseGlossary.java index 9f3b64b..e6480d5 100644 --- a/src/main/java/model/DAO/DAOExerciseGlossary.java +++ b/src/main/java/model/DAO/DAOExerciseGlossary.java @@ -6,6 +6,8 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; /** @@ -82,4 +84,71 @@ public ExerciseGlossary getExerciseByCode(int code) { return null; } + + public List retrieveAllPatientExerciseGlossaryNotDone(int userID) { + String query = "SELECT eg.* FROM exercise_glossary eg LEFT JOIN exercise e ON eg.ID_exercise = e.ID_exercise AND e.ID_user = ? WHERE e.ID_user IS NULL;\n"; + PreparedStatement preparedStatement = null; + ResultSet resultSet = null; + List exercises = new ArrayList<>(); + + try { + connection = connection.isClosed() ? DAOConnection.getConnection() : connection; + preparedStatement = connection.prepareStatement(query); + preparedStatement.setInt(1, userID); + + resultSet = preparedStatement.executeQuery(); + + while (resultSet.next()) { + ExerciseGlossary exercise = extractExerciseFromResultSet(resultSet); + exercises.add(exercise); + } + + } catch (SQLException e) { + e.printStackTrace(); + } finally { + try { + if (resultSet != null) resultSet.close(); + if (preparedStatement != null) preparedStatement.close(); + DAOConnection.releaseConnection(connection); + } catch (SQLException e) { + e.printStackTrace(); + } + } + + return exercises; + } + + public List retrieveAllPatientExerciseGlossaryDone(int userID) { + String query = "SELECT eg.* FROM exercise_glossary eg JOIN exercise e ON eg.ID_exercise = e.ID_exercise\n" + + "WHERE e.ID_user = ?;\n"; + PreparedStatement preparedStatement = null; + ResultSet resultSet = null; + List exercises = new ArrayList<>(); + + try { + connection = connection.isClosed() ? DAOConnection.getConnection() : connection; + preparedStatement = connection.prepareStatement(query); + preparedStatement.setInt(1, userID); + + resultSet = preparedStatement.executeQuery(); + + while (resultSet.next()) { + ExerciseGlossary exercise = extractExerciseFromResultSet(resultSet); + exercises.add(exercise); + } + + } catch (SQLException e) { + e.printStackTrace(); + } finally { + try { + if (resultSet != null) resultSet.close(); + if (preparedStatement != null) preparedStatement.close(); + DAOConnection.releaseConnection(connection); + } catch (SQLException e) { + e.printStackTrace(); + } + } + + return exercises; + } } diff --git a/src/main/java/model/service/exercise/ExerciseManager.java b/src/main/java/model/service/exercise/ExerciseManager.java index 317b77f..411aa1d 100644 --- a/src/main/java/model/service/exercise/ExerciseManager.java +++ b/src/main/java/model/service/exercise/ExerciseManager.java @@ -43,4 +43,8 @@ public List retrieveDoneExercises(int patientId) { public List retrieveNotDoneExercises(int patientId) { return daoE.retrieveNotDoneExercises(patientId); } + + public List retrieveAllPatientExerciseGlossaryNotDone(int userID) { return daoEG.retrieveAllPatientExerciseGlossaryNotDone(userID);} + + public List retrieveAllPatientExerciseGlossaryDone(int userID) { return daoEG.retrieveAllPatientExerciseGlossaryDone(userID);} } diff --git a/src/main/java/model/service/exercise/ExerciseManagerInterface.java b/src/main/java/model/service/exercise/ExerciseManagerInterface.java index 6d3ad23..490c1b3 100644 --- a/src/main/java/model/service/exercise/ExerciseManagerInterface.java +++ b/src/main/java/model/service/exercise/ExerciseManagerInterface.java @@ -65,4 +65,20 @@ public interface ExerciseManagerInterface { * @return Una lista di oggetti SlimmerExercise che rappresentano gli esercizi non fatti dal paziente. */ public List retrieveNotDoneExercises(int patientId); + + /** + * Recupera una lista delle info degli esercizi che un paziente non ha ancora fatto. + * + * @param userID L'ID del paziente. + * @return Una lista di oggetti ExerciseGlossary che rappresentano gli esercizi non fatti dal paziente. + */ + public List retrieveAllPatientExerciseGlossaryNotDone(int userID); + + /** + * Recupera una lista delle info degli esercizi che un paziente ha fatto. + * + * @param userID L'ID del paziente. + * @return Una lista di oggetti ExerciseGlossary che rappresentano gli esercizi non fatti dal paziente. + */ + public List retrieveAllPatientExerciseGlossaryDone(int userID); } diff --git a/src/main/webapp/CSS/RecommendationAndConditionManager.css b/src/main/webapp/CSS/RecommendationAndConditionManager.css new file mode 100644 index 0000000..4f10cc5 --- /dev/null +++ b/src/main/webapp/CSS/RecommendationAndConditionManager.css @@ -0,0 +1,18 @@ +table { + width: 80%; + border-collapse: collapse; + margin: 20px auto; +} + +table, th, td { + border: 1px solid black; +} + +th, td { + padding: 10px; + text-align: left; +} + +form { + display: inline; +} \ No newline at end of file diff --git a/src/main/webapp/JSP/exerciseRecommendation.jsp b/src/main/webapp/JSP/exerciseRecommendation.jsp new file mode 100644 index 0000000..c86f8f0 --- /dev/null +++ b/src/main/webapp/JSP/exerciseRecommendation.jsp @@ -0,0 +1,93 @@ +<%@ page import="java.util.ArrayList" %> +<%@ page import="model.service.condition.ConditionManager" %> +<%@ page import="model.service.user.UserData" %> +<%@ page import="model.service.exercise.ExerciseManager" %> +<%@ page import="java.util.List" %> +<%@ page import="model.entity.*" %> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Raccomanda Esercizio + + + +<% + int userId = 0; + if(session.getAttribute("type")!=null && !session.getAttribute("type").equals("therapist") || request.getParameter("userId")==null) { + response.sendRedirect("../errorPage/403.html"); + }else { + userId = Integer.parseInt((request.getParameter("userId"))); + + int userTherapist = new UserData().getUser(userId).getIdTherapist(); + if (userTherapist != (Integer) session.getAttribute("id")) { + response.sendRedirect("../errorPage/403.html"); + } + } + ExerciseManager ExerciseService= new ExerciseManager(); + + List list_Exercisedone = ExerciseService.retrieveAllPatientExerciseGlossaryDone(userId); + List list_ExerciseNOTdone = ExerciseService.retrieveAllPatientExerciseGlossaryNotDone(userId); +%> +Home + + + + + + + + + + + + + + <% for (ExerciseGlossary exerciseGlossary : list_Exercisedone) { %> + + + + + + + + + <% } %> + +
Esercizi Fatti
IDNameDescriptionTypeDifficultyTarget
<%= exerciseGlossary.getIdExercise() %><%= exerciseGlossary.getExerciseName() %><%= exerciseGlossary.getExerciseDescription() %><%= exerciseGlossary.getType() %><%= exerciseGlossary.getDifficulty()%><%= exerciseGlossary.getTarget()%>
+
+ + + + + + + + + + + + + + + <% for (ExerciseGlossary exerciseGlossary : list_ExerciseNOTdone) { %> + + + + + + + + + + + + <% } %> + +
Raccomanda Esercizi
IDNameDescriptionTypeDifficultyTarget
<%= exerciseGlossary.getIdExercise() %><%= exerciseGlossary.getExerciseName() %><%= exerciseGlossary.getExerciseDescription() %><%= exerciseGlossary.getType() %><%= exerciseGlossary.getDifficulty()%><%= exerciseGlossary.getTarget()%>
+ + + +
+ + + diff --git a/src/main/webapp/JSP/patientConditionManager.jsp b/src/main/webapp/JSP/patientConditionManager.jsp index 571c088..cb0e0d2 100644 --- a/src/main/webapp/JSP/patientConditionManager.jsp +++ b/src/main/webapp/JSP/patientConditionManager.jsp @@ -8,7 +8,8 @@ <%@ page contentType="text/html;charset=UTF-8" language="java" %> - Condition + Patologie + <% @@ -23,8 +24,6 @@ response.sendRedirect("../errorPage/403.html"); } } - - ConditionManager ConditionService= new ConditionManager(); ArrayList list_PatientCondition = ConditionService.getConditionsOfPatient(userId); @@ -32,7 +31,7 @@ %> Home - + @@ -62,7 +61,7 @@
Condition of patientPatologie del paziente
ID

- + diff --git a/src/main/webapp/JSP/viewPatient.jsp b/src/main/webapp/JSP/viewPatient.jsp index 6450cf7..9633ce4 100644 --- a/src/main/webapp/JSP/viewPatient.jsp +++ b/src/main/webapp/JSP/viewPatient.jsp @@ -71,7 +71,7 @@
Modifica patologie
-
+
Raccomanda Esercizio
@@ -101,6 +101,9 @@ function redirectToGestioneMalattie() { window.location.href = 'patientConditionManager.jsp?userId='+<%=user_selected.getIdUser() %>; } + function redirectToGestioneRaccomandazioni() { + window.location.href = 'exerciseRecommendation.jsp?userId='+<%=user_selected.getIdUser() %>; + } <%} %> From 104a4a92d1897ac006a720274f82fa8c9f0d4ccd Mon Sep 17 00:00:00 2001 From: Sewaaa Date: Wed, 17 Jan 2024 13:36:14 +0100 Subject: [PATCH 02/11] FE and BE Exercise reccomendation + fix Condition manager --- .../controller/exerciseRecommendation.java | 29 ++++++++++ src/main/java/model/DAO/DAOCondition.java | 34 ++++++------ src/main/java/model/DAO/DAOExercise.java | 54 ++++++++++++++++--- .../service/exercise/ExerciseManager.java | 2 + .../exercise/ExerciseManagerInterface.java | 9 ++++ .../webapp/JSP/exerciseRecommendation.jsp | 6 +-- 6 files changed, 108 insertions(+), 26 deletions(-) create mode 100644 src/main/java/controller/exerciseRecommendation.java diff --git a/src/main/java/controller/exerciseRecommendation.java b/src/main/java/controller/exerciseRecommendation.java new file mode 100644 index 0000000..c28d726 --- /dev/null +++ b/src/main/java/controller/exerciseRecommendation.java @@ -0,0 +1,29 @@ +package controller; + + import model.service.condition.ConditionManager; + import model.service.exercise.ExerciseManager; + + import javax.servlet.annotation.WebServlet; + import javax.servlet.http.HttpServlet; + import javax.servlet.http.HttpServletRequest; + import javax.servlet.http.HttpServletResponse; + import java.io.IOException; + + +@WebServlet("/exerciseRecommendation") +public class exerciseRecommendation extends HttpServlet { + + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { + String referer = request.getHeader("Referer"); + ExerciseManager exerciseService= new ExerciseManager(); + + int idExercise = Integer.parseInt(request.getParameter("idExercise")); + int idPatient = Integer.parseInt(request.getParameter("idPatient")); + + exerciseService.AddExerciseRecommendation(idExercise,idPatient); + + response.sendRedirect(referer); + + } + +} diff --git a/src/main/java/model/DAO/DAOCondition.java b/src/main/java/model/DAO/DAOCondition.java index e1c569f..73451a2 100644 --- a/src/main/java/model/DAO/DAOCondition.java +++ b/src/main/java/model/DAO/DAOCondition.java @@ -127,20 +127,20 @@ public ArrayList getConditionsNOTOfPatient(int id_patient) { public boolean AddConditionPatient(int ID_condition, int ID_patient, int Severity) { - PreparedStatement preparedStatementPersonalInfo = null; + PreparedStatement preparedStatement = null; try { connection = connection.isClosed() ? DAOConnection.getConnection():connection; connection.setAutoCommit(false); // Start a transaction - // Insert user data into personal_info table - String queryAnagrafica = "INSERT INTO PatientCondition (ID_condition, ID_patient, Severity)\n" + + + String query = "INSERT INTO PatientCondition (ID_condition, ID_patient, Severity)\n" + "VALUES (?, ?, ?)"; - preparedStatementPersonalInfo = connection.prepareStatement(queryAnagrafica); - preparedStatementPersonalInfo.setInt(1, ID_condition); - preparedStatementPersonalInfo.setInt(2, ID_patient); - preparedStatementPersonalInfo.setInt(3, Severity); - preparedStatementPersonalInfo.executeUpdate(); + preparedStatement = connection.prepareStatement(query); + preparedStatement.setInt(1, ID_condition); + preparedStatement.setInt(2, ID_patient); + preparedStatement.setInt(3, Severity); + preparedStatement.executeUpdate(); connection.commit(); // Commit the transaction return true; // User created successfully @@ -157,7 +157,7 @@ public boolean AddConditionPatient(int ID_condition, int ID_patient, int Severit } } finally { try { - if (preparedStatementPersonalInfo != null) preparedStatementPersonalInfo.close(); + if (preparedStatement != null) preparedStatement.close(); DAOConnection.releaseConnection(connection); } catch (SQLException e) { // Handle the exception (e.g., log or throw) @@ -170,19 +170,19 @@ public boolean AddConditionPatient(int ID_condition, int ID_patient, int Severit public boolean RemoveConditionPatient(int ID_condition, int ID_patient) { - PreparedStatement preparedStatementPersonalInfo = null; + PreparedStatement preparedStatement = null; try { connection = connection.isClosed() ? DAOConnection.getConnection():connection; connection.setAutoCommit(false); // Start a transaction - // Insert user data into personal_info table - String queryAnagrafica = "DELETE FROM PatientCondition\n" + + + String query = "DELETE FROM PatientCondition\n" + "WHERE ID_condition = ? AND ID_patient = ?;"; - preparedStatementPersonalInfo = connection.prepareStatement(queryAnagrafica); - preparedStatementPersonalInfo.setInt(1, ID_condition); - preparedStatementPersonalInfo.setInt(2, ID_patient); - preparedStatementPersonalInfo.executeUpdate(); + preparedStatement = connection.prepareStatement(query); + preparedStatement.setInt(1, ID_condition); + preparedStatement.setInt(2, ID_patient); + preparedStatement.executeUpdate(); connection.commit(); // Commit the transaction return true; // User created successfully @@ -199,7 +199,7 @@ public boolean RemoveConditionPatient(int ID_condition, int ID_patient) { } } finally { try { - if (preparedStatementPersonalInfo != null) preparedStatementPersonalInfo.close(); + if (preparedStatement != null) preparedStatement.close(); DAOConnection.releaseConnection(connection); } catch (SQLException e) { // Handle the exception (e.g., log or throw) diff --git a/src/main/java/model/DAO/DAOExercise.java b/src/main/java/model/DAO/DAOExercise.java index b2ae1bf..7c284f6 100644 --- a/src/main/java/model/DAO/DAOExercise.java +++ b/src/main/java/model/DAO/DAOExercise.java @@ -27,6 +27,7 @@ public DAOExercise() { e.printStackTrace(); } } + /** * This method extracts Exercise object data from a ResultSet * @@ -51,7 +52,7 @@ private static Exercise extractExerciseFromResultSet(ResultSet resultSet) throws /** * Search for an Exercise by its pk in the database. * - * @param userID the id of the user that has the exercise. + * @param userID the id of the user that has the exercise. * @param exerciseID the id of the exercise. * @param insertDate the date in witch the user got the exercise to do. * @return the Exercise if it is found, else null. @@ -101,7 +102,7 @@ public List retrieveNotDoneExercises(int patientId) { stmt.setInt(1, patientId); ResultSet rs = stmt.executeQuery(); - while(rs.next()) { + while (rs.next()) { SlimmerExercise exercise = new SlimmerExercise( rs.getInt("ID_exercise"), rs.getString("ExerciseName"), @@ -109,7 +110,7 @@ public List retrieveNotDoneExercises(int patientId) { ); exercises.add(exercise); } - } catch(SQLException e) { + } catch (SQLException e) { e.printStackTrace(); } return exercises; @@ -127,7 +128,7 @@ public List retrieveDoneExercises(int patientId) { stmt.setInt(1, patientId); ResultSet rs = stmt.executeQuery(); - while(rs.next()) { + while (rs.next()) { SlimmerExercise exercise = new SlimmerExercise( rs.getInt("ID_exercise"), rs.getString("ExerciseName"), @@ -135,7 +136,7 @@ public List retrieveDoneExercises(int patientId) { ); exercises.add(exercise); } - } catch(SQLException e) { + } catch (SQLException e) { e.printStackTrace(); } return exercises; @@ -175,7 +176,6 @@ public List retrieveAllPatientExerciseDone(int userID) { } - public Blob getExerciseExecution(int userID, int exerciseID, Date insertDate) { String query = "SELECT Execution FROM exercise WHERE ID_user = ? AND ID_exercise = ? AND InsertionDate = ?"; PreparedStatement preparedStatement = null; @@ -316,4 +316,46 @@ public boolean setExerciseFeedback(int userID, int exerciseID, Date insertDate, } } } + + public boolean AddExerciseRecommendation(int idExercise, int idPatient) { + + PreparedStatement preparedStatement= null; + + try { + connection = connection.isClosed() ? DAOConnection.getConnection() : connection; + connection.setAutoCommit(false); // Start a transaction + + + String query = "INSERT INTO exercise (ID_user, ID_exercise, InsertionDate, CompletionDate, Execution, Evaluation, Recommended, Feedback)\n" + + "VALUES (?,?,CURRENT_DATE,NULL,NULL,NULL,2,NULL);"; + preparedStatement = connection.prepareStatement(query); + preparedStatement.setInt(1, idPatient); + preparedStatement.setInt(2, idExercise); + preparedStatement.executeUpdate(); + + connection.commit(); // Commit the transaction + return true; // User created successfully + + } catch (SQLException e) { + // Handle the exception (e.g., log or throw) + e.printStackTrace(); + try { + if (connection != null) { + connection.rollback(); // Rollback the transaction in case of an exception + } + } catch (SQLException ex) { + ex.printStackTrace(); + } + } finally { + try { + if (preparedStatement != null) preparedStatement.close(); + DAOConnection.releaseConnection(connection); + } catch (SQLException e) { + // Handle the exception (e.g., log or throw) + e.printStackTrace(); + } + } + return false; + } + } diff --git a/src/main/java/model/service/exercise/ExerciseManager.java b/src/main/java/model/service/exercise/ExerciseManager.java index 411aa1d..8c75d30 100644 --- a/src/main/java/model/service/exercise/ExerciseManager.java +++ b/src/main/java/model/service/exercise/ExerciseManager.java @@ -47,4 +47,6 @@ public List retrieveNotDoneExercises(int patientId) { public List retrieveAllPatientExerciseGlossaryNotDone(int userID) { return daoEG.retrieveAllPatientExerciseGlossaryNotDone(userID);} public List retrieveAllPatientExerciseGlossaryDone(int userID) { return daoEG.retrieveAllPatientExerciseGlossaryDone(userID);} + + public boolean AddExerciseRecommendation(int idExercise, int idPatient) { return daoE.AddExerciseRecommendation(idExercise,idPatient);} } diff --git a/src/main/java/model/service/exercise/ExerciseManagerInterface.java b/src/main/java/model/service/exercise/ExerciseManagerInterface.java index 490c1b3..764b734 100644 --- a/src/main/java/model/service/exercise/ExerciseManagerInterface.java +++ b/src/main/java/model/service/exercise/ExerciseManagerInterface.java @@ -81,4 +81,13 @@ public interface ExerciseManagerInterface { * @return Una lista di oggetti ExerciseGlossary che rappresentano gli esercizi non fatti dal paziente. */ public List retrieveAllPatientExerciseGlossaryDone(int userID); + + /** + * Raccomanda un esercizio ad un paziente + * + * @param idPatient L'ID dell'utente. + * @param idExercise L'ID dell'esercizio. + * @return true se la raccomandazione viene salvata con successo, false altrimenti. + */ + public boolean AddExerciseRecommendation(int idExercise, int idPatient); } diff --git a/src/main/webapp/JSP/exerciseRecommendation.jsp b/src/main/webapp/JSP/exerciseRecommendation.jsp index c86f8f0..5061f81 100644 --- a/src/main/webapp/JSP/exerciseRecommendation.jsp +++ b/src/main/webapp/JSP/exerciseRecommendation.jsp @@ -30,7 +30,7 @@ %> Home
Add new condition to patientAggiungi nuova patologia
ID
- + @@ -77,9 +77,9 @@ - + From c5fea4b61aa304b2b9d099d7c7fad3edf5d4dcd1 Mon Sep 17 00:00:00 2001 From: Sewaaa Date: Wed, 17 Jan 2024 17:07:03 +0100 Subject: [PATCH 03/11] FE fix --- .../CSS/RecommendationAndConditionManager.css | 49 +++++++++++++++++-- .../webapp/JSP/patientConditionManager.jsp | 47 +++++++++--------- 2 files changed, 68 insertions(+), 28 deletions(-) diff --git a/src/main/webapp/CSS/RecommendationAndConditionManager.css b/src/main/webapp/CSS/RecommendationAndConditionManager.css index 4f10cc5..f784237 100644 --- a/src/main/webapp/CSS/RecommendationAndConditionManager.css +++ b/src/main/webapp/CSS/RecommendationAndConditionManager.css @@ -1,18 +1,61 @@ table { width: 80%; - border-collapse: collapse; margin: 20px auto; + border-collapse: separate; + border-spacing: 0 10px; } table, th, td { - border: 1px solid black; + border: 0 solid black; } th, td { padding: 10px; - text-align: left; + text-align: center; } form { display: inline; +} + +caption { + font-weight: bold; + font-size: 1.2em; + padding: 10px; + border-radius: 5px; +} + +.button { + display: inline-block; + padding: 8px 16px; + font-size: 14px; + font-weight: bold; + text-align: center; + text-decoration: none; + cursor: pointer; + border: 2px solid #199A8E; + color: #199A8E; + background-color: transparent; + border-radius: 3px; + transition: background-color 0.3s, color 0.3s, border-color 0.3s; +} + +.button:hover { + background-color: #199A8E; + color: #fff; + border-color: #fff; +} + +.input-number { + padding: 8px; + font-size: 14px; + border: 2px solid #199A8E; + border-radius: 3px; + color: #199A8E; +} + +.input-number:focus { + outline: none; + border-color: #145C53; + box-shadow: 0 0 5px rgba(25, 154, 142, 0.5); } \ No newline at end of file diff --git a/src/main/webapp/JSP/patientConditionManager.jsp b/src/main/webapp/JSP/patientConditionManager.jsp index cb0e0d2..b527781 100644 --- a/src/main/webapp/JSP/patientConditionManager.jsp +++ b/src/main/webapp/JSP/patientConditionManager.jsp @@ -30,29 +30,29 @@ ArrayList list_NOTPatientCondition = ConditionService.getConditionsNOTOfPatient(userId); %> Home -
Esercizi FattiEsercizi Fatti / Già Raccomandati
ID<%= exerciseGlossary.getType() %> <%= exerciseGlossary.getDifficulty()%> <%= exerciseGlossary.getTarget()%>
- +
+
- - - - - + + + + + <% for (Condition condition : list_PatientCondition) { %> - - - - + + + + @@ -60,29 +60,29 @@
Patologie del paziente
IDDisorder DescriptionDisorder NameSeverityOperazioneNomeDescrizioneGravità
<%= condition.getIdCondition() %><%= condition.getDisorderDescription() %><%= condition.getDisorderName() %><%= condition.getSeverity() %><%= condition.getDisorderName()%><%= condition.getDisorderDescription()%><%= condition.getSeverity()%> - +

- +
- - - - - + + + + + <% for (Condition condition : list_NOTPatientCondition) { %> - - - + + + - + @@ -91,6 +91,3 @@
Aggiungi nuova patologia
IDDisorder DescriptionDisorder NameSeverityOperazioneNomeDescrizioneGravità
<%= condition.getIdCondition() %><%= condition.getDisorderDescription() %><%= condition.getDisorderName() %><%= condition.getDisorderName()%><%= condition.getDisorderDescription()%>
- +
- - - From 3811cd2734ad4694295248812e8a20e584944d02 Mon Sep 17 00:00:00 2001 From: Sewaaa Date: Wed, 17 Jan 2024 18:27:41 +0100 Subject: [PATCH 04/11] FE fix condition manager --- src/main/webapp/CSS/homeTherapist.css | 2 - src/main/webapp/CSS/view_patient.css | 5 +++ src/main/webapp/JSP/homeModificaPatologie.jsp | 41 +++++++++++++++++++ .../webapp/JSP/patientConditionManager.jsp | 2 +- src/main/webapp/JSP/viewPatient.jsp | 2 +- 5 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 src/main/webapp/JSP/homeModificaPatologie.jsp diff --git a/src/main/webapp/CSS/homeTherapist.css b/src/main/webapp/CSS/homeTherapist.css index e683320..bb2837b 100644 --- a/src/main/webapp/CSS/homeTherapist.css +++ b/src/main/webapp/CSS/homeTherapist.css @@ -234,7 +234,6 @@ a { height: 48px; top: 6px; left: 20px; - background-image: url(../images/homeTherapist/ellipse-28.png); background-size: cover; background-position: 50% 50%; } @@ -370,7 +369,6 @@ a { height: 48px; top: 77px; left: 0; - background-image: url(../images/homeTherapist/ellipse-28.png); background-size: cover; background-position: 50% 50%; } diff --git a/src/main/webapp/CSS/view_patient.css b/src/main/webapp/CSS/view_patient.css index d386a03..4aa8432 100644 --- a/src/main/webapp/CSS/view_patient.css +++ b/src/main/webapp/CSS/view_patient.css @@ -782,3 +782,8 @@ a { top: 11px; left: 17px; } + +.table-container { + max-height: 500px; + overflow-y: auto; +} \ No newline at end of file diff --git a/src/main/webapp/JSP/homeModificaPatologie.jsp b/src/main/webapp/JSP/homeModificaPatologie.jsp new file mode 100644 index 0000000..333dbf3 --- /dev/null +++ b/src/main/webapp/JSP/homeModificaPatologie.jsp @@ -0,0 +1,41 @@ +<%@ page import="model.entity.*"%> +<%@ page import="model.service.user.UserData"%> +<%@ page import="java.util.ArrayList"%> +<%@ page import="java.text.SimpleDateFormat" %> + + + + + + + + Home + + +
+
+
+
+ <%@ include file="patientConditionManager.jsp" %> +
+
+ +
+
+
+
+ + + +
+ + + +
Dr.
<%=(String) session.getAttribute("name") + " " + (String)session.getAttribute("surname")%>
+ +
+
+
+ + + \ No newline at end of file diff --git a/src/main/webapp/JSP/patientConditionManager.jsp b/src/main/webapp/JSP/patientConditionManager.jsp index b527781..ef77dcc 100644 --- a/src/main/webapp/JSP/patientConditionManager.jsp +++ b/src/main/webapp/JSP/patientConditionManager.jsp @@ -29,7 +29,7 @@ ArrayList list_PatientCondition = ConditionService.getConditionsOfPatient(userId); ArrayList list_NOTPatientCondition = ConditionService.getConditionsNOTOfPatient(userId); %> -Home + diff --git a/src/main/webapp/JSP/viewPatient.jsp b/src/main/webapp/JSP/viewPatient.jsp index 9633ce4..9229810 100644 --- a/src/main/webapp/JSP/viewPatient.jsp +++ b/src/main/webapp/JSP/viewPatient.jsp @@ -99,7 +99,7 @@ \ No newline at end of file diff --git a/src/main/webapp/JSP/homeExerciseRecommendation.jsp b/src/main/webapp/JSP/homeExerciseRecommendation.jsp new file mode 100644 index 0000000..9c034f3 --- /dev/null +++ b/src/main/webapp/JSP/homeExerciseRecommendation.jsp @@ -0,0 +1,41 @@ +<%@ page import="model.entity.*"%> +<%@ page import="model.service.user.UserData"%> +<%@ page import="java.util.ArrayList"%> +<%@ page import="java.text.SimpleDateFormat" %> + + + + + + + + Home + + +
+
+
+
+ <%@ include file="exerciseRecommendation.jsp" %> +
+
+ +
+
+
+
+ + + +
+ + + +
Dr.
<%=(String) session.getAttribute("name") + " " + (String)session.getAttribute("surname")%>
+ +
+
+
+ + + \ No newline at end of file diff --git a/src/main/webapp/JSP/viewPatient.jsp b/src/main/webapp/JSP/viewPatient.jsp index 38c9123..47e2643 100644 --- a/src/main/webapp/JSP/viewPatient.jsp +++ b/src/main/webapp/JSP/viewPatient.jsp @@ -140,10 +140,10 @@ <%} %> From 8ce35e342f2d220bcbd3ab31f8e9abee4609b2fb Mon Sep 17 00:00:00 2001 From: Sewaaa Date: Wed, 17 Jan 2024 20:20:12 +0100 Subject: [PATCH 07/11] FE fix condition manager and ecercise Recommendation --- .../CSS/RecommendationAndConditionManager.css | 19 ---------------- src/main/webapp/CSS/view_patient.css | 22 ++++++++++++++++++- .../webapp/JSP/exerciseRecommendation.jsp | 2 +- .../webapp/JSP/patientConditionManager.jsp | 4 ++-- 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/main/webapp/CSS/RecommendationAndConditionManager.css b/src/main/webapp/CSS/RecommendationAndConditionManager.css index f784237..f99ffc5 100644 --- a/src/main/webapp/CSS/RecommendationAndConditionManager.css +++ b/src/main/webapp/CSS/RecommendationAndConditionManager.css @@ -25,26 +25,7 @@ caption { border-radius: 5px; } -.button { - display: inline-block; - padding: 8px 16px; - font-size: 14px; - font-weight: bold; - text-align: center; - text-decoration: none; - cursor: pointer; - border: 2px solid #199A8E; - color: #199A8E; - background-color: transparent; - border-radius: 3px; - transition: background-color 0.3s, color 0.3s, border-color 0.3s; -} -.button:hover { - background-color: #199A8E; - color: #fff; - border-color: #fff; -} .input-number { padding: 8px; diff --git a/src/main/webapp/CSS/view_patient.css b/src/main/webapp/CSS/view_patient.css index 573e2d5..4bea37a 100644 --- a/src/main/webapp/CSS/view_patient.css +++ b/src/main/webapp/CSS/view_patient.css @@ -408,7 +408,7 @@ a { .element-home-logopedista .pop-up { position: absolute; - width: 50vw; + width: 53vw; height: 85vh; top: 6vh; left: 30vw; @@ -810,4 +810,24 @@ a { overflow-y: auto; margin-top: 12px; margin-right: 4px; +} +.buttonLay { + display: inline-block; + padding: 8px 16px; + font-size: 14px; + font-weight: bold; + text-align: center; + text-decoration: none; + cursor: pointer; + border: 2px solid #199A8E; + color: #199A8E; + background-color: transparent; + border-radius: 3px; + transition: background-color 0.3s, color 0.3s, border-color 0.3s; +} + +.buttonLay:hover { + background-color: #199A8E; + color: #fff; + border-color: #fff; } \ No newline at end of file diff --git a/src/main/webapp/JSP/exerciseRecommendation.jsp b/src/main/webapp/JSP/exerciseRecommendation.jsp index 80d4f28..b02d6e8 100644 --- a/src/main/webapp/JSP/exerciseRecommendation.jsp +++ b/src/main/webapp/JSP/exerciseRecommendation.jsp @@ -81,7 +81,7 @@ diff --git a/src/main/webapp/JSP/patientConditionManager.jsp b/src/main/webapp/JSP/patientConditionManager.jsp index ef77dcc..ae0e30f 100644 --- a/src/main/webapp/JSP/patientConditionManager.jsp +++ b/src/main/webapp/JSP/patientConditionManager.jsp @@ -52,7 +52,7 @@ - + @@ -82,7 +82,7 @@ From 0501e4b6d071e30a019f3031a5d85e35812df2af Mon Sep 17 00:00:00 2001 From: Sewaaa Date: Thu, 18 Jan 2024 00:10:43 +0100 Subject: [PATCH 08/11] FE AI Acception --- .../java/controller/ManageAIExercise.java | 3 +- src/main/webapp/CSS/acceptanceExercisesAI.css | 74 +++++++++++++++++++ .../JSP/{TESTAIAPPROVE.jsp => AiApprove.jsp} | 61 +++++++++++---- 3 files changed, 123 insertions(+), 15 deletions(-) create mode 100644 src/main/webapp/CSS/acceptanceExercisesAI.css rename src/main/webapp/JSP/{TESTAIAPPROVE.jsp => AiApprove.jsp} (66%) diff --git a/src/main/java/controller/ManageAIExercise.java b/src/main/java/controller/ManageAIExercise.java index 1d7c8be..3d77889 100644 --- a/src/main/java/controller/ManageAIExercise.java +++ b/src/main/java/controller/ManageAIExercise.java @@ -15,6 +15,7 @@ public class ManageAIExercise extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{ + String referer = request.getHeader("Referer"); String action = request.getParameter("action"); ExerciseManager em = new ExerciseManager(); Gson g = new Gson(); @@ -31,6 +32,6 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) } em.changeMultipleReccomandation(action, Integer.parseInt(request.getParameter("userId"))); } - response.sendRedirect(request.getHeader("Referer")); + response.sendRedirect(referer); } } \ No newline at end of file diff --git a/src/main/webapp/CSS/acceptanceExercisesAI.css b/src/main/webapp/CSS/acceptanceExercisesAI.css new file mode 100644 index 0000000..9d73643 --- /dev/null +++ b/src/main/webapp/CSS/acceptanceExercisesAI.css @@ -0,0 +1,74 @@ +#intestazione { + text-align: center; /* Centra il testo all'interno del div */ + padding: 20px; /* Aggiunto spazio intorno al contenuto del div */ +} + +/* Stili per l'h1 all'interno del div di intestazione */ +#intestazione h3 { + color: #333; + margin-bottom: 5px; +} +#intestazione h2 { + color: #333; + margin-top: 0; + margin-bottom: 10px; +} + + +table { + width: 100%; + border-collapse: collapse; + margin-top: 20px; + margin-left: auto; + margin-right: auto; + +} + + +th, td { + padding: 10px; + text-align: center; +} + +.buttonApprove { + display: inline-block; + padding: 8px 16px; + font-size: 14px; + font-weight: bold; + text-align: center; + text-decoration: none; + cursor: pointer; + border: 2px solid #199A8E; + color: #199A8E; + background-color: transparent; + border-radius: 3px; + transition: background-color 0.3s, color 0.3s, border-color 0.3s; + margin-bottom: 5px; +} + +.buttonRemove { + display: inline-block; + padding: 8px 16px; + font-size: 14px; + font-weight: bold; + text-align: center; + text-decoration: none; + cursor: pointer; + border: 2px solid #f44336; + color: #f44336; + background-color: transparent; + border-radius: 3px; + transition: background-color 0.3s, color 0.3s, border-color 0.3s; +} + +.buttonApprove:hover { + background-color: #199A8E; + color: #fff; + border-color: #fff; +} + +.buttonRemove:hover { + background-color: #f44336; + color: #fff; + border-color: #fff; +} \ No newline at end of file diff --git a/src/main/webapp/JSP/TESTAIAPPROVE.jsp b/src/main/webapp/JSP/AiApprove.jsp similarity index 66% rename from src/main/webapp/JSP/TESTAIAPPROVE.jsp rename to src/main/webapp/JSP/AiApprove.jsp index 9e9f2f0..d8c789d 100644 --- a/src/main/webapp/JSP/TESTAIAPPROVE.jsp +++ b/src/main/webapp/JSP/AiApprove.jsp @@ -10,40 +10,64 @@ - TESTING + Gestione AI + + - + <% ExerciseManager em = new ExerciseManager(); - List exercises = em.retrieveAiRaccomandation(9); //TODO: Prendilo dalla sessione + List exercises = em.retrieveAiRaccomandation((Integer) session.getAttribute("id")); UserData ud = new UserData(); - ArrayList u = ud.getUsersAndPersonalInfoByIdTherapist(9); //TODO: Prendilo dalla sessione + ArrayList u = ud.getUsersAndPersonalInfoByIdTherapist((Integer) session.getAttribute("id")); Gson g = new GsonBuilder().disableHtmlEscaping().create(); %> - <% for (UserInfo user : u) {%> -
Patologie del paziente
- +
- +
- -

Paziente: <%=user.getFirstname()%> <%=user.getLastname()%>

- - + <% int index=0; + for (UserInfo user : u) { + index++; + boolean sentinel=false; + %> + +
+
+ +
+

Paziente:

+

<%=user.getFirstname()%> <%=user.getLastname()%>

+ + +
+ + + + + + + + <% for (SlimmerExercise ex : exercises){ if(ex.getUserId() == user.getId()){ + sentinel=true; %> - + + - <% @@ -52,7 +76,16 @@ %>
NomeDescrizioneTipoDifficoltàTarget
<%= ex.getUserId() %> <%= ex.getName() %> <%= ex.getDescription() %><%= ex.getType() %> <%= ex.getDifficulty() %> <%= ex.getTarget() %><%= ex.getType() %> - - + +
+ <% + if (!sentinel) { + + %> + + <% + } } %> From 2aa338e5eef8359c4c2771013477b452771f1e4d Mon Sep 17 00:00:00 2001 From: "ms@Nicro" Date: Thu, 18 Jan 2024 02:08:36 +0100 Subject: [PATCH 09/11] Remade homepage Therapist and ViewPatient Old file still kept, new files: -homepageTherapist, will replace homeTherapist -viewPatinetInfo, will replace viewPatient --- src/main/webapp/CSS/homepageTherapist.css | 178 ++++++++++++++++++++++ src/main/webapp/CSS/invitePatient.css | 19 +-- src/main/webapp/CSS/viewPatientInfo.css | 49 ++++++ src/main/webapp/JS/homepageTherapist.js | 44 ++++++ src/main/webapp/JSP/homepageTherapist.jsp | 104 +++++++++++++ src/main/webapp/JSP/invitePatient.jsp | 8 +- src/main/webapp/JSP/viewPatient.jsp | 142 ++++++++--------- src/main/webapp/JSP/viewPatientInfo.jsp | 165 ++++++++++++++++++++ 8 files changed, 628 insertions(+), 81 deletions(-) create mode 100644 src/main/webapp/CSS/homepageTherapist.css create mode 100644 src/main/webapp/CSS/viewPatientInfo.css create mode 100644 src/main/webapp/JS/homepageTherapist.js create mode 100644 src/main/webapp/JSP/homepageTherapist.jsp create mode 100644 src/main/webapp/JSP/viewPatientInfo.jsp diff --git a/src/main/webapp/CSS/homepageTherapist.css b/src/main/webapp/CSS/homepageTherapist.css new file mode 100644 index 0000000..80f81a0 --- /dev/null +++ b/src/main/webapp/CSS/homepageTherapist.css @@ -0,0 +1,178 @@ +*{ + margin: 0; + padding: 0; +} + +body{ + height: 100vh; + width: 100%; + background: #7edcd4; +} + +#container{ + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + align-content: center; + width: 100%; + height: 100%; +} + +#navbar{ + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: center; + text-align: center; + background: white; + width: 10%; + height: 70%; + border-radius: 50000px; + margin-left: 10%; +} + +#navbar > div{ + display: flex; + justify-content: center; + align-items: center; + text-align: center; + width: 100%; +} + +#navIcons{ + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + text-align: center; +} + +#navIcons > div{ + margin-top: 10%; + margin-bottom: 10%; + width: 100%; +} + +#navIcons > div > img{ + width: 25%; +} + +#logoIcon{ + width: 70%; + margin-top: 20%; +} + +#docInfo{ + display: flex; + flex-direction: column; + margin-bottom: 40%; +} + +#docIcon{ + width: 40%; + margin-bottom: 2%; +} + +#rightHalf{ + margin-left: 10%; + margin-right: 10%; + width: 70%; + height: 90%; +} + +#bottomHalf{ + margin-top: 5%; + background: white; + width: 100%; + height: 75%; + border-radius: 24px; +} + +#topHalf{ + display: flex; + flex-direction: row; + justify-content: space-evenly; +} + +#topHalf div{ + display: flex; + flex-direction: row; + justify-content: space-evenly; +} + +.roundedWhite{ + background: white; + border-radius: 99999px; + padding: 2% 5% 2% 5%; + +} + +input{ + border: none; +} + +#textInput{ + width: 100% +} + +#searchInput{ + width: 100%; +} + +#tableContainer{ + display: flex; + align-content: center; + justify-content: center; + max-height: 100%; + overflow: hidden; +} + +#tableContainer table{ + width: 80% +} + +#tableContainer table td{ + align-items: center; + text-align: center; +} + +#content{ + height: 100%; +} + +#searchDiv{ + width: 50%; +} + + +.table-header th { + background-color: #f2f2f2; +} + +tr:nth-child(even) { + background-color: #f9f9f9; +} + +tr:nth-child(odd) { + background-color: #ffffff; +} + + +tr.hoverable-row:hover { + background-color: #e6f7ff; +} + +.tdButton{ + cursor: pointer; + color: deepskyblue; +} + +#scrollableDiv { + display: flex; + align-content: center; + justify-content: center; + width: 100%; + max-height: 100%; + overflow-y: auto; +} \ No newline at end of file diff --git a/src/main/webapp/CSS/invitePatient.css b/src/main/webapp/CSS/invitePatient.css index dd2befa..1477eec 100644 --- a/src/main/webapp/CSS/invitePatient.css +++ b/src/main/webapp/CSS/invitePatient.css @@ -32,13 +32,14 @@ a { } #InvitePage { - width: 154px; + width: 35vh; + height: 40vh; background-color: #fff; - padding: 80px; + padding: 1%; border-radius: 10px; text-align: center; position: fixed; - top: 43%; + top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1001; @@ -55,14 +56,14 @@ a { } #InviteTitle{ - margin-top: -16%; - font-size: 20px;; + margin-top: 5%; + font-size: 20px; } #InviteForm{ margin-top: 5%; - width: 70%; + width: 100%; display: flex; justify-content: center; align-items: center; @@ -70,14 +71,14 @@ a { } .inputDiv{ - width: 217%; + width: 80%; display: flex; flex-direction: row; justify-content: space-between; background-color: #f9fafb; border: 2px solid #e8eaed; border-radius: 500px; - margin-bottom: -1%; + margin-bottom: 2%; } .icon{ @@ -116,7 +117,7 @@ a { #InviteButton{ color: white; - width: 100%; + width: 65%; background-color: #199a8e; border: none; padding: 5% 10%; diff --git a/src/main/webapp/CSS/viewPatientInfo.css b/src/main/webapp/CSS/viewPatientInfo.css new file mode 100644 index 0000000..04ad18a --- /dev/null +++ b/src/main/webapp/CSS/viewPatientInfo.css @@ -0,0 +1,49 @@ +#patientInfo { + display: flex; + justify-content: center; + align-items: center; + height: 20%; +} + +#patientInfo > table { + width: 90%; + max-width: 100%; +} + +#buttonDivs { + margin-top: 5%; + margin-bottom: 5%; + display: flex; + flex-direction: row; + justify-content: space-evenly; +} + +#moreInfo{ + height: 50%; +} + +#buttonDivs div{ + flex: 1; + display: flex; + align-items: center; + text-align: center; + align-content: center; + justify-content: space-around; +} + +#buttonDivs button{ + background: #199a8e; + border: none; + border-radius: 25px; + width: 50%; + padding: 3% 4%; + color: white; + cursor: pointer; +} + +#chartDiv{ + position: relative; + margin: auto; + height: 90%; + width: 90%; +} diff --git a/src/main/webapp/JS/homepageTherapist.js b/src/main/webapp/JS/homepageTherapist.js new file mode 100644 index 0000000..9c712ba --- /dev/null +++ b/src/main/webapp/JS/homepageTherapist.js @@ -0,0 +1,44 @@ +$(document).ready(function () { + $("#home").click(() => redirect("homepageTherapist.jsp")); + $("#message").click(() => redirect("messageCenter.jsp")); + $("#agenda").click(() => redirect("schedule.jsp")); + $("#profile").click(() => redirect("userArea.jsp")); + + + let tableContainer = $("#tableContainer"); + + // Aggiungi un gestore di eventi all'input di ricerca + $('#searchInput').on('input', function () { + let searchText = $(this).val().toLowerCase(); + + // Nascondi tutte le righe + tableContainer.find('tbody').css('marginTop', '0'); // Using jQuery methods + + // Filtra e mostra solo le righe che corrispondono alla ricerca + $('tbody tr').each(function () { + let name = $(this).find('td:eq(1)').text().toLowerCase(); + let lastName = $(this).find('td:eq(2)').text().toLowerCase(); + + if (name.includes(searchText) || lastName.includes(searchText)) { + $(this).show(); + } else { + $(this).hide(); + } + }); + }); +}); + + + +function openInvitePopup() { + $("#invitePopup").show(); +} + +function viewPatient(i){ + window.location.href = "viewPatientInfo.jsp?patientID="+i; +} + + +function redirect(where){ + window.location.href = where; +} \ No newline at end of file diff --git a/src/main/webapp/JSP/homepageTherapist.jsp b/src/main/webapp/JSP/homepageTherapist.jsp new file mode 100644 index 0000000..4b902a0 --- /dev/null +++ b/src/main/webapp/JSP/homepageTherapist.jsp @@ -0,0 +1,104 @@ +<%@ page import="model.entity.UserInfo" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="java.text.SimpleDateFormat" %> +<%@ page import="model.service.user.UserData" %> + + + + Homepage + + +
+ +
+
+
+
+ lensIcon +
+
+ +
+
+
+

Invita paziente

+
+ +
+
+
+
+
+ + + + + + + + + + + <% + if(session.getAttribute("type")!=null && session.getAttribute("type").equals("therapist")){ + ArrayList listUser= new UserData().getUsersAndPersonalInfoByIdTherapist((Integer) session.getAttribute("id")); + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); + for(UserInfo u: listUser){ + %> + + + + + + + <% + } + } + %> + +
PazienteInizio Terapia
<%=u.getFirstname()%> <%=u.getLastname()%><%= sdf.format(u.getActivationDate()) %> + + Visualizza +
+
+
+
+
+
+
+ + + + + + + + diff --git a/src/main/webapp/JSP/invitePatient.jsp b/src/main/webapp/JSP/invitePatient.jsp index a0603c9..b5b8199 100644 --- a/src/main/webapp/JSP/invitePatient.jsp +++ b/src/main/webapp/JSP/invitePatient.jsp @@ -38,9 +38,15 @@

- < Torna alla home + < Torna alla home + + \ No newline at end of file diff --git a/src/main/webapp/JSP/viewPatient.jsp b/src/main/webapp/JSP/viewPatient.jsp index 75a787f..73b3d64 100644 --- a/src/main/webapp/JSP/viewPatient.jsp +++ b/src/main/webapp/JSP/viewPatient.jsp @@ -20,21 +20,21 @@
- <% - - if(session.getAttribute("type")==null || !session.getAttribute("type").equals("therapist") || request.getParameter("patientID") == null) { - response.sendRedirect("../errorPage/403.html"); - }else { - int patientId = Integer.parseInt(request.getParameter("patientID")); + <% - PersonalInfo user_selected = new UserRegistry().getPersonalInfo(patientId); - User user = new UserData().getUser(patientId); - if (user.getIdTherapist() != (Integer) session.getAttribute("id")) { + if(session.getAttribute("type")==null || !session.getAttribute("type").equals("therapist") || request.getParameter("patientID") == null) { response.sendRedirect("../errorPage/403.html"); - } - String email = user.getEmail(); + }else { + int patientId = Integer.parseInt(request.getParameter("patientID")); - %> + PersonalInfo user_selected = new UserRegistry().getPersonalInfo(patientId); + User user = new UserData().getUser(patientId); + if (user.getIdTherapist() != (Integer) session.getAttribute("id")) { + response.sendRedirect("../errorPage/403.html"); + } + String email = user.getEmail(); + + %> @@ -70,69 +70,69 @@ -
-
-
Modifica patologie
-
-
-
Raccomanda Esercizio
-
-
- -
Andamento
+
+
+
Modifica patologie
+
+
+
Raccomanda Esercizio
+
+
+ +
Andamento
- <% - ExerciseManager exerciseManager = new ExerciseManager(); - List exercises = exerciseManager.retrievePatientExerciseDone(patientId); - if (exercises == null || exercises.isEmpty()) { - %> -

Nessun esercizio svolto

- <% - } else { - String labels = ""; - String data = ""; - for (Exercise exercise : exercises) { - labels += "'" + exercise.getInsertionDate() + "', "; - data += exercise.getEvaluation() + ", "; - } - labels = labels.substring(0, labels.length() - 2); - data = data.substring(0, data.length() - 2); - %> - -
- + <% } - }); - - <% - } - %> + %>
diff --git a/src/main/webapp/JSP/viewPatientInfo.jsp b/src/main/webapp/JSP/viewPatientInfo.jsp new file mode 100644 index 0000000..52fdb35 --- /dev/null +++ b/src/main/webapp/JSP/viewPatientInfo.jsp @@ -0,0 +1,165 @@ +<%@ page import="model.service.user.UserData" %> +<%@ page import="model.entity.PersonalInfo" %> +<%@ page import="model.service.user.UserRegistry" %> +<%@ page import="model.entity.User" %> +<%@ page import="model.service.exercise.ExerciseManager" %> +<%@ page import="model.entity.Exercise" %> +<%@ page import="java.util.List" %> + + + + + + + + + Paziente Selezionato + + +
+ + + + +
+
+
+
+ <% + if(session.getAttribute("type")==null || !session.getAttribute("type").equals("therapist") || request.getParameter("patientID") == null) { + response.sendRedirect("../errorPage/403.html"); + }else { + int patientId = Integer.parseInt(request.getParameter("patientID")); + + PersonalInfo user_selected = new UserRegistry().getPersonalInfo(patientId); + User user = new UserData().getUser(patientId); + if (user.getIdTherapist() != (Integer) session.getAttribute("id")) { + response.sendRedirect("../errorPage/403.html"); + } + String email = user.getEmail(); + + %> +
+ + + + + +
+

Nome: <%=user_selected.getFirstname()%>

+

Indirizzo: <%=user_selected.getAddress()%>

+

Email: <%=email%>

+
+

Cognome: <%=user_selected.getLastname()%>

+

Data di nascita: <%=user_selected.getDateOfBirth()%>

+

Tel: <%=user_selected.getPhone()%>

+
+
+ +
+
+
+ <%//TODO: cambia content%> +
+
+ <%//TODO: cambia content%> +
+
+ <% + ExerciseManager exerciseManager = new ExerciseManager(); + List exercises = exerciseManager.retrievePatientExerciseDone(patientId); + if (exercises != null && !exercises.isEmpty()) { + StringBuilder labels = new StringBuilder(); + StringBuilder data = new StringBuilder(); + for (Exercise exercise : exercises) { + labels.append("'").append(exercise.getInsertionDate()).append("', "); + data.append(exercise.getEvaluation()).append(", "); + } + labels = new StringBuilder(labels.substring(0, labels.length() - 2)); + data = new StringBuilder(data.substring(0, data.length() - 2)); + %> +
+ +
+ + + + <% + } else { + %> +

Nessun esercizio svolto

+ <% + } + %> +
+
+ + <%} %> + + + + + + From f501f52fadea84a0d549799d9e8d087e7b4e0a71 Mon Sep 17 00:00:00 2001 From: "ms@Nicro" Date: Thu, 18 Jan 2024 12:02:27 +0100 Subject: [PATCH 10/11] Completed the merge Todo: Complete therapist homepage --- src/main/webapp/JSP/exerciseTest.jsp | 37 ------------------- .../JSP/testingInvitationAndLicense.jsp | 25 ------------- 2 files changed, 62 deletions(-) delete mode 100644 src/main/webapp/JSP/exerciseTest.jsp delete mode 100644 src/main/webapp/JSP/testingInvitationAndLicense.jsp diff --git a/src/main/webapp/JSP/exerciseTest.jsp b/src/main/webapp/JSP/exerciseTest.jsp deleted file mode 100644 index 27e4db0..0000000 --- a/src/main/webapp/JSP/exerciseTest.jsp +++ /dev/null @@ -1,37 +0,0 @@ - - - - - Title - - - -
- - - -
- - \ No newline at end of file diff --git a/src/main/webapp/JSP/testingInvitationAndLicense.jsp b/src/main/webapp/JSP/testingInvitationAndLicense.jsp deleted file mode 100644 index c95330b..0000000 --- a/src/main/webapp/JSP/testingInvitationAndLicense.jsp +++ /dev/null @@ -1,25 +0,0 @@ -<%@ page contentType="text/html;charset=UTF-8" %> - - - - TalkAId - Testing Invitation and License - <% - String license = (String) request.getAttribute("license"); - String invitation = (String) request.getAttribute("invitation"); - HttpSession s = (HttpSession) request.getSession(); - s.setAttribute("id", 9999); - %> - - - - -

<%= invitation%>

- -

<%= license%>

- - - - - - - From 0a6b087db0c2112823c62425292dde535ec57fa8 Mon Sep 17 00:00:00 2001 From: "ms@Nicro" Date: Thu, 18 Jan 2024 15:44:40 +0100 Subject: [PATCH 11/11] Completed merge, removed useless pages, completed Therapist homepage --- src/main/java/controller/Login.java | 2 +- .../CSS/RecommendationAndConditionManager.css | 43 +++++ src/main/webapp/CSS/acceptanceExercisesAI.css | 4 +- src/main/webapp/CSS/homepageTherapist.css | 17 +- src/main/webapp/CSS/viewPatientInfo.css | 10 ++ src/main/webapp/JS/exercise.js | 2 +- src/main/webapp/JS/homeTherapist.js | 35 ----- src/main/webapp/JS/homepageTherapist.js | 40 ++++- src/main/webapp/JS/navbar.js | 10 +- src/main/webapp/JS/viewPatientInfo.js | 34 ++++ .../JSP/{AiApprove.jsp => aiApprove.jsp} | 50 +++--- .../webapp/JSP/exerciseRecommendation.jsp | 25 ++- src/main/webapp/JSP/homeConditionManager.jsp | 40 ----- .../webapp/JSP/homeExerciseRecommendation.jsp | 41 ----- src/main/webapp/JSP/homeTherapist.jsp | 100 ------------ src/main/webapp/JSP/homepageTherapist.jsp | 17 +- src/main/webapp/JSP/invitePatient.jsp | 2 +- .../webapp/JSP/patientConditionManager.jsp | 32 ++-- src/main/webapp/JSP/patientReport.jsp | 2 +- src/main/webapp/JSP/viewPatient.jsp | 148 ------------------ src/main/webapp/JSP/viewPatientInfo.jsp | 37 ++--- src/main/webapp/images/AI.png | Bin 0 -> 6102 bytes src/main/webapp/images/AISelected.png | Bin 0 -> 6143 bytes 23 files changed, 230 insertions(+), 461 deletions(-) delete mode 100644 src/main/webapp/JS/homeTherapist.js create mode 100644 src/main/webapp/JS/viewPatientInfo.js rename src/main/webapp/JSP/{AiApprove.jsp => aiApprove.jsp} (78%) delete mode 100644 src/main/webapp/JSP/homeConditionManager.jsp delete mode 100644 src/main/webapp/JSP/homeExerciseRecommendation.jsp delete mode 100644 src/main/webapp/JSP/homeTherapist.jsp delete mode 100644 src/main/webapp/JSP/viewPatient.jsp create mode 100644 src/main/webapp/images/AI.png create mode 100644 src/main/webapp/images/AISelected.png diff --git a/src/main/java/controller/Login.java b/src/main/java/controller/Login.java index b4fef2f..a3213bb 100644 --- a/src/main/java/controller/Login.java +++ b/src/main/java/controller/Login.java @@ -64,7 +64,7 @@ private String setSessionAttributes(int id, HttpServletRequest request){ else { session.setAttribute("type", "therapist"); session.setAttribute("surname", personalInfo.getLastname()); - return "JSP/homeTherapist.jsp"; + return "JSP/homepageTherapist.jsp"; } } } diff --git a/src/main/webapp/CSS/RecommendationAndConditionManager.css b/src/main/webapp/CSS/RecommendationAndConditionManager.css index f99ffc5..d9f870c 100644 --- a/src/main/webapp/CSS/RecommendationAndConditionManager.css +++ b/src/main/webapp/CSS/RecommendationAndConditionManager.css @@ -39,4 +39,47 @@ caption { outline: none; border-color: #145C53; box-shadow: 0 0 5px rgba(25, 154, 142, 0.5); +} + +.buttonApprove { + display: inline-block; + padding: 8px 16px; + font-size: 14px; + font-weight: bold; + text-align: center; + text-decoration: none; + cursor: pointer; + border: 2px solid #199A8E; + color: #199A8E; + background-color: transparent; + border-radius: 3px; + transition: background-color 0.3s, color 0.3s, border-color 0.3s; + margin-bottom: 5px; +} + +.buttonRemove { + display: inline-block; + padding: 8px 16px; + font-size: 14px; + font-weight: bold; + text-align: center; + text-decoration: none; + cursor: pointer; + border: 2px solid #f44336; + color: #f44336; + background-color: transparent; + border-radius: 3px; + transition: background-color 0.3s, color 0.3s, border-color 0.3s; +} + +.buttonApprove:hover { + background-color: #199A8E; + color: #fff; + border-color: #fff; +} + +.buttonRemove:hover { + background-color: #f44336; + color: #fff; + border-color: #fff; } \ No newline at end of file diff --git a/src/main/webapp/CSS/acceptanceExercisesAI.css b/src/main/webapp/CSS/acceptanceExercisesAI.css index 9d73643..f02a8fc 100644 --- a/src/main/webapp/CSS/acceptanceExercisesAI.css +++ b/src/main/webapp/CSS/acceptanceExercisesAI.css @@ -15,7 +15,7 @@ } -table { +#aiContent table { width: 100%; border-collapse: collapse; margin-top: 20px; @@ -25,7 +25,7 @@ table { } -th, td { +#aiContent th, td { padding: 10px; text-align: center; } diff --git a/src/main/webapp/CSS/homepageTherapist.css b/src/main/webapp/CSS/homepageTherapist.css index 80f81a0..7111921 100644 --- a/src/main/webapp/CSS/homepageTherapist.css +++ b/src/main/webapp/CSS/homepageTherapist.css @@ -56,6 +56,7 @@ body{ #navIcons > div > img{ width: 25%; + cursor: pointer; } #logoIcon{ @@ -67,6 +68,7 @@ body{ display: flex; flex-direction: column; margin-bottom: 40%; + cursor: pointer; } #docIcon{ @@ -168,11 +170,24 @@ tr.hoverable-row:hover { color: deepskyblue; } -#scrollableDiv { +.scrollableDiv { display: flex; align-content: center; + text-align: center; + align-items: center; justify-content: center; + flex-direction: column; width: 100%; max-height: 100%; overflow-y: auto; +} + +#aiContainer{ + display: none; + max-height: 100%; + overflow-y: auto; +} + +#NoExercise{ + text-align: center; } \ No newline at end of file diff --git a/src/main/webapp/CSS/viewPatientInfo.css b/src/main/webapp/CSS/viewPatientInfo.css index 04ad18a..5c350e4 100644 --- a/src/main/webapp/CSS/viewPatientInfo.css +++ b/src/main/webapp/CSS/viewPatientInfo.css @@ -47,3 +47,13 @@ height: 90%; width: 90%; } + +#exercisesDiv, #conditionsDiv{ + max-height: 90%; + overflow: auto; +} + + + + + diff --git a/src/main/webapp/JS/exercise.js b/src/main/webapp/JS/exercise.js index 3fb2000..ff6c5bf 100644 --- a/src/main/webapp/JS/exercise.js +++ b/src/main/webapp/JS/exercise.js @@ -122,7 +122,7 @@ function redirect(where){ if (USERTYPE === "patient"){ window.location.href = "homePagePatient.jsp"; }else if (USERTYPE === "therapist"){ - window.location.href = "homeTherapist.jsp"; + window.location.href = "homepageTherapist.jsp"; } } else{ diff --git a/src/main/webapp/JS/homeTherapist.js b/src/main/webapp/JS/homeTherapist.js deleted file mode 100644 index 5e169b0..0000000 --- a/src/main/webapp/JS/homeTherapist.js +++ /dev/null @@ -1,35 +0,0 @@ -//search bar for name and surname -$(document).ready(function () { - var tableContainer = document.getElementById('tableContainer'); - - // Aggiungi un gestore di eventi all'input di ricerca - $('#searchInput').on('input', function () { - var searchText = $(this).val().toLowerCase(); - - // Nascondi tutte le righe - tableContainer.getElementsByTagName('tbody')[0].style.marginTop = '0'; - - // Filtra e mostra solo le righe che corrispondono alla ricerca - $('tbody tr').each(function () { - var name = $(this).find('td:eq(1)').text().toLowerCase(); - var lastName = $(this).find('td:eq(2)').text().toLowerCase(); - - if (name.includes(searchText) || lastName.includes(searchText)) { - $(this).show(); - } else { - $(this).hide(); - } - }); - }); -}); -/*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 = "viewPatient.jsp?patientID="+i; -} \ No newline at end of file diff --git a/src/main/webapp/JS/homepageTherapist.js b/src/main/webapp/JS/homepageTherapist.js index 9c712ba..9e76f6b 100644 --- a/src/main/webapp/JS/homepageTherapist.js +++ b/src/main/webapp/JS/homepageTherapist.js @@ -1,8 +1,12 @@ $(document).ready(function () { - $("#home").click(() => redirect("homepageTherapist.jsp")); + $("#iaIconSelected").hide(); + $("#homeIcon").hide(); + + $("#home").click(() => redirect("home")); $("#message").click(() => redirect("messageCenter.jsp")); $("#agenda").click(() => redirect("schedule.jsp")); - $("#profile").click(() => redirect("userArea.jsp")); + $("#ia").click(() => redirect("AI")); + $("#docInfo").click(() => redirect("userArea.jsp")); let tableContainer = $("#tableContainer"); @@ -28,6 +32,24 @@ $(document).ready(function () { }); }); +function showAI(){ + $("#homeSelectedIcon").hide(); + $("#homeIcon").show() + $("#aiContainer").show(); + $("#tableContainer").hide(); + $("#iaIcon").hide(); + $("#iaIconSelected").show(); +} + +function hideAI(){ + $("#homeSelectedIcon").show(); + $("#homeIcon").hide() + $("#aiContainer").hide(); + $("#tableContainer").show(); + $("#iaIcon").show(); + $("#iaIconSelected").hide(); +} + function openInvitePopup() { @@ -40,5 +62,17 @@ function viewPatient(i){ function redirect(where){ - window.location.href = where; + if(where==="AI" || where === "home"){ + let path = window.location.pathname.substring(window.location.pathname.lastIndexOf('/') + 1); + console.log(path); + if(path!=="homepageTherapist.jsp"){ + window.location.href = "homepageTherapist.jsp"; + }else if(where==="AI"){ + showAI(); + }else if(where === "home"){ + hideAI(); + } + }else{ + window.location.href = where; + } } \ No newline at end of file diff --git a/src/main/webapp/JS/navbar.js b/src/main/webapp/JS/navbar.js index d2f9d0d..9efeabb 100644 --- a/src/main/webapp/JS/navbar.js +++ b/src/main/webapp/JS/navbar.js @@ -11,10 +11,10 @@ const profileIconS = $("#profileIconSelected") let USERTYPE const page = window.location.pathname.split('/').pop() -const homePages = ["homePagePatient.jsp", "patientReport.jsp"] //TODO: Mettere le pagine da considerare "Home" -const messagePages = ["messageCenter.jsp"] //TODO: Mettere le pagine da considerare "Message" -const calendarPages = ["schedule.jsp"] //TODO: Mettere le pagine da considerare "Calendar" -const profilePages = ["userArea.jsp"] //TODO: Mettere le pagine da considerare "Profile" +const homePages = ["homePagePatient.jsp", "patientReport.jsp", "userReport.jsp"] +const messagePages = ["messageCenter.jsp"] +const calendarPages = ["schedule.jsp"] +const profilePages = ["userArea.jsp", "changePassw.jsp"] $("document").ready(()=>{ USERTYPE = $("#userInfo").data("type"); @@ -60,7 +60,7 @@ function redirect(where){ if (USERTYPE === "patient"){ window.location.href = "homePagePatient.jsp"; }else if (USERTYPE === "therapist"){ - window.location.href = "homeTherapist.jsp"; + window.location.href = "homepageTherapist.jsp"; } } else{ diff --git a/src/main/webapp/JS/viewPatientInfo.js b/src/main/webapp/JS/viewPatientInfo.js new file mode 100644 index 0000000..36d219a --- /dev/null +++ b/src/main/webapp/JS/viewPatientInfo.js @@ -0,0 +1,34 @@ +$(document).ready(function () { + let canvas = document.getElementById('myChart'); + let parentContainer = canvas.parentNode; + + $("#home").click(() => redirect("homepageTherapist.jsp")); + $("#message").click(() => redirect("messageCenter.jsp")); + $("#agenda").click(() => redirect("schedule.jsp")); + $("#docInfo").click(() => redirect("userArea.jsp")); + + canvas.width = parentContainer.offsetWidth; + canvas.height = parentContainer.offsetHeight; +}) + +function showExercises(){ + $("#content").hide(); + $("#conditionsDiv").hide(); + $("#exercisesDiv").show(); +} + +function showCondition(){ + $("#content").hide(); + $("#exercisesDiv").hide(); + $("#conditionsDiv").show(); +} + +function showPatient(){ + $("#exercisesDiv").hide(); + $("#conditionsDiv").hide(); + $("#content").show(); +} + +function redirect(where){ + window.location.href = where; +} \ No newline at end of file diff --git a/src/main/webapp/JSP/AiApprove.jsp b/src/main/webapp/JSP/aiApprove.jsp similarity index 78% rename from src/main/webapp/JSP/AiApprove.jsp rename to src/main/webapp/JSP/aiApprove.jsp index be2f056..dcff0cd 100644 --- a/src/main/webapp/JSP/AiApprove.jsp +++ b/src/main/webapp/JSP/aiApprove.jsp @@ -9,42 +9,43 @@ <%@ page contentType="text/html;charset=UTF-8" language="java" %> - - - Gestione AI - - - + + <% ExerciseManager em = new ExerciseManager(); List exercises = em.retrieveAiRaccomandation((Integer) session.getAttribute("id")); UserData ud = new UserData(); - ArrayList u = ud.getUsersAndPersonalInfoByIdTherapist((Integer) session.getAttribute("id")); + ArrayList users = ud.getUsersAndPersonalInfoByIdTherapist((Integer) session.getAttribute("id")); Gson g = new GsonBuilder().disableHtmlEscaping().create(); %> - - <% int index=0; - for (UserInfo user : u) { +

Non ci sono esercizi da valutare

+ <% + int index=0; + int trID = 0; + for (UserInfo user : users) { index++; boolean sentinel=false; %>
- +

Paziente:

<%=user.getFirstname()%> <%=user.getLastname()%>

- - + +
@@ -55,11 +56,12 @@ - <% for (SlimmerExercise ex : exercises){ + <% + for (SlimmerExercise ex : exercises){ if(ex.getUserId() == user.getId()){ - sentinel=true; + sentinel=true; %> - + @@ -67,12 +69,12 @@ <% - } + trID++; } } %> @@ -85,12 +87,17 @@ + <% + }else{ + %> + <% } } %> - + + diff --git a/src/main/webapp/JSP/exerciseRecommendation.jsp b/src/main/webapp/JSP/exerciseRecommendation.jsp index b02d6e8..2085a15 100644 --- a/src/main/webapp/JSP/exerciseRecommendation.jsp +++ b/src/main/webapp/JSP/exerciseRecommendation.jsp @@ -1,34 +1,27 @@ -<%@ page import="java.util.ArrayList" %> -<%@ page import="model.service.condition.ConditionManager" %> <%@ page import="model.service.user.UserData" %> <%@ page import="model.service.exercise.ExerciseManager" %> <%@ page import="java.util.List" %> <%@ page import="model.entity.*" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %> - - Raccomanda Esercizio - - <% - int userId = 0; - if(session.getAttribute("type")!=null && !session.getAttribute("type").equals("therapist") || request.getParameter("userId")==null) { + int patientIdEX = 0; + if(session.getAttribute("type")==null || !session.getAttribute("type").equals("therapist") || request.getParameter("patientID") == null) { response.sendRedirect("../errorPage/403.html"); }else { - userId = Integer.parseInt((request.getParameter("userId"))); + patientIdEX = Integer.parseInt(request.getParameter("patientID")); - int userTherapist = new UserData().getUser(userId).getIdTherapist(); - if (userTherapist != (Integer) session.getAttribute("id")) { + User user = new UserData().getUser(patientIdEX); + if (user.getIdTherapist() != (Integer) session.getAttribute("id")) { response.sendRedirect("../errorPage/403.html"); } } ExerciseManager ExerciseService= new ExerciseManager(); - List list_Exercisedone = ExerciseService.retrieveAllPatientExerciseGlossaryDone(userId); - List list_ExerciseNOTdone = ExerciseService.retrieveAllPatientExerciseGlossaryNotDone(userId); + List list_Exercisedone = ExerciseService.retrieveAllPatientExerciseGlossaryDone(patientIdEX); + List list_ExerciseNOTdone = ExerciseService.retrieveAllPatientExerciseGlossaryNotDone(patientIdEX); %> -
Nome
<%= ex.getName() %> <%= ex.getDescription() %><%= ex.getDifficulty() %> <%= ex.getTarget() %> - - + +
@@ -80,8 +73,8 @@ diff --git a/src/main/webapp/JSP/homeConditionManager.jsp b/src/main/webapp/JSP/homeConditionManager.jsp deleted file mode 100644 index e8273bf..0000000 --- a/src/main/webapp/JSP/homeConditionManager.jsp +++ /dev/null @@ -1,40 +0,0 @@ -<%@ page import="model.entity.*"%> -<%@ page import="model.service.user.UserData"%> -<%@ page import="java.util.ArrayList"%> -<%@ page import="java.text.SimpleDateFormat" %> - - - - - - - - Home - - -
-
-
-
- <%@ include file="patientConditionManager.jsp" %> -
-
- -
-
-
-
- - - -
- - - -
Dr.
<%=(String) session.getAttribute("name") + " " + (String)session.getAttribute("surname")%>
- -
-
-
- - \ No newline at end of file diff --git a/src/main/webapp/JSP/homeExerciseRecommendation.jsp b/src/main/webapp/JSP/homeExerciseRecommendation.jsp deleted file mode 100644 index 9c034f3..0000000 --- a/src/main/webapp/JSP/homeExerciseRecommendation.jsp +++ /dev/null @@ -1,41 +0,0 @@ -<%@ page import="model.entity.*"%> -<%@ page import="model.service.user.UserData"%> -<%@ page import="java.util.ArrayList"%> -<%@ page import="java.text.SimpleDateFormat" %> - - - - - - - - Home - - -
-
-
-
- <%@ include file="exerciseRecommendation.jsp" %> -
-
- -
-
-
-
- - - -
- - - -
Dr.
<%=(String) session.getAttribute("name") + " " + (String)session.getAttribute("surname")%>
- -
-
-
- - - \ No newline at end of file diff --git a/src/main/webapp/JSP/homeTherapist.jsp b/src/main/webapp/JSP/homeTherapist.jsp deleted file mode 100644 index b2161f9..0000000 --- a/src/main/webapp/JSP/homeTherapist.jsp +++ /dev/null @@ -1,100 +0,0 @@ -<%@ page import="model.entity.*"%> -<%@ page import="model.service.user.UserData"%> -<%@ page import="java.util.ArrayList"%> -<%@ page import="java.text.SimpleDateFormat" %> - - - - - - - - TalkAId - Homepage - - - -
-
-
-
PAZIENTI
-
-
- -
Esercizi Fatti / Già Raccomandati
- - + +
- - - - - - - - - <% - 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){ - %> - - - - - - - - - <% - } - } - %> - -
Inizio Terapia
<%=u.getFirstname()%> <%=u.getLastname()%><%= sdf.format(u.getActivationDate()) %> - - - Visualizza -
-
- - - - -
-
-
-
- - - - - - - - - - - -
- - - -
Dr.
<%=(String) session.getAttribute("name") + " " + (String)session.getAttribute("surname")%>
- -
-
- - -
-
-
-
- - - - - - - \ No newline at end of file diff --git a/src/main/webapp/JSP/homepageTherapist.jsp b/src/main/webapp/JSP/homepageTherapist.jsp index 4b902a0..283939e 100644 --- a/src/main/webapp/JSP/homepageTherapist.jsp +++ b/src/main/webapp/JSP/homepageTherapist.jsp @@ -5,6 +5,7 @@ + Homepage @@ -15,7 +16,8 @@