Loading public/js/create_div.js +19 −9 Original line number Diff line number Diff line if(document.querySelector('.clickableDelete')){ var deleteButton = document.querySelector('.clickableDelete'); function checkHistoryLines() { var historyLines = document.querySelectorAll('.historyLine'); var Historique = document.getElementById("Historique"); if (historyLines.length > 0) { Historique.style.display = 'table'; document.addEventListener('DOMContentLoaded', function () { function checkButtons() { var deleteButtons = document.querySelectorAll('.clickableRed'); var historiqueContainer = document.getElementById('Historique'); var DiverImage = document.getElementById('imageDiver'); if (deleteButtons.length > 0) { historiqueContainer.style.display = 'block'; DiverImage.style.display = 'none'; } else { Historique.style.display = 'none'; historiqueContainer.style.display = 'none'; DiverImage.style.display = 'block'; } } deleteButton.addEventListener('click', checkHistoryLines); checkButtons(); document.addEventListener('click', function (event) { if (event.target.classList.contains('clickableRed')) { setTimeout(checkButtons, 100); } }); }); No newline at end of file resources/views/create_dive.blade.php +17 −12 Original line number Diff line number Diff line Loading @@ -4,12 +4,13 @@ <link rel="stylesheet" href="{{ asset('/css/create_div.css') }}"> <div style="display : flex; flex-direction: row"> <div style="width: 50%; margin-right: 50px;display:flex; align-items: center; flex-direction: column;overflow: auto;" id="Historique"> @if (!isset($previousDives)) <img src="{{ asset('/images/Diver1.png') }}" alt="Diver illustration"> @else <div style="width: 50%; margin-right: 50px;display:flex; align-items: center; flex-direction: column;overflow: auto;"> <img src="{{ asset('/images/Diver1.png') }}" alt="Diver illustration" id="imageDiver"> <div id="Historique"> <p style="font-size: 35px">Historique de plongées crées</p> <hr style="height: 3px;background-color: black;margin-left: 10%;margin-bottom: 15px;margin-top: 5px; width : 80%"> <hr style="height: 3px;background-color: black;margin-left: 10%;margin-bottom: 15px;margin-top: 5px; width : 80%"> <table class="arrayhistory"> <tr class="history"> <th>Date</th> Loading @@ -28,11 +29,15 @@ @endif @endforeach <td>{{ $dive->PRE_CODE }}</td> <td><form action="/dive/delete/{{ $dive->DS_CODE }}" method="POST">@csrf<button type="submit" class="clickable clickableRed"><i class="fa-solid fa-xmark"></i></button></form></td> <td> <form action="/dive/delete/{{ $dive->DS_CODE }}" method="POST">@csrf<button type="submit" class="clickable clickableRed"><i class="fa-solid fa-xmark"></i></button></form> </td> </tr> @endforeach </table> @endif </div> </div> <form action="/create/dive" method="POST" style="width: 70%;"> @csrf Loading @@ -56,7 +61,8 @@ <input class="inputTime" required type="date" name="day" id="dayInput" value="{{ $precedent->DS_DATE }}"> @else <input class="inputTime" required type="date" name="day" id="dayInput" min="<?php echo date('Y-m-d'); ?>"> <input class="inputTime" required type="date" name="day" id="dayInput" min="<?php echo date('Y-m-d'); ?>"> @endif <select required name="hour" id="hour" style="width: 160px; margin-bottom: 15px;"> <option value="Matin">Matin</option> Loading Loading @@ -102,13 +108,12 @@ </div> <div class="divideFlexBig Column"> @if (isset($precedent)) <input required type="number" name="max" id="maxInput" min="0" placeholder="0" style="width: 20%;-moz-appearance: textfield;text-align: center;" <input required type="number" name="max" id="maxInput" min="0" placeholder="0" style="width: 20%;-moz-appearance: textfield;text-align: center;" value="{{ $precedent->DS_MAX_DIVERS }}"> @else <input required type="number" name="max" id="maxInput" min="0" placeholder="0" style="width: 20%;-moz-appearance: textfield;text-align: center;"> placeholder="0" style="width: 20%;-moz-appearance: textfield;text-align: center;"> @endif </div> </div> Loading resources/views/update_dive.blade.php +1 −1 File changed.Contains only whitespace changes. Show changes Loading
public/js/create_div.js +19 −9 Original line number Diff line number Diff line if(document.querySelector('.clickableDelete')){ var deleteButton = document.querySelector('.clickableDelete'); function checkHistoryLines() { var historyLines = document.querySelectorAll('.historyLine'); var Historique = document.getElementById("Historique"); if (historyLines.length > 0) { Historique.style.display = 'table'; document.addEventListener('DOMContentLoaded', function () { function checkButtons() { var deleteButtons = document.querySelectorAll('.clickableRed'); var historiqueContainer = document.getElementById('Historique'); var DiverImage = document.getElementById('imageDiver'); if (deleteButtons.length > 0) { historiqueContainer.style.display = 'block'; DiverImage.style.display = 'none'; } else { Historique.style.display = 'none'; historiqueContainer.style.display = 'none'; DiverImage.style.display = 'block'; } } deleteButton.addEventListener('click', checkHistoryLines); checkButtons(); document.addEventListener('click', function (event) { if (event.target.classList.contains('clickableRed')) { setTimeout(checkButtons, 100); } }); }); No newline at end of file
resources/views/create_dive.blade.php +17 −12 Original line number Diff line number Diff line Loading @@ -4,12 +4,13 @@ <link rel="stylesheet" href="{{ asset('/css/create_div.css') }}"> <div style="display : flex; flex-direction: row"> <div style="width: 50%; margin-right: 50px;display:flex; align-items: center; flex-direction: column;overflow: auto;" id="Historique"> @if (!isset($previousDives)) <img src="{{ asset('/images/Diver1.png') }}" alt="Diver illustration"> @else <div style="width: 50%; margin-right: 50px;display:flex; align-items: center; flex-direction: column;overflow: auto;"> <img src="{{ asset('/images/Diver1.png') }}" alt="Diver illustration" id="imageDiver"> <div id="Historique"> <p style="font-size: 35px">Historique de plongées crées</p> <hr style="height: 3px;background-color: black;margin-left: 10%;margin-bottom: 15px;margin-top: 5px; width : 80%"> <hr style="height: 3px;background-color: black;margin-left: 10%;margin-bottom: 15px;margin-top: 5px; width : 80%"> <table class="arrayhistory"> <tr class="history"> <th>Date</th> Loading @@ -28,11 +29,15 @@ @endif @endforeach <td>{{ $dive->PRE_CODE }}</td> <td><form action="/dive/delete/{{ $dive->DS_CODE }}" method="POST">@csrf<button type="submit" class="clickable clickableRed"><i class="fa-solid fa-xmark"></i></button></form></td> <td> <form action="/dive/delete/{{ $dive->DS_CODE }}" method="POST">@csrf<button type="submit" class="clickable clickableRed"><i class="fa-solid fa-xmark"></i></button></form> </td> </tr> @endforeach </table> @endif </div> </div> <form action="/create/dive" method="POST" style="width: 70%;"> @csrf Loading @@ -56,7 +61,8 @@ <input class="inputTime" required type="date" name="day" id="dayInput" value="{{ $precedent->DS_DATE }}"> @else <input class="inputTime" required type="date" name="day" id="dayInput" min="<?php echo date('Y-m-d'); ?>"> <input class="inputTime" required type="date" name="day" id="dayInput" min="<?php echo date('Y-m-d'); ?>"> @endif <select required name="hour" id="hour" style="width: 160px; margin-bottom: 15px;"> <option value="Matin">Matin</option> Loading Loading @@ -102,13 +108,12 @@ </div> <div class="divideFlexBig Column"> @if (isset($precedent)) <input required type="number" name="max" id="maxInput" min="0" placeholder="0" style="width: 20%;-moz-appearance: textfield;text-align: center;" <input required type="number" name="max" id="maxInput" min="0" placeholder="0" style="width: 20%;-moz-appearance: textfield;text-align: center;" value="{{ $precedent->DS_MAX_DIVERS }}"> @else <input required type="number" name="max" id="maxInput" min="0" placeholder="0" style="width: 20%;-moz-appearance: textfield;text-align: center;"> placeholder="0" style="width: 20%;-moz-appearance: textfield;text-align: center;"> @endif </div> </div> Loading
resources/views/update_dive.blade.php +1 −1 File changed.Contains only whitespace changes. Show changes