コード例 #1
0
ファイル: flashJoueurs.php プロジェクト: lcapdecomme/monls
 $newPronostic->jeu_id = $jeu->jeu_id;
 $newPronostic->joueur_id = $listeJoueurs[$j]["joueur_id"];
 $newPronostic->pronostic1 = getPronoAleatoire();
 $moyenne = $moyenne + getIndicateursMatchChoix($listeIndicateurs, 1, $newPronostic->pronostic1);
 $newPronostic->pronostic2 = getPronoAleatoire();
 $moyenne = $moyenne + getIndicateursMatchChoix($listeIndicateurs, 2, $newPronostic->pronostic2);
 $newPronostic->pronostic3 = getPronoAleatoire();
 $moyenne = $moyenne + getIndicateursMatchChoix($listeIndicateurs, 3, $newPronostic->pronostic3);
 $newPronostic->pronostic4 = getPronoAleatoire();
 $moyenne = $moyenne + getIndicateursMatchChoix($listeIndicateurs, 4, $newPronostic->pronostic4);
 $newPronostic->pronostic5 = getPronoAleatoire();
 $moyenne = $moyenne + getIndicateursMatchChoix($listeIndicateurs, 5, $newPronostic->pronostic5);
 $newPronostic->pronostic6 = getPronoAleatoire();
 $moyenne = $moyenne + getIndicateursMatchChoix($listeIndicateurs, 6, $newPronostic->pronostic6);
 $newPronostic->pronostic7 = getPronoAleatoire();
 $moyenne = $moyenne + getIndicateursMatchChoix($listeIndicateurs, 7, $newPronostic->pronostic7);
 $newPronostic->flash = "1";
 // Calcul de l'indice
 $indice = $moyenne / $nbCasesCoches;
 $indice = round((100 - $indice) / 10, 2);
 if (strlen(trim($pronostic->pronostic8)) == 0) {
     $newPronostic->IndiceGain7 = $indice;
 } else {
     $newPronostic->IndiceGain15 = $indice;
 }
 $return = $newPronostic->ajoute();
 if (!$return) {
     $nbJoueurFlashErreur++;
 } else {
     if ($debug) {
         var_dump($newPronostic);
コード例 #2
0
ファイル: repartition.php プロジェクト: lcapdecomme/monls
 $nbCasesCoches = 0;
 $joueur = $listeJoueurs[$j];
 $joueur_id = $joueur["joueur_id"];
 $joueur_nom = $joueur["nom"];
 $prono = getPronoJoueur($pronostics, $joueur_id);
 $tableauChoix = array("1", "N", "2");
 //echo "Pronostics du Joueur {$joueur_id} : <br>";
 //var_dump($pronostic);
 // Pour les 15 pronostics possibles
 for ($i = 1; $i <= 15; $i++) {
     // Ce pronostic existe-t-il ?
     if (strlen(trim($prono['pronostic' . $i])) != 0) {
         // Oui ? bon on regarde si c'est 1, N ou 2
         foreach ($tableauChoix as &$choix) {
             if (strpos($prono['pronostic' . $i], $choix) !== false) {
                 $moyenne = $moyenne + getIndicateursMatchChoix($listeIndicateurs, $i, $choix);
                 $nbCasesCoches = $nbCasesCoches + 1;
                 //echo "La moyenne vaut {$moyenne} et {$nbCasesCoches} cases cochees<br>";
             }
         }
     }
 }
 // Calcul de l'indice
 $indice = $moyenne / $nbCasesCoches;
 $indice = round((100 - $indice) / 10, 2);
 // Pronostic de tous les joueurs
 $pronostic2 = new Pronostic($db);
 $pronostic2->jeu_id = $jeu->jeu_id;
 $pronostic2->joueur_id = $joueur_id;
 $pronostic2->chargePronostic();
 if ($debug) {