1
0

Ongelezen berichten aangeven

This commit is contained in:
JelmerHinssen 2017-04-02 16:21:02 +02:00
parent 9983c63af3
commit d78ad2abf2
5 changed files with 30 additions and 6 deletions

View File

@ -68,3 +68,15 @@ ul.nv {
color: grey; color: grey;
margin-top: 50px; margin-top: 50px;
} }
.circle {
border-radius: 50%;
color: #000000;
text-align: center;
background: #ffffff;
height: 20px;
width: 20px;
display: table-cell;
text-align: center;
border-radius: 50%;
}

View File

@ -33,8 +33,14 @@ class Berichten
$berichtArray[] = array( $berichtArray[] = array(
"afzender" => $bericht['afzender'], "afzender" => $bericht['afzender'],
"bericht" => $bericht['bericht'], "bericht" => $bericht['bericht'],
"datum" => $datum "datum" => $datum,
"gelezen" => $bericht['gelezen']
); );
if(!$bericht['gelezen']){
$bericht->update([
"gelezen" => true
]);
}
} }
return $berichtArray; return $berichtArray;

View File

@ -26,7 +26,8 @@ class Klant
$db = $container->db; $db = $container->db;
$klant = $db->klanten->where('id', $user)[$user]; $klant = $db->klanten->where('id', $user)[$user];
$ongelezen = $db->berichten->where("klantid", $user)
->and("gelezen", 0);
return array( return array(
'voornaam' => $klant['voornaam'], 'voornaam' => $klant['voornaam'],
'tussenvoegsel' => $klant['tussenvoegsel'], 'tussenvoegsel' => $klant['tussenvoegsel'],
@ -35,7 +36,8 @@ class Klant
'straat' => $klant['straat'], 'straat' => $klant['straat'],
'huisnummer' => $klant['huisnummer'], 'huisnummer' => $klant['huisnummer'],
'postcode' => $klant['postcode'], 'postcode' => $klant['postcode'],
'woonplaats' => $klant['woonplaats'] 'woonplaats' => $klant['woonplaats'],
'ongelezen' => count($ongelezen)
); );
} }
} }

View File

@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8"/> <meta charset="utf-8"/>
<title>Inforbank</title> <title>Inforbank</title>
<link rel="stylesheet" href="<?= $header['base'] ?>/assets/css/main.css"> <link rel="stylesheet" href="<?= $header['base'] ?>assets/css/main.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<base href="<?= $header['base'] ?>"> <base href="<?= $header['base'] ?>">
</head> </head>
@ -26,7 +26,8 @@
<div class="container"> <div class="container">
<ul class="nv"> <ul class="nv">
<li><a href="rekeningen">Rekeningen</a></li> <li><a href="rekeningen">Rekeningen</a></li>
<li><a href="berichten">Berichten</a></li> <li><a href="berichten">Berichten<?php if($header['klant']['ongelezen'] > 0){?>
<span class="circle"><?php echo$header['klant']['ongelezen'];?></span><?php }?></a></li>
</ul> </ul>
</div> </div>
</div> </div>

View File

@ -6,6 +6,9 @@
?> ?>
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<?php if(!$bericht['gelezen']){?>
<span class="label label-info">Nieuw bericht</span>
<?php } ?>
<h3 class="panel-title"><?php echo $bericht['datum'];?></h3> <h3 class="panel-title"><?php echo $bericht['datum'];?></h3>
<small>Afzender: </small><?php echo $bericht['afzender']; ?></div> <small>Afzender: </small><?php echo $bericht['afzender']; ?></div>
<div class="panel-body"> <div class="panel-body">