diff --git a/site/accesBase.php b/site/accesBase.php index ba466ae..1586872 100644 --- a/site/accesBase.php +++ b/site/accesBase.php @@ -235,6 +235,25 @@ deconnexion($db); } + function addRpi($ip) + { + $raspberry = "172.26.145.".$ip; + $db = connexion(); + $query = "SELECT * FROM raspberry WHERE ip = '$raspberry'"; + $result = pg_query($db, $query) or die("La requ te a echou : ".pg_last_error()); + if (pg_affected_rows($result)!=0) + { + deconnexion($db); + return False; + } + else{ + $query = "INSERT INTO raspberry VALUES('$raspberry', 1)"; + $result = pg_query($db, $query) or die("La requ te a echou : ".pg_last_error()); + deconnexion($db); + return pg_affected_rows($result)==1; + } + } + function add($nom, $type, $raspberry, $numero, $unite, $version) { $db = connexion(); diff --git a/site/addRaspberry.php b/site/addRaspberry.php new file mode 100644 index 0000000..31cb7dd --- /dev/null +++ b/site/addRaspberry.php @@ -0,0 +1,19 @@ +
+
+
+

Ajout d'un capteur

+
+ + + + + + + + +
172.26.145.
+ +
+
+
+
diff --git a/site/addRpi.php b/site/addRpi.php new file mode 100644 index 0000000..8184928 --- /dev/null +++ b/site/addRpi.php @@ -0,0 +1,53 @@ +?php +session_start(); +?> + + + + + + + + + + +
+
+
+

Historique

+ + + Protocole + + + + +
+
+ + + + diff --git a/site/ajoutRaspberry.php b/site/ajoutRaspberry.php new file mode 100644 index 0000000..d69f026 --- /dev/null +++ b/site/ajoutRaspberry.php @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + diff --git a/site/header.php b/site/header.php index 57f706a..64f3c05 100644 --- a/site/header.php +++ b/site/header.php @@ -10,6 +10,7 @@ $membre = getMembreByIdPwd($_SESSION['Login'], $_SESSION['Password']); ?> + Ajouter une Raspberry Ajouter un capteur Envoyer un code Historique @@ -17,12 +18,6 @@ Deconnexion - Inscription - diff --git a/site/hist.php b/site/hist.php index 9008c74..5dd0a9f 100644 --- a/site/hist.php +++ b/site/hist.php @@ -80,13 +80,9 @@ $date_max = $maxs[0]; - - - - - + -- libgit2 0.21.2