diff --git a/html/index.php b/html/index.php
index 36e0883..b376692 100644
--- a/html/index.php
+++ b/html/index.php
@@ -1,73 +1,227 @@
+
+
+
+
+
+
+
+
+
+ Info an Coronavirus
+
+
query($sql);
+$data = $stmt->fetchAll(PDO::FETCH_ASSOC);
+?>
-echo '';
-foreach ($pdo->query($sql) as $row){
- echo ''.$row['title'].' '.$row['link'].' ';
-}
+
+
+
-if (isset($_GET['source'])){
- if (!isset($_GET['time'])){
- $sql = "SELECT * FROM scans WHERE site=? order by id desc";
- $stmt = $pdo->prepare($sql);
- $stmt->bindParam(1, $_GET['source']);
- $stmt->execute();
- $data = $stmt->fetchAll(PDO::FETCH_ASSOC);
- echo '';
- }else{
- if (isset($_GET['type'])){
- if ($_GET['type'] == 'csv'){
- $sql = "SELECT content FROM scans WHERE id=?";
- $stmt = $pdo->prepare($sql);
- $stmt->bindParam(1, $_GET['time']);
- $stmt->execute();
- $csv = $stmt->fetchAll(PDO::FETCH_ASSOC)[0]['content'];
- $test = str_getcsv($csv, ",", "\"", "\\");
- echo '';
- var_dump($test);
- echo ' ';
- echo '';
- for ($i = 0; $i < count($test); $i++){
- if ($i+1 % 12 == 0){
- echo '';
+
+
+Fallzahlen in Deutschland - Nach Robert Koch Institut';
+echo '';
+echo 'Platz Land kumulative Fallzahl ';
+$i = 1;
+foreach ($pdo->query($sql) as $row){
+ echo ''.$i.' '.str_replace("D-", "", $row['place']).' '.$row['amount'].' ';
+ $i++;
+}
+echo '
';
+
+//grafik
+$sql = "SELECT scans.id, place, amount, time FROM `data` inner join scans on scans.id=data.scan WHERE place like '%total%' group by amount order by time asc ";
+$stmt = $pdo->query($sql);
+$data = $stmt->fetchAll(PDO::FETCH_ASSOC);
+?>
+
+
+
+
+
+
+
+Weltweite Daten - Top 50';
+echo '';
+echo 'Platz Land Aktive Fälle kumulative Fallzahl geheilte Todesfälle ';
+$i = 1;
+foreach ($pdo->query($sql) as $row){
+ echo ''.$i.' '.$row['place'].' '.$row['active'].' '.$row['amount'].' '.$row['cured'].' '.$row['deaths'].' ';
+ $i++;
+}
+echo '
';
+?>
+
+
\ No newline at end of file
diff --git a/html/status.php b/html/status.php
index afe2966..36e0883 100644
--- a/html/status.php
+++ b/html/status.php
@@ -1,18 +1,73 @@
';
foreach ($pdo->query($sql) as $row){
- echo ' '.str_replace("D-", "", $row['place']).' '.$row['amount'].' ';
+ echo ''.$row['title'].' '.$row['link'].' ';
}
-echo '';
-echo ' ';
-$sql = "SELECT id, place, amount FROM `data` WHERE scan=(SELECT MAX(id) FROM `scans` WHERE site=2) ORDER BY amount DESC";
-echo '';
-foreach ($pdo->query($sql) as $row){
- echo ''.$row['place'].' '.$row['amount'].' ';
-}
-echo '';
+
+if (isset($_GET['source'])){
+ if (!isset($_GET['time'])){
+ $sql = "SELECT * FROM scans WHERE site=? order by id desc";
+ $stmt = $pdo->prepare($sql);
+ $stmt->bindParam(1, $_GET['source']);
+ $stmt->execute();
+ $data = $stmt->fetchAll(PDO::FETCH_ASSOC);
+ echo '';
+ }else{
+ if (isset($_GET['type'])){
+ if ($_GET['type'] == 'csv'){
+ $sql = "SELECT content FROM scans WHERE id=?";
+ $stmt = $pdo->prepare($sql);
+ $stmt->bindParam(1, $_GET['time']);
+ $stmt->execute();
+ $csv = $stmt->fetchAll(PDO::FETCH_ASSOC)[0]['content'];
+ $test = str_getcsv($csv, ",", "\"", "\\");
+ echo '';
+ var_dump($test);
+ echo ' ';
+ echo '';
+ for ($i = 0; $i < count($test); $i++){
+ if ($i+1 % 12 == 0){
+ echo '';
+ }
+
+ echo ''.$test[$i].' ';
+ }
+ echo'';
+ }else{
+ if ($_GET['type'] == 'html');
+ $sql = "SELECT * FROM data WHERE scan=? order by amount desc";
+ $stmt = $pdo->prepare($sql);
+ $stmt->bindParam(1, $_GET['time']);
+ $stmt->execute();
+ $data = $stmt->fetchAll(PDO::FETCH_ASSOC);
+ echo '';
+ echo 'id Scan-No Place infected dead active cured ';
+ foreach ($data as $row){
+ echo '';
+ echo ''.$row['id'].' '.$row['scan'].' '.$row['place'].' '.$row['amount'].' '.$row['deaths'].' '.$row['active'].' '.$row['cured'].' ';
+ echo ' ';
+ }
+ echo '
';
+ }
+ }else{
+ $sql = "SELECT * FROM data WHERE scan=?";
+ $stmt = $pdo->prepare($sql);
+ $stmt->bindParam(1, $_GET['time']);
+ $stmt->execute();
+ $data = $stmt->fetchAll(PDO::FETCH_ASSOC);
+ echo '';
+ foreach ($data as $row){
+ echo ''.$row['place'].' '.$row['amount'].' ';
+ }
+ echo '
';
+ }
+ }
+}
\ No newline at end of file
diff --git a/parse-worldometers.php b/parse-worldometers.php
index d7508dd..21188ae 100755
--- a/parse-worldometers.php
+++ b/parse-worldometers.php
@@ -43,7 +43,7 @@ foreach ($data as $scan){
for ($i = 0; $i < $parts->length; $i++) {
$country = array();
$p2 = $parts[$i]->childNodes;
- $country[] = $p2[0]->textContent;
+ $country[] = trim($p2[0]->textContent);
/*for ($j=0; $j < $p2->length; $j++){
var_dump($p2[$j]->textContent);
}*/
@@ -52,6 +52,8 @@ foreach ($data as $scan){
$deaths = $p2[$deathsCol]->textContent;
$recovered = $p2[$recoveredCol]->textContent;
$active = $p2[$activeCol]->textContent;
+ //var_dump($activeCol);
+ //var_dump($p2);
$country[] = intval(str_replace(",", "", $p2[2]->textContent));
$country[] =intval(str_replace(",", "", $deaths));
$country[] =intval(str_replace(",", "", $active));