Open Niort
session_start();
$nomPage =’index’;
// Ouverture BDD
try
{$bdd = new PDO(‘mysql:host=localhost;dbname=carredas_inscription’,’carredas_ktoo’,’niort79cac’);}
catch (Exception $e)
{die(‘Erreur : ‘ . $e -> getMessage());}
// Lecture de la table infos
$infos = $bdd -> QUERY(‘SELECT * FROM infos’)or die(print_r($bdd->errorInfo()));
$nbJour = 0;
while ($donnee1 = $infos->fetch())
{
$titre = $donnee1[‘titre’];
$annee = $donnee1[‘annee’];
$participant = $donnee1[‘participant’];
$jour[0] = $donnee1[‘jour1’];
$typeJour[0] = $donnee1[‘typej1’];
$mois[0] = $donnee1[‘mois1’];
$nbJour++;
$jour[1] = $donnee1[‘jour2’];
$typeJour[1] = $donnee1[‘typej2’];
if (!($jour[1] == 0))
{
$nbJour++;
$mois[1] = $donnee1[‘mois2’];
}
$jour[2] = $donnee1[‘jour3’];
$typeJour[2] = $donnee1[‘typej3’];
if (!($jour[2] == 0))
{
$nbJour++;
$mois[2] = $donnee1[‘mois3’];
}
$jour[3] = $donnee1[‘jour4’];
$typeJour[3] = $donnee1[‘typej4’];
if (!($jour[3] == 0))
{
$nbJour++;
$mois[3] = $donnee1[‘mois4’];
}
$etat = $donnee1[‘etat’];
}
$infos -> closeCursor();
if ($etat==0)
{
echo ‘[center][h2]Page d\’inscription[/h2][br/][h3][font color= »red »]’;
echo strtoupper($titre) .’ ‘ .$annee .'[/font][br/][br/]’ .$jour[0] .’ ‘ .$mois[0] .'(‘ .$typeJour[0] .’)’;
$nbJour1 = 1;
for ($i = 1;$i < $nbJour; $i++)
{
echo '[br/]' .$jour[$i] .' ' .$mois[$i] .'(' .$typeJour[$i] .')';
if ($typeJour[$i]=='DAY 1') {$nbJour1++;}
}
echo '[/h3][/center][br/]';
$_SESSION['page']='index';
// Lecture des infos joueurs : table "open"
$req = $bdd->query(‘SELECT * FROM open’) or die(print_r($bdd->errorInfo()));
$nbInscrit[0] = 0;
$nbInscrit[1] = 0;
$nbInscrit[2] = 0;
$tabLettres[0]=’A’;
$tabLettres[1]=’B’;
$tabLettres[2]=’C’;
while ($donnees = $req -> fetch())
{
if ($donnees[‘day1′]==’A’){$nbInscrit[0]++; }
if ($donnees[‘day1′]==’B’){$nbInscrit[1]++; }
if ($donnees[‘day1′]==’C’){$nbInscrit[2]++; }
}
for ($i = 0;$i < $nbJour1; $i++) { $nbAttente = 0; if ($nbInscrit[$i] < $participant + 1) {echo '[center]Nombre d inscrits DAY 1' .$tabLettres[$i] .' : ' .$nbInscrit[$i] .' sur ' .$participant .'[/center]';} else { echo '[center]Nombre d inscrits DAY 1' .$tabLettres[$i] .' : ' .$participant .' sur ' .$participant .'[/center]'; $nbAttente = $nbInscrit[$i] - $participant; echo '[center]Liste d\'attente DAY 1' .$tabLettres[$i] .' : ' .$nbAttente .'[/center]'; } $var = $tabLettres[$i]; //echo '[center][a href="http://www.carredasclub.com/Consultation?Var=' .$var .'"]Liste DAY 1' .$tabLettres[$i] . '[/a][/center][/br]'; echo '[center][a target=_blank href="http://poker79.easyforumpro.com/t2021-liste-des-joueurs"]Liste des Inscrits[/a][/center][/br]'; } $req -> closeCursor();
// Formulaire Saisie
echo ‘[form style= »border-style:solid;border-width:1px;padding:10px; » id= »formSaisie » method= »post » name= »formulaire » onsubmit= »return verif_champs(this,’ .$nbJour1 .’); » action= »http://www.carredasclub.com/gestion/ »]’;
if ($nbJour1 > 1)
{
echo ‘[strong]Choix du DAY 1 (*)[/strong][br /]’;
for ($j = 0;$j < $nbJour1; $j++)
{
echo '[input type="radio" name="INFOJOUR1" id="INFOJOUR' .$j .'" value="' .$j .'"]' .$jour[$j] .' ' .$mois[$j] .'[/input]';
}
echo '[br /][br /]';
}
echo '[strong]Nom (*)[/strong]';
echo '[br /]';
echo '[input type="text" name="INFONAME" id="INFONAME"/]';
echo '[br /][br /]';
echo '[strong]Prénom (*)[/strong] ';
echo '[br /]';
echo '[input type="text" name="INFOSURNAME" id="INFOSURNAME"/]';
echo '[br /][br /]';
echo '[strong]Né(e) le (*)[/strong] ';
echo '[br /]';
echo '[input style="width:40px;" type="number" min="1" max="31" name="INFODAY" id="INFODAY" maxlength="2"/]';
echo '[input style="width:40px;" type="number" min="1" max="12" name="INFOMONTH" id="INFOMONTH" maxlength="2"/]';
echo '[input style="width:80px;" type="number" min="1900" max="2100" name="INFOYEAR" id="INFOYEAR" maxlength="4"/] [font size=2pt](Format JJ/MM/AAAA)';
echo '[br /]';
echo 'ATTENTION : Vous devez être majeur pour participer.[/font]';
echo '[br /][br /]';
echo '[strong]E-Mail (*)[/strong] ';
echo '[br /]';
echo '[input type="email" name="INFOMAIL" id="INFOMAIL"/]';
echo '[br /][br /]';
echo '[strong]Verification E-Mail (*)[/strong] ';
echo '[br /]';
echo '[input type="email" name="VERIFMAIL" id="VERIFMAIL"/]';
echo '[br /][br /]';
echo '[strong]Ville (*)[/strong] ';
echo '[br /]';
echo '[input type="text" name="INFOTOWN" id="INFOTOWN"/]';
echo '[br /][br /]';
echo '[strong]Plateau Repas (*)[/strong] ';
echo '[br /]';
echo '[input type="radio" name="INFOREPAS" id="INFOREPASO" value="O"/]OUI';
echo '[input type="radio" name="INFOREPAS" id="INFOREPASN" value="N"/]NON';
echo '[br /][br /]';
echo '[strong]Club du Grap[/strong] ';
echo '[br /]';
echo '[select name="INFOCLUB" id="INFOCLUB"]';
echo '[option value=""][/option]';
echo '[option value="Angouleme poker club"]Angouleme poker club[/option]';
echo '[option value="Aunis Poker Tour"]Aunis Poker Tour[/option]';
echo '[option value="Gatine Poker Tour"]Gatine Poker Tour[/option]';
echo '[option value="Kings Poker Club"]Kings Poker Club[/option]';
echo '[option value="Ligue Rochelaise de Poker"]Ligue Rochelaise de Poker[/option]';
echo '[option value="Poitiers Poker Club"]Poitiers Poker Club[/option]';
echo '[option value="Poker Club Grande Champagne"]Poker Club Grande Champagne[/option]';
echo '[option value="Pugny No Limit"]Pugny No Limit[/option]';
echo '[option value="Red Team Poker"]Red Team Poker[/option]';
echo '[option value="Ruffec Poker Club"]Ruffec Poker Club[/option]';
echo '[option value="Saintes Poker Club"]Saintes Poker Club[/option]';
echo '[option value="Vaux Ocean Poker"]Vaux Ocean Poker[/option]';
echo '[option value="Carre d As Club"]Carre d As Club[/option]';
echo '[/select]';
echo '[br /][br /]';
echo '[br /](*) : Champs obligatoires';
echo '[br /][br /]';
echo '[input type="submit" value="Valider" /][input type="reset" value="Effacer"/]';
echo '[/form]';
}
if ($etat==1) // Pas d'inscription
{
echo '[h2]Pas d\'Open en attente d\'inscription[/h2][br/]';
}
echo '[br/][br/][br/][br/]';
echo '[center][a style="color:#3D7283;" target="_blank" href="http://www.carredasclub.com/Open/connexion.php"]Connexion Administrateur[/a][/center]';
[/php]