<!DOCTYPE html>
<html lang="fr">

<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <title>Allo-GG</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="stylesheet" href="bootstrap.css" media="screen">
</head>

<?php

  $etat_status[0]='success';
  $etat_status[1]='light';

  $porte_status[0]='info';
  $porte_status[1]='light';

  $sonette_status[0]='danger';
  $sonette_status[1]='light';

?>

  <body>
    <div class="container" style="text-align:center;">

      <?php echo $message[$_GET["msg"]]; ?>

      <hr/>
      <div class="page-header">
        <div class="row">
          <div class="col-lg-12">
            <a href="index.php"><img src="../logo/allo-gg-logo.png" class="img-fluid" alt="Responsive image"></a>
            <br/><br/>
          </div>
        </div>
      </div>

      <h2 class="text-primary">Journal d'activité du module</h2>
      <?php $etat = exec("/usr/local/bin/gpio -g read 18"); ?>
      <?php $sonette = exec("/usr/local/bin/gpio -g read 17"); ?>
      <?php $porte = exec("/usr/local/bin/gpio -g read 4"); ?>

      <span class="badge badge-pill badge-<?php echo $etat_status[$etat]; ?>">&nbsp;</span>
      &nbsp;
      <span class="badge badge-pill badge-<?php echo $porte_status[$porte]; ?>">&nbsp;</span>
      &nbsp;
      <span class="badge badge-pill badge-<?php echo $sonette_status[$sonette]; ?>">&nbsp;</span>
      <hr/>

      <div class="row">
        <div class="col-lg-3"></div>
        <div class="col-lg-9">
          <p class="bs-component">
            <?php
              $log=file_get_contents('allo-gg.log');
              echo '<pre style="text-align:left;">'.$log.'</pre>';
            ?>
          </p>
        </div>
      </div>

      <hr/>
    </div>

    <script src="jquery.js"></script>
    <script src="bootstrap.js"></script>

  </body>
</html>
