<?php
include('db_connect.php');

$response= array();
if(isset($_POST['uid']))
{
$uid=$_POST['uid'];
$device_id=$_POST['device_id'];
$latitude=$_POST['latitude'];
$longitude=$_POST['longitude'];
 $is_location_on=$_POST['is_location_on'];
 $is_lock_on=$_POST['is_lock_on'];
 $is_erase_on=$_POST['is_erase_on'];



   
       $updateToken="UPDATE `device_reg` SET `latitude`='$latitude', `longitude`='$longitude', `is_location_on`='$is_location_on', `is_lock_on`='$is_lock_on', `is_erase_on`='$is_erase_on' WHERE `android_id`='$device_id' and uid='$uid'";
       if(mysqli_query($con,$updateToken)){
             $response=array("error"=>"false","message"=>"Logged out","data"=>"null");
           
       }
       else{
            $response=array("error"=>"true","message"=>"error","data"=>"null");
       }
       
      
}else{
               $response=array("error"=>"true","message"=>"error","data"=>"null");
}

echo json_encode($response);
mysqli_close($con);


?>