update file to remove @override database adress

This commit is contained in:
JunkJumper 2019-07-03 17:40:12 +02:00
parent 0581fb6019
commit 54f9ecb7ab
8 changed files with 75 additions and 58 deletions

View File

@ -57,13 +57,13 @@
<li><strong>Location : </strong> Drap, France</li> <li><strong>Location : </strong> Drap, France</li>
<li><strong>Contact : </strong><a href="mailto:contact@junkjumper-projects.com">contact@junkjumper-projects.com</a></li> <li><strong>Contact : </strong><a href="mailto:contact@junkjumper-projects.com">contact@junkjumper-projects.com</a></li>
<div class="resume-list"> <div class="resume-list">
<li><strong>PDF presentations pages (french only & only by downbloading) : </strong> <li><strong>PDF presentations pages (french only) : </strong>
<center> <center>
<ul> <ul>
<li>Alexandre's Works : <a href="downloads/PRESENTATION_SLEGPI_PROJET_Alexandre.pdf">Télécharger le résumé</a></li> <li>Alexandre's Works : <a href="downloads/PRESENTATION_SLEGPI_PROJET_Alexandre.pdf">Download</a></li>
<li>Baptiste's Works : <a href="downloads/PRESENTATION_SLEGPI_PROJET_Baptiste.pdf">Télécharger le résumé</a></li> <li>Baptiste's Works : <a href="downloads/PRESENTATION_SLEGPI_PROJET_Baptiste.pdf">Download</a></li>
<li>José's Works : <a href="downloads/PRESENTATION_SLEGPI_PROJET_Jose.pdf">Télécharger le résumé</a></li> <li>José's Works : <a href="downloads/PRESENTATION_SLEGPI_PROJET_Jose.pdf">Download</a></li>
<li>Valentin's Works : <a href="downloads/PRESENTATION_SLEGPI_PROJET_Valentin.pdf">Télécharger le résumé</a></li> <li>Valentin's Works : <a href="downloads/PRESENTATION_SLEGPI_PROJET_Valentin.pdf">Download</a></li>
</ul> </ul>
</center> </center>
</li> </li>
@ -91,4 +91,4 @@
<script src="js/hawthorne.js"></script> <script src="js/hawthorne.js"></script>
</body> </body>
</html> </html>

View File

