Skip to content

Commit

Permalink
controle 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayoub ETOULLALI committed Apr 26, 2023
1 parent 86722aa commit da15733
Show file tree
Hide file tree
Showing 42 changed files with 2,864 additions and 47 deletions.
92 changes: 50 additions & 42 deletions +/app-security1/src/main/resources/templates/patients.html
Original file line number Diff line number Diff line change
@@ -1,55 +1,63 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="template1">
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="template1">
<head>
<meta charset="UTF-8">
<title>Patients</title>
<link rel="stylesheet" href="/webjars/bootstrap/5.2.3/css/bootstrap.min.css">
</head>
<body>
<div layout:fragment="content1">
<div class="container mt-2">
<div class="card">
<div class="card-header">Liste des patients</div>
<div class="card-body">
<table class="table">
<thead>
<tr>
<th>ID</th> <th>NOM</th> <th>Date Naissance</th> <th>Malade</th> <th>Score</th>
</tr>
</thead>
<tbody>
<tr th:each="p:${listePatients}">
<td th:text="${p.id}"></td> <!-- use p.id ou p.getId()-->
<td th:text="${p.nom}"></td>
<td th:text="${p.dateNaissance}"></td>
<td th:text="${p.malade}"></td>
<td th:text="${p.score}"></td>
<td th:if="${#authorization.expression('hasRole(''ADMIN'')')}">
<a onclick=" return confirm('sur ?')" class="btn btn-danger" th:href="@{/admin/delete(id=${p.id},keyword=${keyword},page=${pageCurrent})}">
Delete
</a>
</td>
<td th:if="${#authorization.expression('hasRole(''ADMIN'')')}">
<a class="btn btn-success" th:href="@{/admin/editPatient(id=${p.id},keyword=${keyword},page=${pageCurrent})}">
Edit
</a>
</td>
</tr>
</tbody>
</table>
<ul class="nav nav-pills">
<li th:each="page,status:${pages}">
<a th:class="${status.index==pageCurrent?'btn btn-primary ms-1':'btn btn-outline-primary ms-1'}"
th:text="${status.index}"
th:href="@{/user/index(page=${status.index},keyword=${keyword})}"> <!-- keyword=${keyword} : garde keyword actuel -->
</a> <!-- status : index count size(fixe) current -->
</li>
</ul>
</div>
<div layout:fragment="content1">
<div class="container mt-2">
<div class="card">
<div class="card-header">Liste des patients</div>
<div class="card-body">
<table class="table">
<thead>
<tr>
<th>ID</th>
<th>NOM</th>
<th>Date Naissance</th>
<th>Malade</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<tr th:each="p:${listePatients}"> <!-- param -->
<td th:text="${p.id}"></td> <!-- use p.id ou p.getId()-->
<td th:text="${p.nom}"></td>
<td th:text="${p.dateNaissance}"></td>
<td th:text="${p.malade}"></td>
<td th:text="${p.score}"></td>
<td th:if="${#authorization.expression('hasRole(''ADMIN'')')}">
<a onclick=" return confirm('sur ?')" class="btn btn-danger"
th:href="@{/admin/delete(id=${p.id},keyword=${keyword},page=${pageCurrent})}">
<!-- controller (traitement) -->
Delete
</a>
</td>
<td th:if="${#authorization.expression('hasRole(''ADMIN'')')}">
<a class="btn btn-success"
th:href="@{/admin/editPatient(id=${p.id},keyword=${keyword},page=${pageCurrent})}">
Edit
</a>
</td>
</tr>
</tbody>
</table>
<ul class="nav nav-pills">
<li th:each="page,status:${pages}">
<a th:class="${status.index==pageCurrent?'btn btn-primary ms-1':'btn btn-outline-primary ms-1'}"
th:text="${status.index}"
th:href="@{/user/index(page=${status.index},keyword=${keyword})}">
<!-- keyword=${keyword} : garde keyword actuel -->
</a> <!-- status : index count size(fixe) current -->
</li>
</ul>
</div>
</div>
</div>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion +/jpa-api/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
spring.datasource.url=jdbc:h2:mem:DB_Patient1
spring.h2.console.enabled=true
spring.jpa.show-sql=true
server.port=8080
server.port=8082

#DB Mysql
#spring.datasource.url=jdbc:mysql://localhost:3306/DB_Patient?createDatabaseIfNotExist=true
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Activité Pratique N° 2/Application/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ public class PatientRestController {
public List<Patient> patientList(){
return patientRepository.findAll();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@

public interface CustomerRepository extends JpaRepository<Customer,Long> {


}
Loading

0 comments on commit da15733

Please sign in to comment.