gymrooster_php/templates/dashboard.html.php

35 lines
1.2 KiB
PHP

<?php require __DIR__ . '/../php/dashboard.php' ?>
<header>
<h1>Gymrooster</h1>
<h3>Welkom <?=$docent['naam']?></h3>
<h3><?=date("D d M Y", strtotime($date))?></h3>
<a href="/dashboard?date=<?=date("Y-m-d", strtotime("-1 day", strtotime($date)))?>">&lt;&nbsp;Dag eerder</a>
<a href="/dashboard?date=<?=date("Y-m-d", strtotime("+1 day", strtotime($date)))?>">Dag later&nbsp;&gt;</a>
</header>
<form id="submitForm" action="update?date=<?=$date?>&docent=<?=$docent['id']?>" method="post">
<textarea name="opmerking" placeholder="Opmerkingen"><?=$rooster['opmerking']?></textarea><br>
<select name="locatie">
<?php if ($rooster['locatie'] === "1"): ?>
<option value="1">Binnen</option>
<option value="2">Buiten</option>
<?php else: ?>
<option value="2">Buiten</option>
<option value="1">Binnen</option>
<?php endif; ?>
</select>
<button type="submit">Opslaan</button>
</form>
<a href="/delete?date=<?=$date?>&docent=<?=$docent['id']?>">
Verwijder record in de database
</a>
<script>
document.getElementById('submitForm').addEventListener('submit', function(e) {
document.querySelectorAll('#submitForm button')[0].innerHTML = "✓ Opgeslagen";
});
</script>