File "gestion_systeme.php"
Full Path: /home/analogde/www/RaspBerry/Site/gestion_systeme.php
File size: 1.61 KB
MIME-type: text/x-php
Charset: utf-8
<?php
session_start();
error_reporting(0);
//if($_SESSION['logged']== "no")
if( isset($_POST['logged']) || $_SESSION['logged'] == "no" )
{
header ('Location: interdiction.php');
}
echo "Salut les affreux !!!";
$user = "root";
$password = "";
$host = "localhost";
$db = "raspberry";
$db_connection = mysql_connect($host, $user, $password);
mysql_select_db($db, $db_connection);
/* lire le fichier qui mémorise l'état de l'alarme */
$fp = fopen ("status.txt", "r+"); /* lecture + ecriture */
$status_alarme = fgets($fp);
fclose ($fp);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Gestion du systéme</title>
<link rel="shortcut icon" href="images/alarm.ico" type="image/x-icon" />
</head>
<body>
<table width="515" border="1">
<tr>
<th width="18" scope="col">GPIO #</th>
<th width="56" scope="col">Description</th>
<th width="24" scope="col">Statut</th>
</tr>
<tr>
<td> </td>
<td> </td>
<?php
if($status_alarme == 'off')
{
echo '<td><img id="button1" src="images/off.jpg" width="100" height="100" alt="off" title="off" /></td>';
}
else
{
echo '<td><img id="button1" src="images/on.jpg" width="100" height="100" alt="on" title="on" /></td>';
}
?>
</tr>
</table>
<a href="index.php">Deconnexion ...</a>
<?php
echo "<br><br>";
?>
<a href="password.php">Changer code d'accés ...</a>
<script src="script.js"></script>
</body>
</html>