
<?php
//FINISHED
function upd_locationtype($UserId,$location)
{
    global $conn;
    $response = array();

    $UserId = mysqli_real_escape_string($conn, $UserId);
    $location = mysqli_real_escape_string($conn, $location);

        $updateQuery  = "update TblLocationType set Locations='".$location ."' where Id='". $UserId."';";
        if ($stmt = $conn->prepare($updateQuery))
        {
            // $stmt->bind_param("s", $UserId);
            $stmt->execute();
            $response["status"] = 0;
            $response["message"] = "Updated";
            $stmt->close();
        }
  
    else {
        $response["status"] = 1;
        $response["message"] = "Record doesn't exists";
        }
    return $response;
}

function upd_Person($id,$Name,$No,$Division)
{
    global $conn;
    $response = array();

    $UserId = mysqli_real_escape_string($conn, $UserId);
    $location = mysqli_real_escape_string($conn, $location);

        $updateQuery  = "update TblPersonal set Name='".$Name ."',No='".$No ."',Division='".$Division ."' where PersonalId ='". $id."';";
        if ($stmt = $conn->prepare($updateQuery))
        {
            // $stmt->bind_param("s", $UserId);
            $stmt->execute();
            $response["status"] = 0;
            $response["message"] = "Updated";
            $stmt->close();
        }
  
    else {
        $response["status"] = 1;
        $response["message"] = "Record doesn't exists";
        }
    return $response;
}