<?php 
require_once '../../../../lib/configuration.inc';

// Vérification si l'accès est valide
if(!isset($_SESSION['SessionADMIN_compte_id'])){
	header('Location: ../../../auth.php');
	exit;
}

// Vérification si l'utilisateur a les droits d'accès
if($_SESSION['SessionADMIN_compte_type']=='utilisateur' AND (in_array(5, $_SESSION['SessionADMIN_compte_acces_modules'])==false OR in_array(7, $_SESSION['SessionADMIN_compte_acces_rubriques'])==false)){
	header('Location: ../../../');
	exit;
}



$requete_scores_extrait = mysqli_query($connexion_mysql, 'SELECT score_id FROM scores A INNER JOIN planning B ON A.planning_id=B.planning_id WHERE B.planning_depart_date="2015-04-25"');
$nb_scores_extrait = mysqli_num_rows($requete_scores_extrait);
if($nb_scores_extrait!=0){
	for($score_extrait_boucle=0; $score_extrait_boucle<$nb_scores_extrait; $score_extrait_boucle++){
		$resultat_score_extrait = mysqli_fetch_array($requete_scores_extrait);
		$score_id = $resultat_score_extrait[0];

		// echo $score_id.'<br>';

		echo 'DELETE FROM scores WHERE score_id="'.$score_id.'<br>"';

		$requete_supp_score_extrait = mysqli_query($connexion_mysql, 'DELETE FROM scores WHERE score_id="'.$score_id.'"');

	}
}

?>