<?php

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;
}

?>