Bug recherche auteur ok

This commit is contained in:
laura.chevillet 2026-01-21 16:17:57 +01:00
parent 411b19df58
commit e15003fc5c
5 changed files with 33 additions and 34 deletions

View file

@ -53,7 +53,6 @@
$strStartDate = $_POST['startdate']??'';
$strEndDate = $_POST['enddate']??'';
$intCategory = $_POST['category']??0;
// Récupération des projetc
$objProjectModel = new ProjectModel;
$arrProject = $objProjectModel->findAll(intAuthor:$intAuthor, intPeriod:$intPeriod, strDate:$strDate,

View file

@ -10,9 +10,10 @@ require_once("mother_entity.php");
class Image extends Entity{
private int $_id;
protected string $_name = '';
protected string $_alt = '';
protected string $_status ='';
private string $_name = '';
private string $_alt = '';
private string $_status ='';
private int $_project = 0;

View file

@ -36,7 +36,7 @@
}
// Recherche par catégorie
if ($intAuthor > 0){
if ($intCategory > 0){
$strRq .= $strWhere." project_category = ".$intCategory;
$strWhere = " AND ";
}
@ -70,6 +70,7 @@
}
// Lancer la requête et récupérer les résultats
var_dump($strRq);
return $this->_db->query($strRq)->fetchAll();
}
}

View file

@ -1,32 +1,5 @@
<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>
<?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>
</html>

View file

@ -167,3 +167,28 @@
</section>
</div>
</section>
<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>