Bug recherche auteur ok
This commit is contained in:
parent
411b19df58
commit
e15003fc5c
5 changed files with 33 additions and 34 deletions
|
|
@ -53,7 +53,6 @@
|
||||||
$strStartDate = $_POST['startdate']??'';
|
$strStartDate = $_POST['startdate']??'';
|
||||||
$strEndDate = $_POST['enddate']??'';
|
$strEndDate = $_POST['enddate']??'';
|
||||||
$intCategory = $_POST['category']??0;
|
$intCategory = $_POST['category']??0;
|
||||||
|
|
||||||
// Récupération des projetc
|
// Récupération des projetc
|
||||||
$objProjectModel = new ProjectModel;
|
$objProjectModel = new ProjectModel;
|
||||||
$arrProject = $objProjectModel->findAll(intAuthor:$intAuthor, intPeriod:$intPeriod, strDate:$strDate,
|
$arrProject = $objProjectModel->findAll(intAuthor:$intAuthor, intPeriod:$intPeriod, strDate:$strDate,
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,11 @@ require_once("mother_entity.php");
|
||||||
|
|
||||||
class Image extends Entity{
|
class Image extends Entity{
|
||||||
|
|
||||||
private int $_id;
|
private int $_id;
|
||||||
protected string $_name = '';
|
private string $_name = '';
|
||||||
protected string $_alt = '';
|
private string $_alt = '';
|
||||||
protected string $_status ='';
|
private string $_status ='';
|
||||||
|
private int $_project = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recherche par catégorie
|
// Recherche par catégorie
|
||||||
if ($intAuthor > 0){
|
if ($intCategory > 0){
|
||||||
$strRq .= $strWhere." project_category = ".$intCategory;
|
$strRq .= $strWhere." project_category = ".$intCategory;
|
||||||
$strWhere = " AND ";
|
$strWhere = " AND ";
|
||||||
}
|
}
|
||||||
|
|
@ -70,6 +70,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lancer la requête et récupérer les résultats
|
// Lancer la requête et récupérer les résultats
|
||||||
|
var_dump($strRq);
|
||||||
return $this->_db->query($strRq)->fetchAll();
|
return $this->_db->query($strRq)->fetchAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,32 +1,5 @@
|
||||||
|
|
||||||
<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>
|
|
||||||
<?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>
|
||||||
|
|
@ -167,3 +167,28 @@
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</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>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue