126 lines
3.7 KiB
PHP
Executable File
126 lines
3.7 KiB
PHP
Executable File
<?php
|
|
include_once ("conf.php");
|
|
|
|
/* recup de l'id du nouveau joueur */
|
|
$numero_fft=$_POST['numero_fft'];
|
|
|
|
$requete="SELECT * FROM joueur WHERE numero_fft='$numero_fft'";
|
|
$reponse=mysql_query($requete,$db_connection);
|
|
$existe=mysql_num_rows($reponse);
|
|
// si la personne a une licence valide à la fédé
|
|
if(! verifierLicence($numero_fft))
|
|
{
|
|
include("enTete.php");
|
|
echo"<body background='images/balle_raquette3.jpg'> ";
|
|
echo "<center>";
|
|
$erreur="Vous n'avez pas de licence à la fédération française de tennis";
|
|
include ("nouveau.php");
|
|
}
|
|
// Si le joueur est déja inscrit sur le site
|
|
else if($existe > 0)
|
|
{
|
|
$titre="Modification de votre e-mail et numéro de téléphone";
|
|
include("enTete.php");
|
|
echo"<body background='images/balle_raquette3.jpg'> ";
|
|
echo "<center>";
|
|
include("modif_email_suite.php");
|
|
}
|
|
else
|
|
{
|
|
$titre="Inscription d'un nouveau joueur";
|
|
include("enTete.php");
|
|
echo"<body background='images/balle_raquette3.jpg'> ";
|
|
echo "<center>";
|
|
//include("http://www.fft.fr/bdd/recherche_licencies/liste_licencies.asp?NOM=$nom2&PRENOM=&LICENCE=$numero_fft&NUMERO_CLUB=&image.x=5&image.y=4");
|
|
echo "</center>";
|
|
?>
|
|
<p>
|
|
Veuillez saisir vos informations personnelles pour vous inscrire sur le site.<br />
|
|
Ces informations peuvent être modifiées en vous connectant sur votre espace personnel.
|
|
</p>
|
|
<p>
|
|
<form action="nouveau_suite3.php" method="POST">
|
|
<center>
|
|
<table width="70%">
|
|
<tr>
|
|
<td>Nom :</td>
|
|
<td><input type='text' name='nom' size='25' maxlength='30'></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Prénom :</td>
|
|
<td><input type='text' name='prenom' size='25' maxlength='30'></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Sexe :</td>
|
|
<td><select name='sexe'>
|
|
<option value="f">Femme</option>
|
|
<option value="m">Homme</option>
|
|
</select></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Classement actuel :</td>
|
|
<td><select name='classement'>
|
|
<?php
|
|
$sql = "SELECT * FROM classement ORDER BY id_classement ASC";
|
|
$reponse=mysql_query($sql,$db_connection);
|
|
while($res = mysql_fetch_object($reponse))
|
|
{
|
|
echo "<option value='$res->intitule'>$res->intitule</option>";
|
|
}
|
|
mysql_free_result($reponse);
|
|
?>
|
|
</select></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Année de naîssance :</td>
|
|
<td><input type='text' name='annee' size='6' maxlength='4'></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Numéro de département de votre club :</td>
|
|
<td><input type='text' name='departement' size='3' maxlength='2'></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Téléphone fixe:</td>
|
|
<td><input type='text' name='fixe' size='10' maxlength='10'><strong>(sans espaces)</strong></td>
|
|
</tr>
|
|
<tr>
|
|
<td width="25%">Téléphone portable :</td>
|
|
<td><input type='text' name='portable' size='14' maxlength='10' /><strong>(sans espaces)</strong></td>
|
|
<?php
|
|
echo "<td><input type='hidden' name='num_fft' value='$numero_fft' /></td>";
|
|
?>
|
|
</tr>
|
|
<tr>
|
|
<td>E-mail:</td>
|
|
<td><input type='text' name='e_mail' size='45' maxlength='45' />Cette adresse vous permettra de vous connecter au site, elle nous permettra également de communiquer avec vous.</td>
|
|
</tr>
|
|
</table>
|
|
<input type='submit' VALUE='Continuer' />
|
|
<input type='reset' VALUE='Annuler' />
|
|
</center>
|
|
</form>
|
|
<?php
|
|
include("piedDePage.php");
|
|
}
|
|
/* fonction de controle de format de la licence FFT */
|
|
function verifierLicence($numero_fft){
|
|
$numero=0;
|
|
$res=1;
|
|
// controle de la licence si le numero de licence est valide (1234567K par ex,)
|
|
if(is_numeric($numero_fft[0])) {
|
|
for($i=0;$i<7;$i++){$numero=$numero+($numero_fft[$i]* pow (10,(6-$i)));}
|
|
$cle=$numero_fft[7];
|
|
$tab_lettres=array("A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z");
|
|
$mod=($numero % 23);
|
|
if ($mod==0){$mod=23;}
|
|
if(strtoupper($cle)!=$tab_lettres[$mod-1]){
|
|
$res=0;
|
|
}
|
|
}
|
|
else {
|
|
$res=0;
|
|
}
|
|
return $res;
|
|
}
|
|
?>
|