<?php
    include'connection.php';
    
    $inpid = $_GET['inpid'];
    
    if($_GET['sellerId'])
    {   
        $sellerId = $_GET['sellerId'];
        $update="UPDATE Seller SET Status='Deactive' WHERE Id='$sellerId'";
        if(mysqli_query($con,$update))
        {
            echo "<i class='fa fa-ban' style='color:red;' onclick='unblockUsr(".$inpid.")'></i>";
        }
    }
    elseif($_GET['usrId'])
    {
        $usrId = $_GET['usrId'];
        $usrIdType=substr($usrId,0,2);
        if($usrIdType==50)
        {
            $tableType="retailer";
            $update="UPDATE $tableType SET Active='1' WHERE Userid='$usrId'";
        }
        elseif($usrIdType==20)
        {
            $tableType="distributer";
            $update="UPDATE $tableType SET Status='DEACTIVE' WHERE Userid='$usrId'";
        }
        
        if(mysqli_query($con,$update))
        {
            echo "<i class='fa fa-ban' style='color:red;' onclick='unblockUsr(".$inpid.")'></i>";
        }
    }
?>