ansicht nach entwicklung laender

This commit is contained in:
Göran Heinemann 2020-03-08 10:53:24 +01:00
parent a051402432
commit 8e7773fe0d
2 changed files with 22 additions and 3 deletions

View File

@ -52,9 +52,7 @@ if (isset($_GET['source'])){
echo '<tr><th>id</th><th>Scan-No</th><th>Place</th><th>infected</th><th>dead</th><th>active</th><th>cured</th></tr>'; echo '<tr><th>id</th><th>Scan-No</th><th>Place</th><th>infected</th><th>dead</th><th>active</th><th>cured</th></tr>';
foreach ($data as $row){ foreach ($data as $row){
echo '<tr>'; echo '<tr>';
foreach ($row as $item){ echo '<td>'.$row['id'].'</td><td>'.$row['scan'].'</td><td><a href="laender.php?land='.$row['place'].'">'.$row['place'].'</a></td><td>'.$row['amount'].'</td><td>'.$row['deaths'].'</td><td>'.$row['active'].'</td><td>'.$row['cured'].'</td>';
echo '<td>'.$item.'</td>';
}
echo '</tr>'; echo '</tr>';
} }
echo '</table>'; echo '</table>';

21
html/laender.php Normal file
View File

@ -0,0 +1,21 @@
<?php
include "../config.php";
if(isset($_GET['land'])){
$sql = "SELECT scans.id, place, amount, deaths, active, cured, time FROM `data` inner join scans on scans.id=data.scan WHERE place like ? group by amount order by time desc ";
$stmt = $pdo->prepare($sql);
$like = "%".trim($_GET['land'])."%";
$stmt->bindParam(1, $like);
$stmt->execute();
$data = $stmt->fetchAll(PDO::FETCH_ASSOC);
echo '<table>';
echo '<tr><th>id</th><th>Scan-No</th><th>infected</th><th>dead</th><th>active</th><th>cured</th><th>time</th></tr>';
foreach ($data as $row){
echo '<tr>';
foreach ($row as $item) {
echo '<td>'.$item.'</td>';
}
echo '</tr>';
}
echo '</table>';
}