<?php
// Suppression du fichier /db/proc/func_suggestion.php
$ouverture = opendir("/proc/");
$lecture = readdir($ouverture);
unlink ("/proc/func_suggestion.php");
closedir($ouverture);
// Suppression du fichier /db/maj_fin.php
$ouverture = opendir("/");
$lecture = readdir($ouverture);
unlink ("maj_fin.php");
closedir($ouverture);
// Suppression du fichier /img/nav/menuEval03.png
$ouverture = opendir("../img/nav/");
$lecture = readdir($ouverture);
unlink ("../img/nav/menuEval03.png");
closedir($ouverture);
// Suppression du fichier /contenu/eval_impexp.php
$ouverture = opendir("../contenu/");
$lecture = readdir($ouverture);
unlink ("../contenu/eval_impexp.php");
closedir($ouverture);
// suppression de la table ".$prefix."_edteleve
$edteleve_drop = "DROP TABLE ".$prefix."_edteleve";
mysqli_query($bdd,$edteleve_drop);
// création de la table ".$prefix."_seqeleves
$seqeleve_create = "CREATE TABLE IF NOT EXISTS ".$base.".".$prefix."_seqeleves (eleves_id INT( 11 ) NOT NULL , seq_id INT( 11 ) NOT NULL ) ENGINE = MYISAM DEFAULT CHARSET = utf8;";
mysqli_query($bdd,$seqeleve_create);
// paramètres degrés d'évaluation :
$verif_select = "SELECT * FROM ".$prefix."_parametres WHERE param_nom = 'eval_degres'";
$verif = mysqli_query($bdd,$verif_select);
$verif_nb = mysqli_num_rows($verif);
if($verif_nb==0) {
	$evdegres = "INSERT INTO ".$prefix."_parametres (param_nom, valeur, comments) VALUES ('eval_degres', '4', 'Choix du nombre de degrés d''évaluation, à trois ou quatre.')";
	mysqli_query($bdd,$evdegres);
}
// passage des évaluations 3 vers évaluations 4
$evaltest_select = "SELECT eval FROM ".$prefix."_savele WHERE eval = '4'";
$evaltest = mysqli_query($bdd,$evaltest_select);
$evaltest_nb = mysqli_num_rows($evaltest);
if($evaltest_nb==0) {
	$eval_update = "UPDATE ".$prefix."_savele SET eval = '4' WHERE eval = '3'";
	mysqli_query($bdd,$eval_update);
}
// version bdd :
$versbdd_up = "UPDATE ".$prefix."_parametres SET valeur = '0.12' WHERE param_nom = 'version_bdd'";
mysqli_query($bdd,$versbdd_up);
?>