In the header of my application I have notification message icon.
For example, when a new record is inserted into the table, there must appear the notification message to admin, like this:
If I toggle the button it looks like this:
But the problem is that when I click the notification button, it shows the data, but the count of notofications does not reset to zero.
What I need is when I click the notification link, the quantity of notifications should be reset to zero.
it should look like below image
This is my code:
<!-- Messages: style can be found in dropdown.less-->
<li class="dropdown messages-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" id="notify-comet">
<i class="fa fa-envelope-o"></i>
<span class="label label-success" id="not-count">
<?php
$count = Delay::find()
->where(('id') !== 0)
->orderBy('id')
->count();
echo "$count";
?>
</span>
</a>
<ul class="dropdown-menu">
<li class="header">You have <?php echo "$count" ?> messages</li>
<?php
$qry = Delay::find()->all();
foreach ($qry as $key => $value)
{
?>
<div class="delay-notification">
<ul class="menu">
<li><a href="index.php?r=delay"><?php echo $value->claimer_name; ?>   <?php echo $value->company_name; ?></a></li>
</ul>
</div>
<?php
$i = 1;
if ($i++ == 4) break;
}
?>
<li class="footer"><a href="index.php?r=delay">See All Messages</a></li>
</ul>
</li>
<?php
}
?>


