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>

View File

@ -1,14 +1,20 @@
<?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">
@ -85,10 +102,10 @@ $conn = null;
<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>
@ -107,13 +124,13 @@ $conn = null;
<!-- 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">';
} }
@ -175,7 +192,7 @@ $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>

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>