Files
Eigenwijs-Kinderdagverblijf/src/beheer_ouder.php
T
2026-06-17 11:59:05 +02:00

60 lines
1.6 KiB
PHP

<?php
require('inc_header.php');
if(!$login && $type != 1){
header("Location: login.php?msg=U heeft geen toegang tot deze pagina");
}
$query = "SELECT * FROM ouders ORDER BY actief DESC, achternaam";
$result_temp = mysqli_query($connection, $query);
?>
<!-- Begin van de main content -->
<div id='container'>
<div id='main'>
<header class='h1_banner'><h1>Beheer Ouders</h1></header>
<?php $last_rand = 0; $last_last_rand = 0; while($result = mysqli_fetch_assoc($result_temp)){
$rand = rand(1, 4);
while($rand == $last_rand){
$rand = rand(1,4);
}
if($result['actief']==0){
$rand='5';
}
$ouder_id = $result['id'];
$query2 = "SELECT roepnaam FROM kinderen WHERE ouder_id='$ouder_id'";
$result_temp2 = mysqli_query($connection, $query2);
$aantal = mysqli_num_rows($result_temp2);
$kinderen_n = '';
while($result2 = mysqli_fetch_assoc($result_temp2)){ $kinderen_n .= $result2['roepnaam'] . ", "; }
$kinderen_n = substr( $kinderen_n, 0, -2);
?>
<a href= 'ouderpagina.php?ouder_id=<?php echo $result['id']; ?>' >
<div id='ouder_b' class="nr<?php echo $rand; ?>">
<div id='cont'>
<h1><?php echo $result['voornaam'] . " " . $result['tussenvoegsel'] . " " . $result['achternaam']; ?></h1>
<p>
<?php echo $aantal; ?> Kinderen: <?php echo $kinderen_n; ?>
</p>
</div>
</div>
</a>
<?php $last_rand = $rand; } ?>
</div>
</div>
<!-- Einde van de main content -->
<?php
require('inc_footer.php');
?>