<?php
session_start();
function del_all($id)
{
    global $conn;
    $response = array();
    $query = "SELECT Id FROM TblLocationType WHERE Id='". $id ."' ";
   $deleteQuery= "delete from TblLocationType where UserId=0 and Id=?";
     $rr= getNumber($query);
        if($rr > 0){
            if ($stmt = $conn->prepare($deleteQuery)) {
                $stmt->bind_param("s", $id);
                if ($stmt->execute()) {
                    $response["status"] = 0;
                    $response["message"] = "Deleted";
                } else {
                    $response["status"] = 1;
                    $response["message"] = $stmt->error;
                }
                $stmt->close();
            }
        }
            else {
                $response["status"] = 2;
                $response["message"] = "Record doesn't exist";
       } 
    return $response;
}




