1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
</style> <!--partie menu-->
<div id="entete">
<h1>CONFIGURATION </h1>
<form method="POST" action="/page7.php">
</br>
<?php
$serveur = "*****";
$base = "*****";
$user = "*******";
$pass = "*******";
$mysqli = new mysqli($serveur, $user, $pass, $base);
if ($mysqli->connect_error) {
echo '';
}
else {
echo '';
}
$requete = "SELECT * FROM lampes";
$resultat = $mysqli->query($requete) or die ('Erreur '.$requete.' '.$mysqli->error);
$news = '';
$news2 = '';
'<table>';
$nbr= mysqli_num_rows($resultat);
echo "$nbr";
while ($ligne = $resultat->fetch_assoc()) {
$id=$ligne['id_lampes'];
var_dump($id);
if ($ligne['what_lampes']==0)
{
$value = "<button type='submit' name='valider12' title='off'>
<image src='/ecl_off.jpeg' height='60' alt=''/>
<input type='hidden' name='okok' value=".$ligne['id_lampes']." ></button>";
}
else {
$value = "<button type='submit' name='valider2' title='ON'><image src='/ecl_on.jpeg' height='60' alt=''/><input type='hidden' name='okok' value=".$ligne['id_lampes']." ></button>";
}
//$date = date( "d/m", strtotime($ligne['id_lampe']));
$news .= '<table><td><center>'.$ligne['lieu_lampes'].'<br></br>'.$ligne['lib_lampes'].'<br></br>'.$value.'</center><br></br></td></table>'.$id;
}
echo "<tr><div class='colonnes'>$news</div><br></br></tr>";
//echo "<tr><div class='classclass'>$news</div></tr>";
'</table>';
$mysqli->close();
?>
<?php
if(isset($_POST['valider12'])){
$numero=$_POST['okok'];
$var2=0;
echo"off";
}
if(isset($_POST['valider2'])){
$numero=$_POST['okok'];
$var2=1;
echo"on";
}
$Commande = shell_exec ('python3 python.py '.$numero.' '.$var2);
echo "$Commande";
var_dump($Commande);
echo "'num:'$numero";
echo "'etat:'$var2";
?>
</from>
</html> |
Partager