prestation/Modele/Tache.php
2025-12-05 10:42:46 +00:00

25 lines
969 B
PHP
Executable File

<?php
require_once 'Framework/Modele.php';
class Tache extends Modele {
public function getBillets() {
$sql = 'select BIL_ID as id, BIL_DATE as date,'
. ' BIL_TITRE as titre, BIL_CONTENU as contenu from t_billet'
. ' order by BIL_ID desc';
$billets = $this->executerRequete($sql);
return $billets;
}
public function getBillet($idBillet) {
$sql = 'select BIL_ID as id, BIL_DATE as date,'
. ' BIL_TITRE as titre, BIL_CONTENU as contenu from t_billet'
. ' where BIL_ID=?';
$billet = $this->executerRequete($sql, array($idBillet));
return $billet->fetch(PDO::FETCH_ASSOC);
}
public function getNombreBillets()
{
$sql = 'select count(*) as nbBillets from t_billet';
$resultat = $this->executerRequete($sql);
$ligne = $resultat->fetch(PDO::FETCH_ASSOC);
return $ligne['nbBillets'];
}
}