diff --git a/dataCollector/dataCollector.php b/dataCollector/dataCollector.php
index 9b8a6ec..66f22d4 100644
--- a/dataCollector/dataCollector.php
+++ b/dataCollector/dataCollector.php
@@ -43,8 +43,14 @@ function saveToDatabase($contentArray, $conn) {
return;
}
-function getFromDatabase() {
- return [];
+function getFromDatabase($conn) {
+ $sql = "SELECT `id`, `firstSave`, `lastSave`, `fullJSON`, `timeWatchM`,`timeWatchW`, `timeWatchD`, `countWatchM`, `countWatchW`, `countWatchD` FROM `topics`";
+ $result = $conn->query($sql);
+ $dataArray = Array();
+ while($row = $result->fetch_assoc()) {
+ array_push($dataArray, [$row["id"],$row["firstSave"],$row["lastSave"],$row["fullJSON"],$row["timeWatchM"],$row["timeWatchW"],$row["timeWatchD"],$row["countWatchM"],$row["countWatchW"],$row["countWatchD"]]);
+ }
+ return $dataArray;
}
$entityBody = '{"lastSave": 0, "timeWatchM": 0, "timeWatchW": 0, "timeWatchD": 0, "countWatchM": 0, "countWatchW": 0, "countWatchD": 0, "id":"test","watches":[{"actions":[]},{"actions":[]},{"actions":[]}]}';
@@ -61,7 +67,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
}
} elseif($_SERVER['REQUEST_METHOD'] === 'GET') {
- download_xlsxFile(getFromDatabase());
+ download_xlsxFile(getFromDatabase($conn));
} else {
echo "invalid Request.
Type: ".$_SERVER['REQUEST_METHOD'];
}
diff --git a/dataCollector/download.php b/dataCollector/download.php
deleted file mode 100644
index cefdb28..0000000
--- a/dataCollector/download.php
+++ /dev/null
@@ -1,4 +0,0 @@
-