
<?php
include 'include/db.php';

//$_SERVER['HTTP_REFERER'];

$id=$_REQUEST['id'];
$slt_status="select active_status from registration where unique_user_id='$id' ";
$con2=mysqli_query($conn,$slt_status);
if(mysqli_num_rows($con2)>0)
{
    while($rr=mysqli_fetch_array($con2))
    {
        $status_fetch=$rr['active_status'];
    }
}
if($status_fetch=='Active')
{
    $status='Deactive';
}
else
{
    $status='Active';
}
$query="update registration set active_status='$status' where unique_user_id='$id' ";
$connection=mysqli_query($conn,$query);
if($connection)
{
    echo $status;
}
else
{
    echo 'Not change';
}

?>