<?php
while($seqs_liste = mysqli_fetch_assoc($seqs)) {
	$filename = 'xml/'.$prefix.'/idlog-'.$seqs_liste['niveau'].'e-'.$seqs_liste['seq_nom'].'.xml';
	echo '<p style="display:inline;">&bull; ';
	if($seqs_liste['progression'] != '1000') { echo '<b>'.$seqs_liste['progression'].'.</b> '; }
	echo '<a href="edit.php?page=consult&seq_id='.$seqs_liste['seq_id'].'">'.$seqs_liste['seq_nom'].'</a>';
	if($seqs_liste['date_maj']=='0000-00-00'||$seqs_liste['date_maj']=='') {
		echo ' ('.$seqs_liste['date_crea'].')';
	}
	else { echo ' ('.$seqs_liste['date_maj'].')'; }
	if (file_exists($filename)) {
		echo '&nbsp; <form style="display:inline;" method="POST" name="xmlrec'.$seqs_liste['seq_id'].'" action=""><input type="hidden" name="seq_id'.$seqs_liste['seq_id'].'" value="'.$seqs_liste['seq_id'].'" /><input type="hidden" name="supprxml'.$seqs_liste['seq_id'].'" value="xml/'.$prefix.'/idlog-'.$seqs_liste['niveau'].'e-'.$seqs_liste['seq_nom'].'.xml"><input class="bouton boutontab" type="submit" value="XML '.FROM2.' '.date('d-m-Y',filemtime($filename)).EDIT_BUTTON3.'" name="reexport" /></form>';
		echo '&nbsp; <a href="xml/'.$prefix.'/idlog-'.$seqs_liste['niveau'].'e-'.$seqs_liste['seq_nom'].'.xml" download="'.$seqs_liste['niveau'].'e-'.$seqs_liste['seq_nom'].'.xml"><input class="bouton boutontab" type="submit" value="'.EDIT_BUTTON4.'" name="export" /></a><br><br>';
	}
	else {
		echo '<form style="display:inline;" method="POST" name="xmlc'.$seqs_liste['seq_id'].'" action="">&nbsp; <input type="hidden" name="seq_id'.$seqs_liste['seq_id'].'" value="'.$seqs_liste['seq_id'].'" /><input class="bouton boutontab" type="submit" name="xmlc'.$seqs_liste['seq_id'].'" value="'.EDIT_BUTTON5.'" /></form>';
	}
	echo '</p>';
	//Re-Création XML
	if(isset($_POST['supprxml'.$seqs_liste['seq_id'].''])) {
		$pathinfo="creation";
		// Suppression du fichier précédent :
		$ouverture = opendir("./xml/");
		$lecture = readdir($ouverture);
		$filename = './'.$_POST['supprxml'.$seqs_liste['seq_id']];
		if (file_exists($filename)) {
			unlink ('./'.$_POST['supprxml'.$seqs_liste['seq_id']]);
		}
		// Recréation
		$seq_id=$_POST['seq_id'.$seqs_liste['seq_id'].''];
		include('db/proc/edit_xml_create.php');
		echo '<script language="Javascript">
		<!--
		document.location.replace("edit.php?page=impexp");
		// -->
		</script>';
	}
	//Création XML
	if(isset($_POST['xmlc'.$seqs_liste['seq_id'].''])) {
		$pathinfo="creation";
		$seq_id=$_POST['seq_id'.$seqs_liste['seq_id'].''];
		include('db/proc/edit_xml_create.php');
		echo '<script language="Javascript">
		<!--
		document.location.replace("edit.php?page=impexp");
		// -->
		</script>';
	}
}
?>
