<?php
ob_start();
include("../connect.php");
$response = array();
if(isset($_POST['user_id']) && isset($_POST['user_type']))
{	
    $temp_uid=$_POST['user_id'];
	$user_type=$_POST['user_type'];
	 
	if($user_type!='')
	{
	   if($user_type=='Admin')
	   {
		 $update_qry=mysqli_query($con,"UPDATE `tbl_distributor_users` SET imei_no='', carrier_name='', ip_address='', app_login='', device_id='' WHERE distributor_user_id='$temp_uid'");   
	   }
	   else 
	   {
	     $update_qry=mysqli_query($con,"update tbl_master_customer SET imei_no='', ip_address='', carrier_name='' WHERE customer_id='$temp_uid'");
	   }
	}	
	if($update_qry)
	{
		$response['success']=1;	
		$response['details']=$user_type." Logout Successfully!";
	}
	else
	{
		$response['success']=0;	
		$response['details']="Data Fail"; 
	}
}
else
{	
	$response['success']=0;
	$response['details']="Required fields missing";
}
echo json_encode($response);
?> 