<?php
// Vérification de version logiciel
$url = '../version.txt';
$vers_offurl = htmlspecialchars(implode('', file($url)));
$vers_offic = substr($vers_offurl, 0, strpos($vers_offurl,"/"));
if($vers_offic > 1.03) {
// Ajout des savoirs 1re APD
// Récupération du fichier
if (($handle = fopen("apd_savoirs.csv", "r")) !== FALSE) {
	while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) {
		$att0 = mysqli_real_escape_string($bdd,$data[0]);
		$att1 = mysqli_real_escape_string($bdd,$data[1]);
		$att2 = mysqli_real_escape_string($bdd,$data[2]);
		$att3 = mysqli_real_escape_string($bdd,$data[3]);
		$att4 = mysqli_real_escape_string($bdd,$data[4]);
		$att5 = mysqli_real_escape_string($bdd,$data[5]);
		
		$sql = "INSERT INTO ".$prefix."_savoirsmaj (s_id, nom_savoir, niveau, champs_id, notions, base) VALUES ('" . $att0 . "', '" . $att1 . "', '" . $att2 . "', '" . $att3 . "', '" . $att4 . "', '" . $att5 . "')";
		mysqli_query($bdd,$sql);
	}
	fclose($handle);
}
// Intégration dans la table _savoirs1 des savoirs pour le niveau 1re
$sql = mysqli_query($bdd,"SELECT * FROM ".$prefix."_savoirsmaj WHERE niveau = '1e'");
while($sql_info=mysqli_fetch_assoc($sql)) {
	$att0 = mysqli_real_escape_string($bdd,$sql_info['s_id']);
	$att1 = mysqli_real_escape_string($bdd,$sql_info['nom_savoir']);
	$att2 = mysqli_real_escape_string($bdd,$sql_info['niveau']);
	$att3 = mysqli_real_escape_string($bdd,$sql_info['champs_id']);
	$att4 = mysqli_real_escape_string($bdd,$sql_info['notions']);
	$att5 = mysqli_real_escape_string($bdd,$sql_info['base']);
	
	$sql_go = "INSERT INTO ".$prefix."_savoirs1 (s1_id, nom_savoir, niveau, champs_id, notions, base) VALUES ('" . $att0 . "', '" . $att1 . "', '" . $att2 . "', '" . $att3 . "', '" . $att4 . "', '" . $att5 . "')";
	mysqli_query($bdd,$sql_go);
}
// Suppression des lignes de la table temporaire preidlog_savoirsmaj
mysqli_query($bdd,"DELETE FROM ".$prefix."_savoirsmaj");

// Changement des savoirs Tale APD
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAE101' WHERE st_id = 'APD1AE101'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAE102' WHERE st_id = 'APD1AE102'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAE103' WHERE st_id = 'APD1AE103'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAE104' WHERE st_id = 'APD1AE104'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAE105' WHERE st_id = 'APD1AE105'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAE106' WHERE st_id = 'APD1AE106'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAE107' WHERE st_id = 'APD1AE107'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAE108' WHERE st_id = 'APD1AE108'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAE109' WHERE st_id = 'APD1AE109'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAE110' WHERE st_id = 'APD1AE110'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAE111' WHERE st_id = 'APD1AE111'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAP201' WHERE st_id = 'APD1AP201'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAP202' WHERE st_id = 'APD1AP202'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAP203' WHERE st_id = 'APD1AP203'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAP204' WHERE st_id = 'APD1AP204'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAP205' WHERE st_id = 'APD1AP205'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAP206' WHERE st_id = 'APD1AP206'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAP207' WHERE st_id = 'APD1AP207'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAP208' WHERE st_id = 'APD1AP208'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAP209' WHERE st_id = 'APD1AP209'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAP210' WHERE st_id = 'APD1AP210'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAP211' WHERE st_id = 'APD1AP211'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAP212' WHERE st_id = 'APD1AP212'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAR301' WHERE st_id = 'APD1AR301'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAR302' WHERE st_id = 'APD1AR302'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAR303' WHERE st_id = 'APD1AR303'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAR304' WHERE st_id = 'APD1AR304'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAR305' WHERE st_id = 'APD1AR305'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAR306' WHERE st_id = 'APD1AR306'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAR307' WHERE st_id = 'APD1AR307'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAR308' WHERE st_id = 'APD1AR308'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAR309' WHERE st_id = 'APD1AR309'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAT401' WHERE st_id = 'APD1AT401'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAT402' WHERE st_id = 'APD1AT402'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAT403' WHERE st_id = 'APD1AT403'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAT404' WHERE st_id = 'APD1AT404'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAT405' WHERE st_id = 'APD1AT405'");
mysqli_query($bdd,"UPDATE ".$prefix."_savoirst SET st_id = 'APDTAT406' WHERE st_id = 'APD1AT406'");

