<commit_before><?php
/*
@author <NAME>
*/

/*
This file is used to query all the needed filter-functions from the classes spatialFilter, timeFilter and filteroptions.
*/

require("filter/filteroptions.php"); 
require("filter/spatialFilter.php"); 
require("filter/timeFilter.php"); 

// create the objects we need for the functions
$filteroptions = new filteroptions();
$spatialFilter = new spatialFilter();
$timeFilter = new timeFilter();


/*
###############################
### FILTEROPTIONS functions ###
###############################
Have a look at filteroptions.php for function details!
*/

// getTrackID
if ($_GET["f"] == "getTrackID"){
	$jsonTracks = $_GET["jsonTracks"];
	$poiID = $_GET["poiID"];
    echo $filteroptions -> getTrackID($jsonTracks, $poiID);
}

// createTrackFromID
if ($_GET["f"] == "createTrackFromID"){
	$trackID = $_GET["trackID"];
	$encoded = $_GET["encoded"];
    echo $filteroptions -> createTrackFromID($trackID, $encoded);
}

// createFilterTracks
if ($_GET["f"] == "createFilterTracks"){
    $filterURL = $_GET["filterurl"];
    echo $filteroptions -> createFilterTracks($filterURL);
}

// getFullTrack
if ($_GET["f"] == "getFullTrack"){
	$jsonTracks = $_GET["jsonTracks"];
	$poiID = $_GET["poiID"];
    echo $filteroptions -> getFullTrack($jsonTracks, $poiID);
}

// getSelectedTrack
if ($_GET["f"] == "getSelectedTrack"){
	$jsonTracks = $_GET["jsonTracks"];
	$poiID = $_GET["poiID"];
    echo $filteroptions -> getSelectedTrack($jsonTracks, $poiID);
}

/*
###############################
### SPATIALFILTER functions ###
###############################
Have a look at spatialFilter.php for function details!
*/

// runSpatialFilter
if ($_GET["f"] == "runSpatialFilter"){
	$jsonTracks = $_GET["jsonTracks"];
	$polygon = $_GET["polygon"];
    echo $spatialFilter -> runSpatialFilter($jsonTracks, $polygon);
}

// getBBox
if ($_GET["f"] == "getBBox"){
	$polygon = $_GET["polygon"];
    echo $spatialFilter -> getBBox($polygon);
}

// createBBoxURLfromPolygon
if ($_GET["f"] == "createBBoxURLfromPolygon"){
	$polygon = $_GET["polygon"];
	if(isset($_GET["limit"])){
		$limit = $_GET["limit"];
		echo $spatialFilter -> createBBoxURLfromPolygon($polygon, $limit);
	} else {
		echo $spatialFilter -> createBBoxURLfromPolygon($polygon);
	}
}

/*
###############################
###   TIMEFILTER functions  ###
###############################
Have a look at timeFilter.php for function details!
*/

// createTimestamp
if ($_GET["f"] == "createTimestamp"){
	$timeString = $_GET["timeString"];
    echo $timeFilter -> createTimestamp($timeString);
}

// getWeekday
if ($_GET["f"] == "getWeekday"){
	$timeString = $_GET["timeString"];
    echo $timeFilter -> getWeekday($timeString);
}

// checkDay
if ($_GET["f"] == "checkDay"){
	$timeString = $_GET["timeString"];
	$weekday = $_GET["weekday"];
    echo $timeFilter -> checkDay($timeString, $weekday);
}

// runTimeFilter
if ($_GET["f"] == "runTimeFilter"){
	$jsonTracks = $_GET["jsonTracks"];
	$starttime = $_GET["starttime"];
	$endtime = $_GET["endtime"];
	if(isset($_GET["weekday"])){
		$weekday = $_GET["weekday"];
		echo $timeFilter -> runTimeFilter($jsonTracks, $starttime, $endtime, $weekday);
	} else {
		echo $timeFilter -> runTimeFilter($jsonTracks, $starttime, $endtime);
	}
}

// getTimeintervalURL
if ($_GET["f"] == "getTimeintervalURL"){
	$starttime = $_GET["starttime"];
	$endtime = $_GET["endtime"];
	if(isset($_GET["limit"])){
		$limit = $_GET["limit"];
		echo $timeFilter -> getTimeintervalURL($starttime, $endtime, $limit);
	} else {
		echo $timeFilter -> getTimeintervalURL($starttime, $endtime);
	}
}

// The function does not exist!
else{
	echo "The function (f) does not exist!";
}


?><commit_msg>Changed method from GET to POST<commit_after><?php
/*
@author <NAME>
*/

/*
This file is used to query all the needed filter-functions from the classes spatialFilter, timeFilter and filteroptions.
*/

