<?php
    session_start();
    include '../config.php'; 
    $id = $_POST['user'];
    $method = $_POST['method'];
    if($method == 1)
    {
        $sql_stmt = "DELETE FROM user_master where id = $id ";
        if ($con->query($sql_stmt) === TRUE)
        {
            $error = "User Deleted Successfully!!!";   
        }                    
        else
        {
            $error = "Some Error Occured".  $con->error;
        }
        echo $error; 
    } 
    if($method == 2)
    {
        $sql_stmt = "DELETE FROM company_master where id = $id ";
        $sql_stmt2 = "DELETE FROM user_master where company_code = $id ";
        if ($con->query($sql_stmt) === TRUE && $con->query($sql_stmt2))
        {
            $error = "Company Deleted Successfully!!!";   
        }                    
        else
        {
            $error = "Some Error Occured".  $con->error;
        }
        echo $error; 
    }
?>