@ -1,13 +1,19 @@
<?php <?php
$servername = "localhost";
$username = "root"; include 'database.php';
$password = "root";
$dbname = "database";
try { try {
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
// set the PDO error mode to exception // set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$conn1 = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
// set the PDO error mode to exception
$conn1->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$conn2 = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
// set the PDO error mode to exception
$conn2->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// Connection MySQL for imgs displaying. // Connection MySQL for imgs displaying.
$bdd = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); $bdd = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
@ -28,9 +34,20 @@ try {
$conn = null; $conn = null;
//Simulation of Arduino sensors reception
$randl = rand(0, 9999);
$randw = rand(0, 50);
//send generated numbers to database
$sql1 = "UPDATE `capteurs` SET `lux` = '$randl' WHERE `capteurs`.`id` = 1";
$stmt = $conn1->prepare($sql1);
$stmt->execute();
$sql2 = "UPDATE `capteurs` SET `vent` = '$randw' WHERE `capteurs`.`id` = 1";
$stmt2 = $conn2->prepare($sql2);
$stmt2->execute();
?> ?>
<!doctype html> <!doctype html>
<iframe src="http://10.66.240.59/AM=WW" height="1" width="1" Scrolling="no" Frameborder="0"></iframe>
<html class="no-js" lang="fr"> <html class="no-js" lang="fr">
<head> <head>
<!-- En tête du site --> <!-- En tête du site -->
@ -47,7 +64,7 @@ $conn = null;
<script> <script>
setTimeout(function () { setTimeout(function () {
window.location.href = "auto.php"; window.location.href = "auto.php";
}, 2500); }, 5000);
</script> </script>
<div class="row"> <div class="row">
<div class="small-12 medium-12 large-12 small-centered columns"> <div class="small-12 medium-12 large-12 small-centered columns">
@ -68,7 +85,7 @@ $conn = null;
<ul class="inline-list-custom"> <ul class="inline-list-custom">
<li><a href="index.php" class="current">Use the system</a></li> <li><a href="index.php" class="current">Use the system</a></li>
<li><a href="about.php">About</a></li> <li><a href="about.php">About</a></li>
<li><a href="https://junkjumper.github.io/SLEGPI/">Back to the presentation page</a></li> <li><a href="https://junkjumper.github.io/SLEGPI/">Back to the presentation page</a></li>
</ul> </ul>
</nav> </nav>
</div> </div>
@ -80,15 +97,15 @@ $conn = null;
<ul class="small-block-grid-1 medium-block-grid-3 large-block-grid-3 inline-list-custom"> <ul class="small-block-grid-1 medium-block-grid-3 large-block-grid-3 inline-list-custom">
<!-- Début Case 1 --> <!-- Début Case 1 -->
<li> <li>
<div class="thumbnail"> <div class="thumbnail">
<div class="thumbnail-img"> <div class="thumbnail-img">
<?php <?php
$etateInt = $bdd->query('SELECT `eInt` FROM `capteurs` WHERE id=1'); $etateInt = $bdd->query('SELECT `lux` FROM `capteurs` WHERE id=1');
$result = $etateInt->fetch(); $result = $etateInt->fetch();
$count = $result[0]; $count = $result[0];
if ($count == 1) if ($count < 3000)
{ {
echo '<img src="img/allume.png" Lumières Intérieures Allumées" width="50%" height="100px">'; echo '<img src="img/allume.png" Lumières Intérieures Allumées" width="50%" height="100px">';
} }
@ -98,7 +115,7 @@ $conn = null;
} }
?> ?>
<div class="thumbnail-caption"> <div class="thumbnail-caption">
<p>State of the Indoor Lights</p> <p>Position of the blind</p>
</div> </div>
</div> </div>
</div> </div>
@ -106,14 +123,14 @@ $conn = null;
<!-- FIN Case 1 --> <!-- FIN Case 1 -->
<!-- Début Case 2 --> <!-- Début Case 2 -->
<li> <li>
<div class="thumbnail"> <div class="thumbnail" id="disp-result1">
<div class="thumbnail-img"> <div class="thumbnail-img">
<?php <?php
$etatStore = $bdd->query('SELECT `Store` FROM `capteurs` WHERE id=1'); $etatStore = $bdd->query('SELECT `vent` FROM `capteurs` WHERE id=1');
$result2 = $etatStore->fetch(); $result2 = $etatStore->fetch();
$count2 = $result2[0]; $count2 = $result2[0];
if ($count2 == 0) if ($count2 < 30)
{ {
echo '<img src="img/monte.png" alt="Store en position Haute" width="50%" height="100px">'; echo '<img src="img/monte.png" alt="Store en position Haute" width="50%" height="100px">';
} }
@ -123,7 +140,7 @@ $conn = null;
} }
?> ?>
<div class="thumbnail-caption"> <div class="thumbnail-caption">
<p>Position of the blind</p> <p>State of the Outdoor Lights</p>
</div> </div>
</div> </div>
</div> </div>
@ -136,10 +153,10 @@ $conn = null;
<div class="thumbnail"> <div class="thumbnail">
<div class="thumbnail-img"> <div class="thumbnail-img">
<?php <?php
$etateExt = $bdd->query('SELECT `eExt` FROM `capteurs` WHERE id=1'); $etateExt = $bdd->query('SELECT `lux` FROM `capteurs` WHERE id=1');
$result1 = $etateExt->fetch(); $result1 = $etateExt->fetch();
$count1 = $result1[0]; $count1 = $result1[0];
if ($count1 == 1) if ($count1 < 3000)
{ {
echo '<img src="img/allume.png" Lumières Extérieures Allumées" width="50%" height="100px">'; echo '<img src="img/allume.png" Lumières Extérieures Allumées" width="50%" height="100px">';
} }
@ -158,13 +175,13 @@ $conn = null;
<!-- Début Case 4 --> <!-- Début Case 4 -->
<li> <li>
<div class="thumbnail" id="rl-lux"> <div class="thumbnail" id="rl-lux">
<div class="thumbnail-img"> <div class="thumbnail-img">
<iframe src="display-lux.php" style="border:0px #ffffff hidden;" name="myiFrame" scrolling="no" frameborder="1" marginheight="0px" marginwidth="0px" height="120px" width="328px" allowfullscreen></iframe> <iframe src="display-lux.php" style="border:0px #ffffff hidden;" name="myiFrame" scrolling="no" frameborder="1" marginheight="0px" marginwidth="0px" height="120px" width="328px" allowfullscreen></iframe>
</div> </div>
<div class="thumbnail-caption"> <div class="thumbnail-caption">
<p>Amount of light (in µW/cm²)</p> <p>Amount of light (in µW/cm²)</p>
</div> </div>
</div> </div>
</li> </li>
@ -175,21 +192,21 @@ $conn = null;
<div class="thumbnail"> <div class="thumbnail">
<div class="thumbnail-img"> <div class="thumbnail-img">
<br /> <br />
<a href="index.php"><img src="img/auto/on.png" border="0" id="send" width="280", height="100%" /></a> <a href="index.php#disp-result"><img src="img/auto/on.png" border="0" id="send" width="280", height="100%" /></a>
</div> </div>
<div class="thumbnail-caption"><a href="auto.php">Automatic Mode</a></div> <div class="thumbnail-caption"><a href="auto.php">Automatic Mode</a></div>
</div> </div>
</li> </li>
<!-- FIN Case 5 --> <!-- FIN Case 5 -->
<!-- Début Case 6 --> <!-- Début Case 6 -->
<li> <li>
<div class="thumbnail" id="rl-wind"> <div class="thumbnail" id="rl-wind">
<div class="thumbnail-img"> <div class="thumbnail-img">
<iframe src="display-vent.php" style="border:0px #ffffff hidden;" name="myiFrame" scrolling="no" frameborder="1" marginheight="0px" marginwidth="0px" height="120px" width="328px" allowfullscreen></iframe> <iframe src="display-vent.php" style="border:0px #ffffff hidden;" name="myiFrame" scrolling="no" frameborder="1" marginheight="0px" marginwidth="0px" height="120px" width="328px" allowfullscreen></iframe>
</div> </div>
<div class="thumbnail-caption"> <div class="thumbnail-caption">
<p>Wind Speed (km/h)</p> <p>Wind Speed (km/h)</p>
</div> </div>
</div> </div>
</li> </li>
@ -200,7 +217,7 @@ $conn = null;
</body> </body>
<footer> <footer>
<div> <div>
<div> <div>
<ul> <ul>
<li>&copy; 2018 <a href="index.php">SLEGPI</a>. Projet SIN 2017/2018.</li> <li>&copy; 2018 <a href="index.php">SLEGPI</a>. Projet SIN 2017/2018.</li>
<li><br /><a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Licence Creative Commons" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a> This page is available under the terms of the <a rel="license" href="http://creativecommons.org/licenses/by/4.0/"> Creative Commons Attribution 4.0 International License</a>.</p></li> <li><br /><a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Licence Creative Commons" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a> This page is available under the terms of the <a rel="license" href="http://creativecommons.org/licenses/by/4.0/"> Creative Commons Attribution 4.0 International License</a>.</p></li>

