Ping Dashboard

Ping Dashboard

Ping dashboard

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>Ping Dashboard</title>
    <link rel = "icon" href ="ping.jpg" type ="image/x-icon">
<style>
.block {
  display: block;
  width: 9%;
  border: 1px solid #808080;
  background-color: green;
  color: white;
  padding: 35px 15px;
  font-size: 18px;
  margin: 4px 4px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  float: left;
}

.block:hover {
  background-color: #2F4F4F;
  color: white;
}

.block2 {
  display: block;
  width: 9%;
  border: 1px solid #808080;
  background-color: #B8290A;
  color: white;
  padding: 35px 15px;
  font-size: 18px;
  margin: 4px 4px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  float: left;
}

.block:hover {
  background-color: #2F4F4F;
  color: white;
}

.alert {
  position: fixed;
  bottom:0;
  width: 98%;
  padding:10px;
  color: white;
  text-align: center;
  background-color: #f44336;
  font-size: 75px;
  animation: animate
  2.0s linear infinite;
}
@keyframes animate {
  0% {
    opacity: 0;
  }

  50% {
    opacity: 0.7;
  }

  100% {
    opacity: 0;
  }
 }
</style>
</head>
<body>

<?php

//CONFIG
ini_set('max_execution_time', '0');
ini_set('memory_limit','-1');
ignore_user_abort(true);
set_time_limit(0);
echo "<body style='background-color: #22292c; color:white;'>";
echo header("refresh: 30");

//Ping1
$iplist =array
    (
      array("1.1.1.1", "")
    );
$i = count($iplist);
$results = [];
for ($j=0;$j<$i;$j++) {
    $ip =$iplist[$j] [0];
    $ping =exec("ping -n 1 $ip",$output,$status);
   $results[] = $status;
}
foreach($results as $item =>$k) {
    echo '<tr>';
     '<td align=right>'.$item.'</td>';
     '<td>'.$iplist[$item][0].'</td>';
    if ($results[$item]==0){
        echo '<a href="1.php" <button class="block">Ping1</button></a>';

    }
    else{
        echo '<div class="alert">Ping1 OFFLINE!</div>';
        echo '<a href="239.php" <button class="block2">Ping1</button></a>';
    }
}
//Ping2
$iplist =array
    (
      array("1.0.0.1", "")
    );
$i = count($iplist);
$results = [];
for ($j=0;$j<$i;$j++) {
    $ip =$iplist[$j] [0];
    $ping =exec("ping -n 1 $ip",$output,$status);
   $results[] = $status;
}
foreach($results as $item =>$k) {
    echo '<tr>';
     '<td align=right>'.$item.'</td>';
     '<td>'.$iplist[$item][0].'</td>';
    if ($results[$item]==0){
        echo '<a href="1.php" <button class="block">Ping2</button></a>';

    }
    else{
        echo '<div class="alert">Ping2 OFFLINE!</div>';
        echo '<a href="239.php" <button class="block2">Ping2</button></a>';
    }
}
?>
</div>
</body>
</html>