archinsa/ens.php

47 lines
1.3 KiB
PHP
Raw Normal View History

2023-12-23 21:42:28 +01:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ensemble de documents</title>
</head>
<body>
</body>
<script>
/*
pour les docs afficher un truc du même acabit que la php :
if (strtolower($extension) === 'pdf'):
echo "<embed src=\"{$doc['upload_path']}\" type=\"application/pdf\" width=\"100%\" height=\"600px\" />";
elseif (in_array(strtolower($extension), ['jpg', 'jpeg', 'png', 'gif'])):
echo "<img src=\"{$doc['upload_path']}\">";
else:
echo "<p>Oups ! Je ne sais pas afficher ce document :/ (Rales autant que tu veux je men fous) </p>".$doc['upload_path'];
endif;
*/
// fetch l'api et afficher tout ce qu'elle nous rend
function querystring(key) {
var re=new RegExp('(?:\\?|&)'+key+'=(.*?)(?=&|$)','gi');
var r=[], m;
while ((m=re.exec(document.location.search)) != null) r[r.length]=m[1];
return r;
}
2023-12-23 21:42:28 +01:00
async function gen_contenu(){
resp = await fetch("/annales/api.php/decomposer_ensemble?ensemble_id="+querystring("ensemble_id"));
data = await resp.json();
2023-12-23 21:42:28 +01:00
if(data["status"] == 1){
console.log(data);
}
2023-12-23 21:42:28 +01:00
}
2023-12-23 21:42:28 +01:00
</script>
</html>