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

	 if(isset($_SESSION['loan_crm_username']) && isset($_SESSION['loan_crm_password']))
	{
		
		
		$login_status = $_REQUEST['login_status'];
		$login_status_type = $_REQUEST['login_status_type'];
		$auto_dial_type = $_REQUEST['auto_dial_type'];
			 
				   $LOGIN_DATA = array();
				   
				 $advisor_id =   $LOGIN_DATA['advisor_id'] = $_SESSION['loan_crm_userid'];
				   $LOGIN_DATA['advisor_name'] = $_SESSION['login_name'];
				   $LOGIN_DATA['apisipid'] = $_SESSION['apisipid'];
				   $LOGIN_DATA['status_date'] = date('Y-m-d');
				   $LOGIN_DATA['status_time'] = date('h:i A');
				   $LOGIN_DATA['login_status'] = $login_status;
				   $LOGIN_DATA['login_status_type'] = $login_status_type;
				   $LOGIN_DATA['auto_dial_type'] = $auto_dial_type;
				   
				   insertTable($conn,'advisor_login_status',$LOGIN_DATA,'add_submit');
				   
				   
				   
				   mysqli_query($conn,"update `advisors` set is_busy_on_call = '', is_pause = '' where id=$advisor_id ");
			
			
				   
				   
				
				 
				 echo "Login Status Updated!";
		
	}


?>