<?php 
include '../db.php';
$type = $_POST['type'];

if($type === "delete_school"){
    $id = $_POST['id'];
    $flgUp=$db->delete("schools","where id='$id' ");
    $flg = $db->delete("users", " where school_id='$id' ");
    if($flgUp){
        echo "Deleted Successfully";
    } else {
        echo "Unable to delete. Please try again.";
    }

}

if($type === "delete_role"){
    $id = $_POST['id'];
    $flgUp=$db->delete("role","where id='$id' ");
    if($flgUp){
        echo "Deleted Successfully";
    } else {
        echo "Unable to delete. Please try again.";
    }

}

if($type === "delete_user"){
    $id = $_POST['id'];
    $flgUp=$db->delete("users","where id='$id' ");
    if($flgUp){
        echo "Deleted Successfully";
    } else {
        echo "Unable to delete. Please try again.";
    }

}


?>