2019-01-02 18:00:16 +01:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
{% include 'header.html.twig' %}
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
<input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search for names..">
|
2019-01-02 19:50:36 +01:00
|
|
|
<input type="hidden" id="slVal" value="{{ session["sl"] }}" />
|
2019-01-02 18:00:16 +01:00
|
|
|
<table id="allRecord">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>login</th>
|
|
|
|
<th>Date de nésance</th>
|
|
|
|
<th>email</th>
|
|
|
|
<th>PW</th>
|
|
|
|
<th>slvl</th>
|
2019-01-02 19:50:36 +01:00
|
|
|
{% if (session["sl"] == "5" or session["sl"] == "10") %}
|
2019-01-02 18:00:16 +01:00
|
|
|
<th><i class="fas fa-cogs"></i></th>
|
2019-01-02 19:50:36 +01:00
|
|
|
{% endif %}
|
2019-01-02 18:00:16 +01:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for data in datas %}
|
|
|
|
<tr class="record">
|
|
|
|
<td class="login">
|
|
|
|
{{ data["login"] }}
|
|
|
|
</td>
|
|
|
|
<td class="datene">
|
|
|
|
{{ data["date_naissance"] }}
|
|
|
|
</td>
|
|
|
|
<td class="email">
|
|
|
|
{{ data["e_mail"] }}
|
|
|
|
</td>
|
|
|
|
<td class="pw">
|
|
|
|
{{ data["mot_de_passe"] }}
|
|
|
|
</td>
|
|
|
|
<td class="sl">
|
|
|
|
{{ data["security_level"] }}
|
2019-01-02 19:50:36 +01:00
|
|
|
</td>{% if (session["sl"] == "5" or session["sl"] == "10") %}
|
|
|
|
<td>{% if ((session["sl"] == "5" and session["login"] == data["login"]) or session["sl"] == "10") %}
|
|
|
|
<i class="fas fa-edit click editUser"></i><i class="fas fa-trash-alt click delUser"></i>
|
|
|
|
{% endif %}
|
|
|
|
</td>{% endif %}
|
2019-01-02 18:00:16 +01:00
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
2019-01-02 19:50:36 +01:00
|
|
|
{% if (session["sl"] == "10") %}
|
2019-01-02 18:00:16 +01:00
|
|
|
<tr rowspan="2">
|
|
|
|
<td colspan="6" style="text-align:center"><i class="fas fa-user-plus fa-4x click"></i></td>
|
2019-01-02 19:50:36 +01:00
|
|
|
</tr>{% endif %}
|
2019-01-02 18:00:16 +01:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</body>
|
|
|
|
<script>
|
|
|
|
//https://www.w3schools.com/howto/howto_js_filter_table.asp
|
|
|
|
function myFunction() {
|
|
|
|
// Declare variables
|
|
|
|
var input, filter, table, tr, td, i, txtValue;
|
|
|
|
input = document.getElementById("myInput");
|
|
|
|
filter = input.value.toUpperCase();
|
|
|
|
table = document.getElementById("allRecord");
|
|
|
|
tr = table.getElementsByTagName("tr");
|
|
|
|
|
|
|
|
// Loop through all table rows, and hide those who don't match the search query
|
|
|
|
for (i = 0; i < tr.length; i++) {
|
|
|
|
td = tr[i].getElementsByTagName("td")[0];
|
|
|
|
if (td) {
|
|
|
|
txtValue = td.textContent || td.innerText;
|
|
|
|
if (txtValue.toUpperCase().indexOf(filter) > -1) {
|
|
|
|
tr[i].style.display = "";
|
|
|
|
} else {
|
|
|
|
tr[i].style.display = "none";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</html>
|