Skip to content

Commit

Permalink
print patient of X therapist v.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Sewaaa committed Dec 28, 2023
1 parent d85310d commit 7526e82
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
2 changes: 0 additions & 2 deletions src/main/java/controller/homeTherapistServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) t
ArrayList<UserInfo> list_user=new ArrayList<>();
//String tipo=request.getParameter("type");
User logged= (User) session.getAttribute("user_logged");
//User u= userService.getUserByIdOrEmail((User) session.getAttribute("user_logged")); //save in session attribute the id of the therapist by email
list_user=userService.getUsersAndPersonalInfoByIdTherapist((Integer) logged.getId()); //save all patient of X therapist


session.setAttribute("list_user",list_user);


Expand Down
3 changes: 2 additions & 1 deletion src/main/java/model/DAO/DAOUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public ArrayList<UserInfo> getUsersAndPersonalInfoByIdTherapist(int idTherapist)
ResultSet resultSet = null;
ArrayList<UserInfo> list_user=new ArrayList<>();

UserInfo u=new UserInfo();

try {

connection = DAOConnection.getConnection();
Expand All @@ -296,6 +296,7 @@ public ArrayList<UserInfo> getUsersAndPersonalInfoByIdTherapist(int idTherapist)
resultSet = preparedStatement.executeQuery();

while (resultSet.next()) {
UserInfo u=new UserInfo();
u.setId(resultSet.getInt("ID"));
u.setEmail(resultSet.getString("Email"));
u.setActivationDate(resultSet.getTimestamp("ActivationDate"));
Expand Down
20 changes: 12 additions & 8 deletions src/main/webapp/JSP/testTable.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@
<table>
<thead class="table-header">
<tr>
<th>Colonna 1</th>
<th>Colonna 2</th>
<th>Colonna 3</th>
<th>Colonna 4</th>
<th>Icona</th>
<th>Nome</th>
<th>Cognome</th>
<th>Inizio Terapia</th>
</tr>
</thead>
<tbody>
Expand All @@ -63,11 +63,15 @@
for(UserInfo u: list_user){
%>
<tr>
<% for (int j = 1; j <= 4; j++) { %>
<td>Elemento <%= j %> <%=u.getEmail()%></td>
<% } %>
<td><svg xmlns="http://www.w3.org/2000/svg" height="16" width="15.5" viewBox="0 0 496 512"><path d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 96c48.6 0 88 39.4 88 88s-39.4 88-88 88-88-39.4-88-88 39.4-88 88-88zm0 344c-58.7 0-111.3-26.6-146.5-68.2 18.8-35.4 55.6-59.8 98.5-59.8 2.4 0 4.8 .4 7.1 1.1 13 4.2 26.6 6.9 40.9 6.9 14.3 0 28-2.7 40.9-6.9 2.3-.7 4.7-1.1 7.1-1.1 42.9 0 79.7 24.4 98.5 59.8C359.3 421.4 306.7 448 248 448z"/></svg></td>
<td><%=u.getFirstname()%></td>
<td><%=u.getLastname()%></td>
<td><%=u.getActivationDate()%></td>
</tr>
<% }} %>
<%
}
}
%>
</tbody>
</table>
</div>
Expand Down

0 comments on commit 7526e82

Please sign in to comment.