diff --git a/SQL/Queries.sql b/SQL/Queries.sql new file mode 100644 index 0000000..92ae98e --- /dev/null +++ b/SQL/Queries.sql @@ -0,0 +1,3 @@ +CREATE TABLE `u517357132_genderwatchpro`.`topics` ( `id` VARCHAR(8) CHARACTER SET ascii COLLATE ascii_bin NOT NULL , `lastSave` INT NULL DEFAULT CURRENT_TIMESTAMP , `fullJSON` JSON NOT NULL , `timeWatchM` INT NOT NULL , `timeWatchW` INT NOT NULL , `timeWatchD` INT NOT NULL , `countWatchM` INT NOT NULL , `countWatchW` INT NOT NULL , `countWatchD` INT NOT NULL , PRIMARY KEY (`id`)) ENGINE = InnoDB; + +INSERT INTO `topics` (`id`, `lastSave`, `fullJSON`, `timeWatchM`,`timeWatchW`, `timeWatchD`, `countWatchM`, `countWatchW`, `countWatchD`) values ('test', 2014, '{}', 10, 10, 10, 10, 40, 10) ON DUPLICATE KEY UPDATE `id` = 'test' \ No newline at end of file diff --git a/data/data.xlsx b/data/data.xlsx index 206509a..eef92fa 100644 Binary files a/data/data.xlsx and b/data/data.xlsx differ diff --git a/dataCollector/download.php b/dataCollector/download.php new file mode 100644 index 0000000..cefdb28 --- /dev/null +++ b/dataCollector/download.php @@ -0,0 +1,4 @@ +

Genderwatch-protocol

- Anonyme Daten herunterladen (aktuell in Entwicklung) + Anonyme Daten herunterladen (aktuell in Entwicklung)

Aktuelles Thema

diff --git a/spreadSheetReader/read_write_xlsx.php b/spreadSheetReader/read_write_xlsx.php index 577dfd7..a8625ed 100644 --- a/spreadSheetReader/read_write_xlsx.php +++ b/spreadSheetReader/read_write_xlsx.php @@ -2,8 +2,28 @@ require $_SERVER['DOCUMENT_ROOT'] . '/spreadSheetReader/SimpleXLSX.php'; require $_SERVER['DOCUMENT_ROOT'] . '/spreadSheetReader/SimpleXLSXGen.php'; +function read_xls_file($filename){ + $fileContent = []; + if ($xlsx = SimpleXLSX::parse($filename)) { + $fileContent = ($xlsx->rows()); + } else { + echo SimpleXLSX::parseError(); + } + return $fileContent; +} + + + +function write_xlsxFile($filename, $data) { + $xlsx = SimpleXLSXGen::fromArray($data); + $xlsx->saveAs($filename); +} function download_xlsxFile($data) { - $xlsx = SimpleXLSXGen::fromArray($data); + $xlsxArray = read_xls_file($_SERVER['DOCUMENT_ROOT'] ."/data/data.xlsx"); + foreach ($data as $row) { + array_push($xlsxArray, $row); + } + $xlsx = SimpleXLSXGen::fromArray($xlsxArray); $xlsx->downloadAs("data.xlsx"); } \ No newline at end of file