require("filter/filteroptions.php"); 
require("filter/spatialFilter.php"); 
require("filter/timeFilter.php"); 

// create the objects we need for the functions
$filteroptions = new filteroptions();
$spatialFilter = new spatialFilter();
$timeFilter = new timeFilter();


/*
###############################
### FILTEROPTIONS functions ###
###############################
Have a look at filteroptions.php for function details!
*/

// getTrackID
if ($_POST["f"] == "getTrackID"){
	$jsonTracks = $_POST["jsonTracks"];
	$poiID = $_POST["poiID"];
    echo $filteroptions -> getTrackID($jsonTracks, $poiID);
}

// createTrackFromID
if ($_POST["f"] == "createTrackFromID"){
	$trackID = $_POST["trackID"];
	$encoded = $_POST["encoded"];
    echo $filteroptions -> createTrackFromID($trackID, $encoded);
}

// createFilterTracks
if ($_POST["f"] == "createFilterTracks"){
    $filterURL = $_POST["filterurl"];
    echo $filteroptions -> createFilterTracks($filterURL);
}

// getFullTrack
if ($_POST["f"] == "getFullTrack"){
	$jsonTracks = $_POST["jsonTracks"];
	$poiID = $_POST["poiID"];
    echo $filteroptions -> getFullTrack($jsonTracks, $poiID);
}

// getSelectedTrack
if ($_POST["f"] == "getSelectedTrack"){
	$jsonTracks = $_POST["jsonTracks"];
	$poiID = $_POST["poiID"];
    echo $filteroptions -> getSelectedTrack($jsonTracks, $poiID);
}

/*
###############################
### SPATIALFILTER functions ###
###############################
Have a look at spatialFilter.php for function details!
*/

// runSpatialFilter
if ($_POST["f"] == "runSpatialFilter"){
	$jsonTracks = $_POST["jsonTracks"];
	$polygon = $_POST["polygon"];
    echo $spatialFilter -> runSpatialFilter($jsonTracks, $polygon);
}

// getBBox
if ($_POST["f"] == "getBBox"){
	$polygon = $_POST["polygon"];
    echo $spatialFilter -> getBBox($polygon);
}

// createBBoxURLfromPolygon
if ($_POST["f"] == "createBBoxURLfromPolygon"){
	$polygon = $_POST["polygon"];
	if(isset($_POST["limit"])){
		$limit = $_POST["limit"];
		echo $spatialFilter -> createBBoxURLfromPolygon($polygon, $limit);
	} else {
		echo $spatialFilter -> createBBoxURLfromPolygon($polygon);
	}
}

/*
###############################
###   TIMEFILTER functions  ###
###############################
Have a look at timeFilter.php for function details!
*/

// createTimestamp
if ($_POST["f"] == "createTimestamp"){
	$timeString = $_POST["timeString"];
    echo $timeFilter -> createTimestamp($timeString);
}

// getWeekday
if ($_POST["f"] == "getWeekday"){
	$timeString = $_POST["timeString"];
    echo $timeFilter -> getWeekday($timeString);
}

// checkDay
if ($_POST["f"] == "checkDay"){
	$timeString = $_POST["timeString"];
	$weekday = $_POST["weekday"];
    echo $timeFilter -> checkDay($timeString, $weekday);
}

// runTimeFilter
if ($_POST["f"] == "runTimeFilter"){
	$jsonTracks = $_POST["jsonTracks"];
	$starttime = $_POST["starttime"];
	$endtime = $_POST["endtime"];
	if(isset($_POST["weekday"])){
		$weekday = $_POST["weekday"];
		echo $timeFilter -> runTimeFilter($jsonTracks, $starttime, $endtime, $weekday);
	} else {
		echo $timeFilter -> runTimeFilter($jsonTracks, $starttime, $endtime);
	}
}

// getTimeintervalURL
if ($_POST["f"] == "getTimeintervalURL"){
	$starttime = $_POST["starttime"];
	$endtime = $_POST["endtime"];
	if(isset($_POST["limit"])){
		$limit = $_POST["limit"];
		echo $timeFilter -> getTimeintervalURL($starttime, $endtime, $limit);
	} else {
		echo $timeFilter -> getTimeintervalURL($starttime, $endtime);
	}
}

// The function does not exist!
else{
	echo "The function (f) does not exist!";
}


?>
{'fraction_non_alphanumeric': 0.23298886055563012, 'fraction_numerical': 0.0, 'mean_word_length': 5.618117229129663, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 39, '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': '3896306', 'n_tokens_mistral': 2541, 'n_tokens_neox': 2481, 'n_words': 513}