This repository has been archived on 2024-04-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
DeezCycle/controleurs/jouerPartie_controleur.php
2024-04-18 13:08:25 +02:00

31 lines
742 B
PHP

<?php
function getJoueursPartie(int $idpartie)
{
return get_infos_requete("SELECT * FROM joue JOIN joueur J USING(idjoueur) WHERE joue.idpartie = " . $idpartie . " ORDER BY rang")['instances'];
}
function getCardsName(int $idpartie)
{
$cartes = get_infos_requete("SELECT img FROM carte JOIN est_compose USING(idcarte) JOIN partie USING(idplateau) WHERE idpartie = " . $idpartie . " ORDER BY rang")['instances'];
$noms = array();
foreach ($cartes as $carte) {
array_push($noms, $carte['img']);
}
return $noms;
}
function get_parties_id() {
$parties = get_infos_requete("SELECT idpartie FROM partie")['instances'];
$ids = array();
foreach ($parties as $partie) {
array_push($ids, $partie['idpartie']);
}
return $ids;
}
?>