-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin-template.php
More file actions
34 lines (32 loc) · 1.52 KB
/
admin-template.php
File metadata and controls
34 lines (32 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
function echo_admin_table($admins)
{
$admins_rows = '';
foreach ($admins as $admin) {
$admins_rows .= get_admin_row($admin);
}
echo ' <table class="table mt-5 text-center">
<thead>
<tr>
<th id="title-login"scope="col">Login</th>
<th id="title-email" scope="col">Email</th>
<th id="actionOne"scope="col">Modifier</th>
<th id="actionTwo" scope="col">Supprimer</th>
</tr>
</thead>
<tbody>
' . $admins_rows . '
</tbody>
</table>';
}
function get_admin_row($admin)
{
return
'<form method="POST" action="submit-admin-action.php"><tr>
<td><input name="login" class="form-control" id="login" type="text" value="' . $admin["login"] . '"/></td>
<td><input name="email" class="form-control" type="email" id="email" value="' . $admin["email"] . '"/></td>
<td id="actionOne"><button type="submit" name="modify-admin" id="validate" class="btn btn-primary">✓</button></td>
<td id="actionTwo"><button type="submit" name="delete-admin" id="rounded" class="btn btn-primary d-block mx-auto">X</button></td>
<input name="id" style="display: none;" type="number" value="' . $admin["id"] . '">
</tr></form>';
}