<?php 
require_once 'core.php';

date_default_timezone_set('Asia/Jakarta'); // set waktu di jakarta

$username = $_SESSION['username'];

$query  = "SELECT * FROM `txmessage_guest` WHERE `ftrecipient_msg` = '$username' AND fnstatus='1'";
$result = mysqli_query($link,$query); 
$count = mysqli_num_rows($result);
if($count > 0 ){$informasi = '<span class="badge badge-danger">'.$count.'</span>';}
?>

<a class="nav-link dropdown-toggle" href="#" Onclick="guest_data()" id="messagesDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-toggle="tooltip" data-placement="bottom" title="Guest Book">

<i class="fas fa-headset" data-toggle="modal" data-target="#guest_chat"></i>
<?=$informasi;?>