127 lines
5.6 KiB
PHP
Executable File
127 lines
5.6 KiB
PHP
Executable File
<?php
|
|
$titre="Determination des horaires des matchs";include("enTete.php");echo"<body background='images/balle_raquette3.jpg'> ";
|
|
echo "<center><table><tr><th align=center><h2><u>Liste des matchs qui dont on ne connait pas l'horaire.</u></h2></th><tr></table></center><p>";
|
|
include("conf.php");
|
|
include("mysql_compat.php");
|
|
include ("conf.php");
|
|
$db_connection=mysql_connect($db_host,$db_user,$password);
|
|
mysql_select_db($db_name,$db_connection);
|
|
//////////////////////////////////////////RECHERCHE DES MATCH DU TOURNOI QUI N'ONT PAS D'HORAIRE///////////////
|
|
$ext=0;
|
|
for($i=0;$i<count($['']);$i++){
|
|
$requete="SELECT avencement, tour FROM `match` WHERE categorie='".$[''][$i]."' AND jour IS NULL GROUP BY avencement, tour ORDER BY avencement DESC, tour ASC;";
|
|
$reponse=mysql_query($requete,$db_connection) or die ("Erreur no".mysql_errno()." : ".mysql_error()."<br>");
|
|
while($reptab=mysql_fetch_array($reponse)){
|
|
$list_tour[$ext][tour]=$[''];
|
|
$list_tour[$ext][avencement]=$[''];
|
|
$list_tour[$ext][id_categorie]=$[''][$i];
|
|
$list_tour[$ext][description]=$[''][$i];
|
|
$ext++;
|
|
}
|
|
}
|
|
$tab_classement=array("0 ou mieux","1/6","2/6","3/6","4/6","5/6","15","15/1","15/2","15/3","15/4","15/5","30","30/1","30/2","30/3","30/4","30/5","NC");
|
|
for($i=0;$i<count($list_tour);$i++){
|
|
$requete="SELECT * FROM `match` WHERE categorie='".$list_tour[$i][id_categorie]."' AND avencement = '".$list_tour[$i][avencement]."' AND tour='".$list_tour[$i][tour]."' AND vainqueur IS NULL AND jour IS NULL ORDER BY avencement DESC, tour ASC;";
|
|
$reponse=mysql_query($requete,$db_connection) or die ("Erreur no".mysql_errno()." : ".mysql_error()."<br>");
|
|
while ($reptab=mysql_fetch_array($reponse)){
|
|
if ($[''][0]!='Q') $joueur1=$[''];
|
|
else {
|
|
$no_match=explode("Q",$['']);$no_match=$no_match[1];
|
|
$requete2="SELECT vainqueur FROM `match` WHERE id_match='".$no_match."'";
|
|
$reponse2=mysql_query($requete2,$db_connection) or die ("Erreur no".mysql_errno()." : ".mysql_error()."<br>");
|
|
$reptab2=mysql_fetch_array($reponse2);
|
|
$joueur1=$[''];
|
|
}
|
|
if ($[''][0]!='Q') $joueur2=$[''];
|
|
else {
|
|
$no_match=explode("Q",$['']);$no_match=$no_match[1];
|
|
$requete2="SELECT vainqueur FROM `match` WHERE id_match='".$no_match."'";
|
|
$reponse2=mysql_query($requete2,$db_connection) or die ("Erreur no".mysql_errno()." : ".mysql_error()."<br>");
|
|
$reptab2=mysql_fetch_array($reponse2);
|
|
$joueur2=$[''];
|
|
|
|
}
|
|
$match="";
|
|
if ($joueur1) {
|
|
$requete2="SELECT nom, prenom, classement, id_inscription FROM `inscription`,`joueur` WHERE inscription.id_inscription = '$joueur1' AND inscription.joueur=joueur.id_joueur;";
|
|
$reponse2=mysql_query($requete2,$db_connection) or die ("Erreur no".mysql_errno()." : ".mysql_error()."<br>");
|
|
$reptab2=mysql_fetch_array($reponse2);
|
|
$texte1=$['']." ".$['']." : ".$tab_classement[$['']];
|
|
}
|
|
else{
|
|
$texte1=$[''];
|
|
}
|
|
if ($joueur2){
|
|
$requete2="SELECT nom, prenom, classement, id_inscription FROM `inscription`,`joueur` WHERE inscription.id_inscription = '$joueur2' AND inscription.joueur=joueur.id_joueur;";
|
|
$reponse2=mysql_query($requete2,$db_connection) or die ("Erreur no".mysql_errno()." : ".mysql_error()."<br>");
|
|
$reptab2=mysql_fetch_array($reponse2);
|
|
$texte2=$['']." ".$['']." : ".$tab_classement[$['']];
|
|
}
|
|
else{
|
|
$texte2=$[''];
|
|
}
|
|
$list_match[$i][id_match][]=$[''];
|
|
$list_match[$i][joueur1][]=$texte1;
|
|
$list_match[$i][joueur2][]=$texte2;
|
|
}
|
|
}
|
|
echo "<form action=enregistrementHoraireManuel.php method=post>";
|
|
echo "<center><table border=2 width= 85%>";
|
|
echo "<tr><td></td><td>";
|
|
echo "<table width =100%><tr><th width=80%>Joueurs</th><th width=20%>Horaire</th></tr></table>";
|
|
echo "</td></tr>";
|
|
$ext=0;
|
|
for($i=0;$i<count($list_tour);$i++){
|
|
if (count($list_match[$i])){
|
|
if (!$double) echo "<tr><th>".$list_tour[$i][description].",<br>Tranche ".$tab_classement[$list_tour[$i][avencement]].",<br> Tour ".$list_tour[$i][tour]."</th>";
|
|
else echo "<tr><th>".$list_tour[$i][description].",<br>Tranche ".$list_tour[$i][avencement].", <br>Tour ".$list_tour[$i][tour]."</th>";
|
|
echo "<td valign=top>";
|
|
echo "<table width=100%>";
|
|
for ($j=0;$j<count($list_match[$i][id_match]);$j++){
|
|
echo "<tr><td width =80% align=center><font size=2>".$list_match[$i][joueur1][$j]." Vs ".$list_match[$i][joueur2][$j]."</font></td>";
|
|
echo "<td width =20% align=right>";
|
|
/*if ($[''][$ext]==$list_match[$i][inscription1][$j])
|
|
{ $selected_insc1="selected"; $selected_insc2="";echo "**1**";}
|
|
else if ($[''][$ext]==$list_match[$i][inscription2][$j])
|
|
{ $selected_insc2="selected"; $selected_insc1="";echo "**2**";}
|
|
else
|
|
{ $selected_insc2="";$selected_insc1="";echo "**0**";}*/
|
|
echo "<select name=list_match[heure][]>";
|
|
echo "<option value=0> Choisir...";
|
|
if ($demi_jour=="am") {
|
|
echo "<option ".$selected[1].">9h00";
|
|
echo "<option ".$selected[2].">10h30";
|
|
echo "<option ".$selected[3].">12h00";
|
|
echo "<option ".$selected[4].">13h30";
|
|
}
|
|
else {
|
|
echo "<option ".$selected[5].">15h00";
|
|
echo "<option ".$selected[6].">16h30";
|
|
echo "<option ".$selected[7].">18h00";
|
|
echo "<option ".$selected[8].">19h30";
|
|
}
|
|
echo "</select>";
|
|
echo "</td></tr>";
|
|
$ext++;
|
|
}
|
|
echo "</table>";
|
|
echo "</td></tr>";
|
|
}
|
|
}
|
|
echo "</table><p>";
|
|
echo "<INPUT TYPE=SUBMIT VALUE=Continuer>";
|
|
echo "<INPUT TYPE=RESET VALUE=Annuler>";
|
|
echo $erreur;$erreur="";
|
|
echo "</center>";
|
|
for($i=0;$i<count($list_tour);$i++){
|
|
for ($j=0;$j<count($list_match[$i][id_match]);$j++){
|
|
echo "<input type=hidden name=list_match[id_match][] value=".$list_match[$i][id_match][$j].">";
|
|
}
|
|
}
|
|
echo "<input type=hidden name=jour value=".$jour.">";
|
|
echo "</form>";
|
|
mysql_close($db_connection);
|
|
include("piedDePage.php");
|
|
?>
|
|
|