forked from rebillar/site-accueil-insa
planning alert avec description
This commit is contained in:
parent
6aabc12328
commit
873aa0a10a
1 changed files with 20 additions and 1 deletions
21
planning.php
21
planning.php
|
@ -98,7 +98,7 @@ if(isset($_GET['planning']) AND !empty(['planning']))
|
||||||
$req1->execute(array($planning));
|
$req1->execute(array($planning));
|
||||||
while($r1 = $req1->fetch()) {
|
while($r1 = $req1->fetch()) {
|
||||||
?>
|
?>
|
||||||
<div class="class" style="background-color: <?= $r1['color'] ?>; height: <?= $r1['length'] ?>vh;">
|
<div class="class" data-description="<?=$r1['description']?>" style="background-color: <?= $r1['color'] ?>; height: <?= $r1['length'] ?>vh;">
|
||||||
<?= $r1['title'] ?>
|
<?= $r1['title'] ?>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
|
@ -210,6 +210,25 @@ if(isset($_GET['planning']) AND !empty(['planning']))
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- needed for showing custom alert -->
|
||||||
|
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
const pln_cases = document.getElementsByClassName("class");
|
||||||
|
for (let i = 0; i < pln_cases.length; i++) {
|
||||||
|
let current = pln_cases[i];
|
||||||
|
|
||||||
|
current.addEventListener("click", (e) => {
|
||||||
|
Swal.fire({
|
||||||
|
title: '<strong id="modal-title">' + current.innerHTML.trim() + '</strong>',
|
||||||
|
html: current.dataset.description
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
|
|
Loading…
Reference in a new issue