Skip to content

Commit

Permalink
Fix #405 style for ultimate garbage or not
Browse files Browse the repository at this point in the history
Small refactoring of the code.

Co-authored-by: Axel Viala <axel.viala@darnuria.eu>
Signed-off-by: Adrien Kara <adrien@iglou.eu>
  • Loading branch information
IGLOU-EU and darnuria committed Dec 6, 2020
1 parent bb39de7 commit 7c73c0b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
15 changes: 15 additions & 0 deletions css/oressource.css
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,18 @@ pre {
.list-group-item {
padding: 5px 10px;
}

/* poubelles type */
.garbage.ultime-0::before,
.garbage.ultime-1::before {
font-weight: bold;
padding-left: 1px;
}

.garbage.ultime-0::before {
content: "✕ Non";
}

.garbage.ultime-1::before {
content: "✓ Oui";
}
14 changes: 5 additions & 9 deletions ifaces/edition_types_poubelles.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

if (isset($_SESSION['id']) && $_SESSION['systeme'] === 'oressource' && (strpos($_SESSION['niveau'], 'g') !== false)) {
require_once 'tete.php';
$types_poubelles = $bdd->query('SELECT * FROM types_poubelles');
?>
<div class="container">
<h1>Gestion de la typologie et de la masse des différentes poubelles mises à disposition de la structure par la ville</h1>
Expand Down Expand Up @@ -58,17 +59,14 @@
</thead>

<tbody>
<?php
$reponse = $bdd->query('SELECT * FROM types_poubelles');
while ($donnees = $reponse->fetch()) {
?>
<?php foreach ($types_poubelles as $donnees) { ?>
<tr>
<td><?= $donnees['id']; ?></td>
<td><?= $donnees['timestamp']; ?></td>
<td><?= $donnees['nom']; ?></td>
<td><?= $donnees['description']; ?></td>
<td><?= $donnees['masse_bac']; ?></td>
<td><?= $donnees['ultime']; ?></td>
<td class="garbage ultime-<?= $donnees['ultime']; ?>"></td>
<td><span class="badge" style="background-color:<?= $donnees['couleur']; ?>"><?= $donnees['couleur']; ?></span></td>
<td><?= configBtnVisible(['url' => 'types_poubelles', 'id' => $donnees['id'], 'visible' => $donnees['visible']]) ?></td>
<td>
Expand All @@ -78,15 +76,13 @@
</form>
</td>
</tr>
<?php
}
$reponse->closeCursor();
?>
<?php } ?>
</tbody>
</table>
</div><!-- /.container -->

<?php
$types_poubelles->closeCursor();
require_once 'pied.php';
} else {
header('Location: ../moteur/destroy.php');
Expand Down

0 comments on commit 7c73c0b

Please sign in to comment.