';
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 '';
}
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 '
';
}
}
}