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

	 if(isset($_SESSION['loan_crm_username']) && isset($_SESSION['loan_crm_password']))
	{
		
		 
		   $advisor_id =  $_SESSION['loan_crm_userid'];
		   $advisorQ  = mysqli_query($conn,"select *from `advisors` where id='$advisor_id'  ");
	       $advisorData = mysqli_fetch_assoc($advisorQ);
	   
	   
		   if($advisorData['is_paused'] == '')
		   {
		 
		  mysqli_query($conn,"update `advisors` set is_paused = 'on' where id=$advisor_id ");
		  
		  echo "1";
		  
		  
		   }
		   else
		   {
			   mysqli_query($conn,"update `advisors` set is_paused = '' where id=$advisor_id ");
			   
			   echo "You have started on  call";
			   
		   }
		   
		   
		  
		  
		
	}
	
	?>