View File

@ -1,8 +1,7 @@
<?php <?php
$servername = "localhost";
$username = "root"; include 'database.php';
$password = "root";
$dbname = "database";
try try
{ {
// Connection MySQL. // Connection MySQL.

View File

@ -1,8 +1,8 @@
<?php <?php
$servername = "localhost";
$username = "root"; include 'database.php';
$password = "root";
$dbname = "database";
try try
{ {
// Connection MySQL. // Connection MySQL.

View File

@ -1,8 +1,9 @@
<?php <?php
$servername = "localhost";
$username = "root"; include 'database.php';
$password = "root";
$dbname = "database";
echo"test mysql"; echo"test mysql";
if (isset($_GET['vent'])) if (isset($_GET['vent']))
{ {

View File

@ -1,8 +1,9 @@
<?php <?php
$servername = "localhost";
$username = "root"; include 'database.php';
$password = "root";
$dbname = "database";
try try
{ {
// Connection MySQL. // Connection MySQL.

View File

@ -1,8 +1,8 @@
<?php <?php
$servername = "localhost";
$username = "root"; include 'database.php';
$password = "root";
$dbname = "database";
try { try {
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
@ -105,8 +105,6 @@ $conn = null;
?> ?>
<!doctype html> <!doctype html>
<iframe src="http://10.66.240.59/AM=MM" height="1" width="1" Scrolling="no" Frameborder="0"></iframe>
<iframe src="http://10.66.240.59/LI=<?php echo $LI; ?>/LE=<?php echo $LE; ?>/S=<?php echo $S; ?>" height="1" width="1" Scrolling="no" Frameborder="0"></iframe>
<html class="no-js" lang="fr"> <html class="no-js" lang="fr">
<head> <head>
<!-- En tête du site --> <!-- En tête du site -->
@ -341,3 +339,4 @@ $conn = null;
</div> </div>
</footer> </footer>
</html> </html>

View File

@ -2,10 +2,11 @@
if (isset($_POST["LI"])) $LI= $_POST["LI"]; else $LI =""; if (isset($_POST["LI"])) $LI= $_POST["LI"]; else $LI ="";
if (isset($_POST["LE"])) $LE= $_POST["LE"]; else $LE =""; if (isset($_POST["LE"])) $LE= $_POST["LE"]; else $LE ="";
if (isset($_POST["S"])) $S= $_POST["S"]; else $S =""; if (isset($_POST["S"])) $S= $_POST["S"]; else $S ="";
$servername = "localhost";
$username = "root";
$password = "root"; include 'database.php';
$dbname = "database";
try { try {
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
@ -68,7 +69,6 @@ $conn = null;
<br \><br \>- For Indoor Lights = <?php if ($LI == 'Y') {echo "Turning on the lights";} elseif ($LI == 'non') {echo "Turning off the lights";} else {echo "Nothing was sent";}?> <br \><br \>- For Indoor Lights = <?php if ($LI == 'Y') {echo "Turning on the lights";} elseif ($LI == 'non') {echo "Turning off the lights";} else {echo "Nothing was sent";}?>
<br \><br \>- For Outdoor Lights = <?php if ($LE == 'Z') {echo "Turning on the lights";} elseif ($LE == 'wrong') {echo "Turning off the lights";} else {echo "Nothing was sent";}?> <br \><br \>- For Outdoor Lights = <?php if ($LE == 'Z') {echo "Turning on the lights";} elseif ($LE == 'wrong') {echo "Turning off the lights";} else {echo "Nothing was sent";}?>
<br \><br \>- For the blind = <?php if ($S == 'false') {echo "Raising down the blind";} elseif ($S == 'OUV') {echo "Raising up the blind";} else {echo "Nothing was sent";}?></p> <br \><br \>- For the blind = <?php if ($S == 'false') {echo "Raising down the blind";} elseif ($S == 'OUV') {echo "Raising up the blind";} else {echo "Nothing was sent";}?></p>
<iframe src="http://10.66.240.59/LI=<?php echo $LI; ?>/LE=<?php echo $LE; ?>/S=<?php echo $S; ?>" height="1" width="1" Scrolling="no" Frameborder="0"></iframe>
</center> </center>
</div> </div>
</body> </body>