true]); } if ($_POST['Mode'] == 'delete_location') { $id = $_POST['id']; mysqli_query($conn, "DELETE FROM delivery_locations WHERE id = $id"); echo json_encode(['success' => true]); } if ($_POST['Mode'] == 'update_location') { $id = $_POST['id']; $country = $_POST['country']; $town = $_POST['town']; $fee = $_POST['delivery_fee']; mysqli_query($conn, "UPDATE delivery_locations SET country='$country', town='$town', delivery_fee='$fee' WHERE id=$id"); echo json_encode(['success' => true]); } ?>