1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
// nuage de mots-clés
$req = "SELECT COUNT(DISTINCT ID_Motcle) FROM motcle_projet";
$oConnexion->execute($req);
$oConnexion->moveNext();
$total_mc = $oConnexion->get();
$total_mc = (int) $total_mc[0];
$niv1 = floor($total_mc / 3);
$niv2 = floor($total_mc - $niv1);
$mots_cles = array();
$req = "SELECT MC_Libelle, ID_Motcle FROM mots_cles";
$oConnexion->execute($req);
while($oConnexion->moveNext() != -1 && $TempRecord=$oConnexion->get())
$mots_cles[$TempRecord['ID_Motcle']] = $TempRecord['MC_Libelle'];
foreach($mots_cles as $id_mc=>$val_mc){
$req = "SELECT COUNT(ID_Projet) FROM motcle_projet WHERE ID_Motcle=".$id_mc;
$oConnexion->execute($req);
$oConnexion->moveNext();
$nb_mc = $oConnexion->get();
$nb_mc = (int) $nb_mc[0];
if($nb_mc <= $niv1)
$style_mc = "tags3";
elseif($nb_mc <= $niv2)
$style_mc = "tags2";
else
$style_mc = "tags1";
?><a href="#" class="<?=$style_mc?>"><?=$val_mc?> </a><?
}
?> |