query($query); // Display all documents information // Fini le div et met le bouton uniquement // quand on finit d'itérer un ensemble donné $ens_id = -1; while($row = $result->fetch_assoc()) { if (($row["ensemble_id"] != $ens_id) && ($ens_id != -1) ) { echo "
"; echo ""; echo ""; $ens_id = $row["ensemble_id"]; } // initialisation pour la première itération if ($ens_id == -1){ $ens_id = $row["ensemble_id"]; } echo "Type: {$row['type']}
"; echo "Upload Path: {$row['upload_path']}
"; echo "Ensemble ID: {$row['ensemble_id']}
"; $extension = pathinfo($row['upload_path'], PATHINFO_EXTENSION); if (strtolower($extension) === 'pdf'): echo ""; elseif (in_array(strtolower($extension), ['jpg', 'jpeg', 'png', 'gif'])): echo ""; elseif (strtolower($extension) == "html"): echo(""); else: echo "Unsupported file type
".$row['upload_path']; endif; echo "Theme ID: {$row['theme_id']}
"; } // complète le formulaire du dernier ensemble itéré echo ""; echo ""; echo "