DataDownload
This commit is contained in:
parent
9501370fae
commit
f459f4d4a1
|
@ -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.<br> Type: ".$_SERVER['REQUEST_METHOD'];
|
||||
}
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
<?php
|
||||
require $_SERVER['DOCUMENT_ROOT'] . '/spreadSheetReader/read_write_xlsx.php';
|
||||
|
||||
download_xlsxFile([]);
|
|
@ -10,7 +10,7 @@
|
|||
<section>
|
||||
<div class="container">
|
||||
<h1>Genderwatch-protocol</h1>
|
||||
<a href="dataCollector/download.php">Anonyme Daten herunterladen (aktuell in Entwicklung)</a>
|
||||
<a href="dataCollector/dataCollector.php">Anonyme Daten herunterladen (aktuell in Entwicklung)</a>
|
||||
<h2 style="margin-left: 10px;">Aktuelles Thema</h2>
|
||||
<table class="table-bordered">
|
||||
<tr>
|
||||
|
|
Loading…
Reference in New Issue