Current directory: /home/klas4s23/domains/585455.klas4s23.mid-ica.nl/public_html/Gastenboek/uploads
<!doctype html>
<html lang="nl">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Welkom op het het Media ICT & Design College - Amersfoort</title>
<style>
html, body {
margin: 0;
box-sizing: border-box;
overflow: hidden;
font-family: Arial;
}
.flex-container {
padding: 0;
margin: 0;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
flex-direction: column;
}
.flex-item {
display: flex;
align-items: center;
justify-content: center;
font-size: 2rem;
}
img#logo {
width: 40%;
}
</style>
</head>
<body>
<div class="flex-container">
<div class="row">
<span class="flex-item"><img id="logo"></span>
</div>
<div class="row">
<span class="flex-item">Welkom op de website van student</span>
</div>
<div class="row">
<span class="flex-item" id="student">student</span>
</div>
<div class="row">
<span class="flex-item" style="font-size: 1rem;">Binnenkort kun je hier meer informatie vinden....</span>
</div>
</div>
<script>
let student=null;
document.addEventListener("DOMContentLoaded",function() {
let h = window.location.host
let pat = '^[0-9]*';
let nr = h.match(pat)[0];
let url = `https://klassenweb.mid-ica.nl/students/get/api?search=${nr}`;
fetch(url).then(function(response) {
return response.json();
}).then(function (data) {
student = (data.students[0]);
document.getElementById("student").innerText = `${student.firstname} ${student.middlename} ${student.lastname}`;
//document.getElementById("logo").setAttribute("src",`https://${student.vps_domain}/images/logo_mid_college_cutout.png`);
}).catch(function(error) {
document.getElementById("student").innerText = `${nr}`;
}).finally(function() {
document.getElementById("logo").setAttribute("src",`images/logo_mid_college_cutout.png`);
});
});
</script>
</body>
</html>