<commit_before><?php 

require('config/config.php');

if ($_SERVER["REQUEST_METHOD"] == "GET") {


    if (isset($_GET['id'])) {

        $results = array();

        // If an ID is sent, retreive that safari's details and return them.
        $stmt = $db_conn->prepare("SELECT * FROM SAFARI_WAYPOINTS WHERE SAFARI_ID = ?");
        $stmt->bind_param('i', $_GET['id']);
        $stmt->execute();
        $stmt->bind_result($waypoint_id, $sequence, $latitude, $longitude, $safari_id);
        while ($stmt->fetch()) {
            $results["results"]["waypoints"][] = array(
                "id" => $waypoint_id,
                "sequence" => $sequence,
                "latitude" => $latitude,
                "longitude" => $longitude,
                "safari_id" => $safari_id,
            );
        }
        $stmt->close();

        $stmt = $db_conn->prepare("SELECT id, name, latitude, longitude, radius FROM SAFARI_POINTS_OF_INTEREST WHERE SAFARI_ID = ?");
        $stmt->bind_param('i', $_GET['id']);
        $stmt->execute();
        $stmt->bind_result($poi_id, $name, $latitude, $longitude, $radius);
        while ($stmt->fetch()) {
            $results["results"]["points_of_interest"][] = array(
                "id" => $poi_id,
                "name" => $name,
                "latitude" => $latitude,
                "longitude" => $longitude,
                "radius" => $radius,
            );
        }
        $stmt->close();

        echo json_encode($results);
    }

}
?><commit_msg>Modifiied safaridetails.php to return points of interest for a safari.<commit_after><?php 

require('config/config.php');

if ($_SERVER["REQUEST_METHOD"] == "GET") {


    if (isset($_GET['id'])) {

        $results = array();

        // If an ID is sent, retreive that safari's details and return them.
        $stmt = $db_conn->prepare("SELECT * FROM SAFARI_WAYPOINTS WHERE SAFARI_ID = ?");
        $stmt->bind_param('i', $_GET['id']);
        $stmt->execute();
        $stmt->bind_result($waypoint_id, $sequence, $latitude, $longitude, $safari_id);
        while ($stmt->fetch()) {
            $results["results"]["waypoints"][] = array(
                "id" => $waypoint_id,
                "sequence" => $sequence,
                "latitude" => $latitude,
                "longitude" => $longitude,
                "safari_id" => $safari_id,
            );
        }
        $stmt->close();

        $stmt = $db_conn->prepare("SELECT id, name, latitude, longitude, radius, safari_id FROM SAFARI_POINTS_OF_INTEREST WHERE SAFARI_ID = ?");
        $stmt->bind_param('i', $_GET['id']);
        $stmt->execute();
        $stmt->bind_result($poi_id, $name, $latitude, $longitude, $radius, $safari_id);
        while ($stmt->fetch()) {
            $results["results"]["points_of_interest"][] = array(
                "id" => $poi_id,
                "name" => $name,
                "latitude" => $latitude,
                "longitude" => $longitude,
                "radius" => $radius,
                "safari_id" => $safari_id
            );
        }
        $stmt->close();

        echo json_encode($results);
    }

}
?>
{'fraction_non_alphanumeric': 0.17635782747603834, 'fraction_numerical': 0.0, 'mean_word_length': 2.0486854917234663, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 50, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '772930', 'n_tokens_mistral': 1012, 'n_tokens_neox': 986, 'n_words': 185}