<?php 
session_start();
include '../db.php';
error_reporting(0);
include("../all_query.php");

 if(isset($_SESSION['loan_crm_username']) && isset($_SESSION['loan_crm_password']))
{
	
	
	
	$advisor_id = $_SESSION['loan_crm_userid'];
	$login_name = $_SESSION['login_name'];
	
	 
	
     $newChatQ = mysqli_query($conn,"select *from `messages` where receiver_id = $advisor_id  and  is_read = 0 ");
	 
	 if(mysqli_num_rows($newChatQ) > 0)
	 {
		 echo mysqli_num_rows($newChatQ);
	 }
	 
	  
	  
	  
	  
	
	
 }



?>