82 lines
2.1 KiB
PHP
Executable File
82 lines
2.1 KiB
PHP
Executable File
<?php
|
|
session_start();
|
|
header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"');
|
|
if(isset($_SESSION['Admin']) and $_SESSION['Admin']==1) {
|
|
?>
|
|
<html>
|
|
|
|
<head>
|
|
<meta http-equiv="Content-Language" content="fr">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
|
|
<title>LE SERVEUR VOCAL DE RESERVATION DES SALLES DE TENNIS</title>
|
|
<link rel="stylesheet" href="style.css" type="text/css">
|
|
</head>
|
|
|
|
<body>
|
|
<div id="tout">
|
|
<?php
|
|
include("enTete.php");
|
|
include("menu.php");
|
|
echo "<div id='contenu'>";
|
|
echo "<center><h1>Mise à jour des classements des joueurs</h1></center><br />";
|
|
|
|
include ("fct_nouvjoueur.php");
|
|
|
|
include ("conf.php");
|
|
|
|
$requete="SELECT numero_fft FROM joueur";
|
|
$reponse=mysqli_query($db_connection, $requete) or die ("Erreur no".mysqli_errno($db_connection)()." : ".mysqli_error($db_connection)()."<br>");
|
|
while($joueur=mysqli_fetch_object($reponse)) {
|
|
$numero_fft= $joueur->numero_fft;
|
|
echo "$numero_fft - ";
|
|
$res=verifierLicence($numero_fft);
|
|
if($res==1) {
|
|
$erreur=recup_joueur($numero_fft);
|
|
if($erreur==0) {
|
|
echo " - joueur mis à jour ; <br />";
|
|
}
|
|
else {
|
|
echo " - Erreur lors du transfert des données ; <br />";
|
|
}
|
|
}
|
|
else {
|
|
echo " - Numéro de licence invalide.<br />";
|
|
}
|
|
}
|
|
|
|
echo "<br /><br />";
|
|
|
|
include("deco_admin.php");
|
|
include("piedDePage.php");
|
|
}
|
|
else {
|
|
echo("Non autorisé - Redirection vers la page d'identification dans 2 secondes");
|
|
sleep(2);
|
|
include("admin_login.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;
|
|
}
|
|
|
|
?>
|
|
|