mirror of
https://github.com/Oxbian/SIDPS.git
synced 2025-07-07 12:24:38 +02:00
filtres fonctionnels
This commit is contained in:
@ -7,7 +7,7 @@ spl_autoload_register(function ($class) {
|
||||
include 'class/' . $class . '.class.php';
|
||||
});
|
||||
|
||||
$db = new Database();
|
||||
$db = new Database();
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
@ -51,42 +51,32 @@ $db = new Database();
|
||||
<div class="container px-4">
|
||||
<div class="row gx-4 justify-content-center">
|
||||
<div class="col-lg-8">
|
||||
<h2>Liste des échouages</h2>
|
||||
<h2>Liste des Attaques</h2>
|
||||
<p class="lead">veuillez selectionner les filtres de recherche ou parcourez la liste ci-dessous</p>
|
||||
|
||||
<!-- ici les filtres -->
|
||||
<form class="row g-3" method="POST">
|
||||
|
||||
<div class="col-auto">
|
||||
<select class="form-select" aria-label="Choisir une date" name="date">
|
||||
<option selected value="">Année</option>
|
||||
<?php for ($i = 1990; $i < 2020; $i++) : ?>
|
||||
<select class="form-select" aria-label="Choisir un niveau d'alerte" name="event_gravite">
|
||||
<option selected value="">niveau d'alerte</option>
|
||||
<?php for ($i = 1; $i <= 10; $i++) : ?>
|
||||
<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
|
||||
<?php endfor; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-auto">
|
||||
<select class="form-select" aria-label="Chosisir une gravité" name="gravité">
|
||||
<option selected value="">Gravité</option>
|
||||
<select class="form-select" aria-label="Chosisir une device" name="device_product">
|
||||
<option selected value="">Appareil de détection</option>
|
||||
<?php
|
||||
$especesByType = $db->getAlertsByGravite();
|
||||
foreach ($especesByType as $espece) : ?>
|
||||
<option value="<?php echo $espece->Getespece(); ?>"><?php echo $espece->Getespece(); ?></option>
|
||||
$devices = $db->getDevices();
|
||||
foreach ($devices as $device) : ?>
|
||||
<option value="<?php echo $device->getDeviceProduct(); ?>"><?php echo $device->getDeviceProduct(); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- <div class="col-auto">
|
||||
<select class="form-select" aria-label="Chosisir une zone" name="zone">
|
||||
<option selected value="">Zone</option>
|
||||
|
||||
<?php
|
||||
// $zonesEchouage = $db->getZonesEchouage();
|
||||
// foreach ($zonesEchouage as $zone) : ?>
|
||||
<option value="<?php //echo $zone->Getzone(); ?>"><?php// echo $zone->Getzone(); ?></option>
|
||||
<?php //endforeach; ?>
|
||||
</select>
|
||||
</div> -->
|
||||
|
||||
<div class="col-auto ms-auto me-0">
|
||||
<button type="submit" class="btn btn-primary mb-3">Filtrer</button>
|
||||
@ -98,9 +88,10 @@ $db = new Database();
|
||||
<tr>
|
||||
<th scope="col" class="id">N°</th>
|
||||
<th scope="col" class="Date">Date</th>
|
||||
<th scope="col" class="label">Espece</th>
|
||||
<th scope="col" class="label">Zone</th>
|
||||
<th scope="col" class="label">Nombre</th>
|
||||
<th scope="col" class="label">Nom alerte</th>
|
||||
<th scope="col" class="label">Appareil de détection</th>
|
||||
<th scope="col" class="label">Adresse source</th>
|
||||
<th scope="col" class="label">Niveau d'alerte</th>
|
||||
<th scope="col" class="label"></th>
|
||||
<th scope="col" class="label"></th>
|
||||
</tr>
|
||||
@ -108,24 +99,26 @@ $db = new Database();
|
||||
<tbody style="border: 1px solid black;">
|
||||
|
||||
<?php
|
||||
$echouages = $db->getAlerts($_POST, 20);
|
||||
foreach ($echouages as $echouage) : ?>
|
||||
$alerts = $db->getAlerts($_POST, 20);
|
||||
foreach ($alerts as $alert) : ?>
|
||||
<tr style="border: 1px solid black;">
|
||||
<td class="id"><?php echo $echouage->Getid(); ?></td>
|
||||
<td class="id"><?php echo $echouage->Getdate(); ?></td>
|
||||
<td class="label"><a href="info-echouage.php/?id=<?php echo $echouage->Getid(); ?>"><?php echo $echouage->Getespece(); ?></a></td>
|
||||
<td class="label"><?php echo $echouage->Getzone(); ?></td>
|
||||
<td class="label"><?php echo $echouage->Getnombre(); ?></td>
|
||||
<td class="label"><a href="delete.php/?id=<?php echo $echouage->Getid(); ?>">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash" viewBox="0 0 16 16">
|
||||
<path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z"/>
|
||||
<path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z"/>
|
||||
</svg></a>
|
||||
<!-- TODO change destination -->
|
||||
<td class="id"><a href="info-echouage.php/?id=<?php echo $alert->getId(); ?>"><?php echo $alert->getId(); ?></a></td>
|
||||
<td class="id"><?php echo $alert->getDateAlerte(); ?></td>
|
||||
<td class="label"><?php echo $alert->getAlerteName(); ?></td>
|
||||
<td class="label"><?php echo $alert->getDeviceProduct(); ?></td>
|
||||
<td class="label"><?php echo $alert->getSourceAddress(); ?></td>
|
||||
<td class="label"><?php echo $alert->getEventGravite(); ?></td>
|
||||
<td class="label"><a href="delete.php/?id=<?php echo $alert->Getid(); ?>">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash" viewBox="0 0 16 16">
|
||||
<path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z" />
|
||||
<path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z" />
|
||||
</svg></a>
|
||||
</td>
|
||||
<td class="label"><a href="edit.php/?id=<?php echo $echouage->Getid(); ?>">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil" viewBox="0 0 16 16">
|
||||
<path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z"/>
|
||||
</svg></a>
|
||||
<td class="label"><a href="edit.php/?id=<?php echo $alert->getId(); ?>">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil" viewBox="0 0 16 16">
|
||||
<path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z" />
|
||||
</svg></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
@ -134,7 +127,7 @@ $db = new Database();
|
||||
</table>
|
||||
<nav aria-label="Page navigation">
|
||||
<ul class="pagination">
|
||||
|
||||
|
||||
<?php
|
||||
$nb_echouage = $db->getnbAlerts();
|
||||
$nb_page = ceil($nb_echouage / 20);
|
||||
@ -143,7 +136,10 @@ $db = new Database();
|
||||
} else {
|
||||
$page = 1;
|
||||
}
|
||||
echo "<li class='page-item col-auto'><a class='page-link' href=index.php?page=1'>premiere page</a></li>";
|
||||
|
||||
if ($nb_page > 1) {
|
||||
echo "<li class='page-item col-auto'><a class='page-link' href=index.php?page=1'>première page</a></li>";
|
||||
}
|
||||
|
||||
if ($page > 1) {
|
||||
echo "<li class='page-item col-auto'><a class='page-link' href=index.php?page=" . strval($page - 1) . "'>" . strval($page - 1) . "</a></li>";
|
||||
@ -154,16 +150,18 @@ $db = new Database();
|
||||
if (($page) < $nb_page) {
|
||||
echo "<li class='page-item col-auto'><a class='page-link' href=index.php?page=" . strval($page + 1) . "'>" . strval($page + 1) . "</a></li>";
|
||||
}
|
||||
|
||||
echo "<li class='page-item col-auto'><a class='page-link' href=index.php?page=" . strval($nb_page) . "'>derniere page</a></li>";
|
||||
if ($nb_page > 1) {
|
||||
echo "<li class='page-item col-auto'><a class='page-link' href=index.php?page=" . strval($nb_page) . "'>dernière page</a></li>";
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@ -176,7 +174,7 @@ $db = new Database();
|
||||
|
||||
<footer class="py-5 bg-dark">
|
||||
<div class="container px-4">
|
||||
<p class="m-0 text-center text-white">Copyright © CIR2 2023/<a class ="text-white" href="https://www.observatoire-pelagis.cnrs.fr/">Pelagis</a></p>
|
||||
<p class="m-0 text-center text-white">Copyright © CIR2 2023/<a class="text-white" href="https://www.observatoire-pelagis.cnrs.fr/">Pelagis</a></p>
|
||||
</div>
|
||||
</footer><!-- Bootstrap core JS-->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script><!-- Core theme JS-->
|
||||
|
Reference in New Issue
Block a user