if ($nb_parieurs1 == "0") {
        $points_prono_domicile = "---";
    } else {
        $points_prono_domicile = floor($points_prono_exact * $nb_parieurs / $nb_parieurs1);
    }
    if ($nb_parieursN == "0") {
        $points_prono_nul = "---";
    } else {
        $points_prono_nul = floor($points_prono_exact * $nb_parieurs / $nb_parieursN);
    }
    if ($nb_parieurs2 == "0") {
        $points_prono_visiteur = "---";
    } else {
        $points_prono_visiteur = floor($points_prono_exact * $nb_parieurs / $nb_parieurs2);
    }
    $date = format_date_fr_red($row[5]);
    echo "<tr>";
    echo "<td class=\"derniers_pronos_journee\">{$row['6']}</td>";
    echo "<td class=\"derniers_pronos_date\">{$date}</td>";
    echo "<td class=\"derniers_pronos_clubdom\">{$clubs_nom}</td>";
    echo "<td class=\"derniers_pronos_prono\">";
    $nb_points = 0;
    if ($prono == "1") {
        $nb_points = $points_prono_domicile;
        ?>
             <img src="images/1.gif" alt="" title="<?php 
        print "Points Hourra : " . $points_prono_domicile;
        ?>
">
             <img src="images/N-gris.gif" alt="" title="<?php 
        print "Points Hourra : " . $points_prono_nul;
function grille_admin ($gr_champ)
{
$query="SELECT phpl_clubs.nom, CLEXT.nom, phpl_matchs.buts_dom, phpl_matchs.buts_ext, phpl_matchs.id, phpl_matchs.date_reelle, phpl_journees.numero
FROM phpl_clubs, phpl_clubs as CLEXT, phpl_matchs, phpl_journees, phpl_equipes, phpl_equipes as EXT, phpl_gr_championnats
WHERE phpl_clubs.id=phpl_equipes.id_club
AND CLEXT.id=EXT.id_club
AND phpl_equipes.id=phpl_matchs.id_equipe_dom
AND EXT.id=phpl_matchs.id_equipe_ext
AND phpl_matchs.id_journee=phpl_journees.id
AND phpl_journees.id_champ=phpl_gr_championnats.id_champ
AND phpl_gr_championnats.id='$gr_champ'
AND phpl_matchs.buts_dom is null
AND phpl_matchs.buts_ext is null
AND phpl_clubs.nom!='exempte'
AND CLEXT.nom!='exempte'
ORDER by phpl_matchs.date_reelle, phpl_clubs.nom
LIMIT 0, 10";

$i=0;
$result=mysql_query($query) or die ("probleme " .mysql_error());

while ($row=mysql_fetch_array($result) and $i<10)
  {
$clubs_nom = stripslashes($row[0]);
$clubs_nom1 = stripslashes($row[1]);
$query2= "SELECT pronostic FROM phpl_pronostics, phpl_gr_championnats WHERE phpl_pronostics.id_match='$row[4]' AND phpl_gr_championnats.id='$gr_champ' AND id_membre=id_master";
$result2=mysql_query($query2) or die ("probleme " .mysql_error());
$nb_pronos= mysql_num_rows($result2);

if ($nb_pronos == "0") {$prono="0";}
{
  while ($row2=mysql_fetch_array($result2))
  {
    $prono=$row2["0"];
    if ($row2["0"] == ""){$prono="0";}
  }
}
  $date=format_date_fr_red($row[5]);



  echo "<tr><td><div class=\"blanc\">$row[6]</div></td>";
  echo "<td><div class=\"blanc\">$date</div></td>";
  echo "<td align=\"right\"><div class=\"blanc\">$clubs_nom</div></td>";

  echo "<td><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" >";
  echo "<tr>";
  echo "<td width=\"45\" height=\"10\" valign=\"middle\" align=\"center\">";
  echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"50\"><tr><td>";

         if ($prono=="1")
           {
           ?>
             <img src="barre.gif" border="no" alt=""> <img src="N.gif" border="no" alt=""> <img src="2.gif"  border="no" alt="">
           <?php
           }

         if ($prono=="N")
           {
           ?>
             <img src="1.gif" border="no" alt=""> <img src="barre.gif" border="no" alt=""> <img src="2.gif"  border="no" alt="">
           <?php
           }

         if ($prono=="2")
         {
         ?>
             <img src="1.gif" border="no" alt=""> <img src="N.gif" border="no" alt=""> <img src="barre.gif"  border="no" alt="">
         <?php
         }
  
         if ($prono=="0")
         {
          ?> 
             <img src="1.gif" border="no" alt=""> <img src="N.gif" border="no" alt=""> <img src="2.gif"  border="no" alt="">
          <?php
         }
  echo "</td></tr></table>";

  echo "</td></tr></table></td>";

  echo "<td><div class=\"blanc\">$clubs_nom1</div></td>";

  $requete2="SELECT tps_avant_prono FROM phpl_gr_championnats WHERE id='$gr_champ'";
  $resultats2=mysql_query($requete2) or die ("probleme " .mysql_error());
   while ($row2=mysql_fetch_array($resultats2))
   {
    $temps_avantmatch=$row2[0];
   }

  $date_match_timestamp=format_date_timestamp($row[5]);
  $date_actuelle=time();
  $ecart_secondes=$date_match_timestamp-$date_actuelle;
  $ecart_heures = floor($ecart_secondes / (60*60))-$temps_avantmatch;
  $ecart_minutes = floor($ecart_secondes / 60)-$temps_avantmatch*60;
  $ecart_jours = floor($ecart_secondes / (60*60*24)-$temps_avantmatch/60);
  $date=format_date_fr_red($row[5]);

  echo "<td align=\"center\">";
  if ($ecart_heures>48) echo "<div class=\"blanc\">$ecart_jours jours</div>";
  elseif ($ecart_heures>0) echo "<div class=\"blanc\">$ecart_heures h</div>";
  elseif ($ecart_heures == 0) echo "<div class=\"blanc\">$ecart_minutes min</div>";
  else {echo"<div class=\"blanc\">expiré</div>";}
  echo "</td>";
  echo "</tr>";
  $i++;
}

}