// Changement pour les élèves de Tale avec savoirs APD 1re
$eleves_select = "SELECT * FROM ".$prefix."_eleves eleves
INNER JOIN ".$prefix."_savele savele
ON eleves.eleves_id = savele.eleves_id
WHERE division LIKE 't%' OR division LIKE 'T%'";
$eleves = mysqli_query($bdd,$eleves_select);
while($chsav=mysqli_fetch_assoc($eleves)) {
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAE101' WHERE s_id = 'APD1AE101' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAE102' WHERE s_id = 'APD1AE102' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAE103' WHERE s_id = 'APD1AE103' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAE104' WHERE s_id = 'APD1AE104' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAE105' WHERE s_id = 'APD1AE105' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAE106' WHERE s_id = 'APD1AE106' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAE107' WHERE s_id = 'APD1AE107' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAE108' WHERE s_id = 'APD1AE108' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAE109' WHERE s_id = 'APD1AE109' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAE110' WHERE s_id = 'APD1AE110' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAE111' WHERE s_id = 'APD1AE111' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAP201' WHERE s_id = 'APD1AP201' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAP202' WHERE s_id = 'APD1AP202' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAP203' WHERE s_id = 'APD1AP203' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAP204' WHERE s_id = 'APD1AP204' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAP205' WHERE s_id = 'APD1AP205' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAP206' WHERE s_id = 'APD1AP206' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAP207' WHERE s_id = 'APD1AP207' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAP208' WHERE s_id = 'APD1AP208' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAP209' WHERE s_id = 'APD1AP209' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAP210' WHERE s_id = 'APD1AP210' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAP211' WHERE s_id = 'APD1AP211' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAP212' WHERE s_id = 'APD1AP212' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAR301' WHERE s_id = 'APD1AR301' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAR302' WHERE s_id = 'APD1AR302' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAR303' WHERE s_id = 'APD1AR303' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAR304' WHERE s_id = 'APD1AR304' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAR305' WHERE s_id = 'APD1AR305' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAR306' WHERE s_id = 'APD1AR306' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAR307' WHERE s_id = 'APD1AR307' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAR308' WHERE s_id = 'APD1AR308' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAR309' WHERE s_id = 'APD1AR309' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAT401' WHERE s_id = 'APD1AT401' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAT402' WHERE s_id = 'APD1AT402' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAT403' WHERE s_id = 'APD1AT403' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAT404' WHERE s_id = 'APD1AT404' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAT405' WHERE s_id = 'APD1AT405' AND eleves_id = '".$chsav['eleves_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_savele SET s_id = 'APDTAT406' WHERE s_id = 'APD1AT406' AND eleves_id = '".$chsav['eleves_id']."'");	
}

// Changement pour les séquences de Tale avec savoirs APD 1re
$seq_select = "SELECT * FROM ".$prefix."_sequences sequences
INNER JOIN ".$prefix."_seqsav seqsav
ON sequences.seq_id = seqsav.seq_id
WHERE niveau LIKE 't%' OR niveau LIKE 'T%'";
$seq = mysqli_query($bdd,$seq_select);
while($chseq=mysqli_fetch_assoc($seq)) {
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAE101' WHERE s_id = 'APD1AE101' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAE102' WHERE s_id = 'APD1AE102' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAE103' WHERE s_id = 'APD1AE103' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAE104' WHERE s_id = 'APD1AE104' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAE105' WHERE s_id = 'APD1AE105' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAE106' WHERE s_id = 'APD1AE106' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAE107' WHERE s_id = 'APD1AE107' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAE108' WHERE s_id = 'APD1AE108' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAE109' WHERE s_id = 'APD1AE109' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAE110' WHERE s_id = 'APD1AE110' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAE111' WHERE s_id = 'APD1AE111' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAP201' WHERE s_id = 'APD1AP201' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAP202' WHERE s_id = 'APD1AP202' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAP203' WHERE s_id = 'APD1AP203' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAP204' WHERE s_id = 'APD1AP204' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAP205' WHERE s_id = 'APD1AP205' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAP206' WHERE s_id = 'APD1AP206' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAP207' WHERE s_id = 'APD1AP207' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAP208' WHERE s_id = 'APD1AP208' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAP209' WHERE s_id = 'APD1AP209' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAP210' WHERE s_id = 'APD1AP210' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAP211' WHERE s_id = 'APD1AP211' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAP212' WHERE s_id = 'APD1AP212' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAR301' WHERE s_id = 'APD1AR301' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAR302' WHERE s_id = 'APD1AR302' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAR303' WHERE s_id = 'APD1AR303' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAR304' WHERE s_id = 'APD1AR304' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAR305' WHERE s_id = 'APD1AR305' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAR306' WHERE s_id = 'APD1AR306' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAR307' WHERE s_id = 'APD1AR307' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAR308' WHERE s_id = 'APD1AR308' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAR309' WHERE s_id = 'APD1AR309' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAT401' WHERE s_id = 'APD1AT401' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAT402' WHERE s_id = 'APD1AT402' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAT403' WHERE s_id = 'APD1AT403' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAT404' WHERE s_id = 'APD1AT404' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAT405' WHERE s_id = 'APD1AT405' AND seq_id = '".$chseq['seq_id']."'");
	mysqli_query($bdd,"UPDATE ".$prefix."_seqsav SET s_id = 'APDTAT406' WHERE s_id = 'APD1AT406' AND seq_id = '".$chseq['seq_id']."'");	
}
// version bdd :
mysqli_query($bdd,"UPDATE ".$prefix."_parametres SET valeur = '0.18' WHERE param_nom = 'version_bdd'");
}
else {
echo '<script>alert("Vous devez installer au moins la version 1.04 d\'InfodocLog pour cette mise à jour.");</script>';
}
?>