radiantrh/Modele/Collegepolice.php
2025-12-29 21:55:54 +00:00

32 lines
887 B
PHP

<?php
require_once 'Framework/Modele.php';
class Collegepolice extends Modele {
public function getCollegepoliceId($idCollege) {
$sql = 'SELECT A.id AS idCollege, A.*, B.libelle as produit
from college A
join produit B on (B.codeSociete=A.codeSociete) AND (B.codeProduit=A.codeProduit)
where A.id=?';
$college = $this->executerRequete($sql, array($idCollege));
return $college->fetch(PDO::FETCH_ASSOC);
}
public function getCollegesPolice($idPolice)
{
$sql = 'call sp_get_colleges_police(?);';
$college = $this->executerRequete($sql, array($idPolice));
return $college->fetchAll(PDO::FETCH_ASSOC);
}
public function getTotaldcollege($idPolice) {
$sql = 'call sp_totalcollege(?)';
$totalcollege = $this->executerRequete($sql, array($idPolice));
return $totalcollege->fetch(PDO::FETCH_ASSOC);
}
}