false, 'error' => 'Authentication required']); exit; } $usr_id = $_SESSION['user_id']; $notifications = new VNotifications(); $count = $notifications->getUnreadCount($usr_id); echo json_encode([ 'success' => true, 'unread_count' => $count ]);