débugage barre de recherche tout sauf auteur. Maj balise script en footer
This commit is contained in:
parent
c5f3ef2d0f
commit
411b19df58
3 changed files with 31 additions and 3 deletions
|
|
@ -39,6 +39,9 @@
|
||||||
|
|
||||||
public function search(){
|
public function search(){
|
||||||
|
|
||||||
|
//variable pour faire fonctionner le script en footer
|
||||||
|
$strPage = "search";
|
||||||
|
|
||||||
// inclusion du header
|
// inclusion du header
|
||||||
include('../app/views/partials/header.php');
|
include('../app/views/partials/header.php');
|
||||||
|
|
||||||
|
|
@ -65,8 +68,6 @@
|
||||||
$arrProjectToDisplay[] = $objProject;
|
$arrProjectToDisplay[] = $objProject;
|
||||||
}
|
}
|
||||||
|
|
||||||
var_dump($arrProjectToDisplay);
|
|
||||||
|
|
||||||
// Récupération des utilisateurs
|
// Récupération des utilisateurs
|
||||||
require_once("../app/models/user_model.php");
|
require_once("../app/models/user_model.php");
|
||||||
$objUserModel = new UserModel;
|
$objUserModel = new UserModel;
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
// Recherche par auteur
|
// Recherche par auteur
|
||||||
if ($intAuthor > 0){
|
if ($intAuthor > 0){
|
||||||
$strRq .= $strWhere." project_user = ".$intAuthor;
|
$strRq .= $strWhere." user_id = ".$intAuthor;
|
||||||
$strWhere = " AND ";
|
$strWhere = " AND ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,32 @@
|
||||||
|
|
||||||
<h2>coucou c'est le footer</h2>
|
<h2>coucou c'est le footer</h2>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js" integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js" integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous"></script>
|
||||||
|
<?php if ($strPage == "search") { ?>
|
||||||
|
<script>
|
||||||
|
// Gestion de l'affichage des champs de date
|
||||||
|
const periodRadios = document.querySelectorAll('input[name="period"]');
|
||||||
|
const dateExact = document.getElementById('date-exact');
|
||||||
|
const dateRange = document.getElementById('date-range');
|
||||||
|
|
||||||
|
function toggleDateFields() {
|
||||||
|
const selectedPeriod = document.querySelector('input[name="period"]:checked').value;
|
||||||
|
|
||||||
|
if (selectedPeriod === '0') {
|
||||||
|
dateExact.style.display = 'block';
|
||||||
|
dateRange.style.display = 'none';
|
||||||
|
} else {
|
||||||
|
dateExact.style.display = 'none';
|
||||||
|
dateRange.style.display = 'block';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
periodRadios.forEach(radio => {
|
||||||
|
radio.addEventListener('change', toggleDateFields);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Initialisation au chargement
|
||||||
|
toggleDateFields();
|
||||||
|
</script>
|
||||||
|
<?php } ?>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue