Commit 34837f0f8018bb91bc994fa55d0049eedbe6d555
1 parent
fdccb4ca
MAJ
Showing
3 changed files
with
91 additions
and
11 deletions
Show diff stats
site/remove.php
@@ -46,13 +46,36 @@ session_start(); | @@ -46,13 +46,36 @@ session_start(); | ||
46 | $ini = $ini.$raspberry." capteur=".$numero."-".$version." setup=0\n"; | 46 | $ini = $ini.$raspberry." capteur=".$numero."-".$version." setup=0\n"; |
47 | file_put_contents('upload/inventaire.ini', $ini); | 47 | file_put_contents('upload/inventaire.ini', $ini); |
48 | 48 | ||
49 | - //exec("super cmd.sh"); | 49 | + /*$retour = array(); |
50 | + $statut; | ||
51 | + exec("super cmd.sh", $retour, $statut); | ||
52 | + | ||
53 | + if($statut == 0) | ||
54 | + { | ||
55 | + $message = "Le capteur a bien été supprimé !"; | ||
56 | + $color = "alert-success"; | ||
57 | + } | ||
58 | + else | ||
59 | + { | ||
60 | + $ansible = "Code retour : ".$statut."<br/>"; | ||
61 | + $message = "Echec lors de la suppression !"; | ||
62 | + $color = "alert-danger"; | ||
63 | + } | ||
64 | + | ||
65 | + $size = count($retour); | ||
66 | + for($i = 0; $i<$size; $i++) | ||
67 | + { | ||
68 | + $ansible = $ansible.$retour[$i]."<br/>"; | ||
69 | + } | ||
70 | + | ||
50 | ?> | 71 | ?> |
51 | - <div class="alert alert-success" role="alert"> | ||
52 | - Le capteur a bien été supprimé ! | 72 | + <div class="alert <?php echo $color;?>" role="alert"> |
73 | + <?php echo $message;?> | ||
53 | </div> | 74 | </div> |
54 | - <meta http-equiv="Refresh" content="3;url=accueil.php" /> | ||
55 | - <?php | 75 | + <div class="alert alert-secondary" role="alert"> |
76 | + <?php echo $ansible;?> | ||
77 | + </div> | ||
78 | + <?php*/ | ||
56 | } | 79 | } |
57 | else | 80 | else |
58 | { | 81 | { |
site/removeRpi.php
@@ -60,12 +60,36 @@ session_start(); | @@ -60,12 +60,36 @@ session_start(); | ||
60 | if(removeRpi($_POST['ip'])) | 60 | if(removeRpi($_POST['ip'])) |
61 | { | 61 | { |
62 | file_put_contents('upload/inventaire.ini', $ini); | 62 | file_put_contents('upload/inventaire.ini', $ini); |
63 | - //exec("super cmd.sh"); | 63 | + /*$retour = array(); |
64 | + $statut; | ||
65 | + exec("super cmd.sh", $retour, $statut); | ||
66 | + | ||
67 | + if($statut == 0) | ||
68 | + { | ||
69 | + $message = "Le Raspberry Pi a bien été supprimé !"; | ||
70 | + $color = "alert-success"; | ||
71 | + } | ||
72 | + else | ||
73 | + { | ||
74 | + $ansible = "Code retour : ".$statut."<br/>"; | ||
75 | + $message = "Echec lors de la suppression !"; | ||
76 | + $color = "alert-danger"; | ||
77 | + } | ||
78 | + | ||
79 | + $size = count($retour); | ||
80 | + for($i = 0; $i<$size; $i++) | ||
81 | + { | ||
82 | + $ansible = $ansible.$retour[$i]."<br/>"; | ||
83 | + } | ||
84 | + | ||
64 | ?> | 85 | ?> |
65 | - <div class="alert alert-success" role="alert"> | ||
66 | - La Raspberry a bien été supprimée ! | 86 | + <div class="alert <?php echo $color;?>" role="alert"> |
87 | + <?php echo $message;?> | ||
67 | </div> | 88 | </div> |
68 | - <?php | 89 | + <div class="alert alert-secondary" role="alert"> |
90 | + <?php echo $ansible;?> | ||
91 | + </div> | ||
92 | + <?php*/ | ||
69 | } | 93 | } |
70 | else | 94 | else |
71 | { | 95 | { |
site/stop.php
1 | <?php | 1 | <?php |
2 | require_once("accesBase.php"); | 2 | require_once("accesBase.php"); |
3 | +include("date.php"); | ||
3 | 4 | ||
4 | $arduino_simple = "[Arduino_stop]\r\n"; | 5 | $arduino_simple = "[Arduino_stop]\r\n"; |
5 | $arduino_spi = "[Arduino_stop]\r\n"; | 6 | $arduino_spi = "[Arduino_stop]\r\n"; |
@@ -25,6 +26,38 @@ $raspberry = getRaspberry($_POST['nom']); | @@ -25,6 +26,38 @@ $raspberry = getRaspberry($_POST['nom']); | ||
25 | $ini = $ini.$raspberry." capteur=".$numero."-".$version." setup=0\n"; | 26 | $ini = $ini.$raspberry." capteur=".$numero."-".$version." setup=0\n"; |
26 | file_put_contents('upload/inventaire.ini', $ini); | 27 | file_put_contents('upload/inventaire.ini', $ini); |
27 | 28 | ||
28 | -//exec("super cmd.sh"); | ||
29 | -header("Location: data.php"); | 29 | +/* |
30 | +$retour = array(); | ||
31 | +$statut; | ||
32 | +exec("super cmd.sh", $retour, $statut); | ||
33 | + | ||
34 | +if($statut == 0) | ||
35 | +{ | ||
36 | + $message = "Le capteur a bien été arrêté !"; | ||
37 | + $color = "alert-success"; | ||
38 | +} | ||
39 | +else | ||
40 | +{ | ||
41 | + $ansible = "Code retour : ".$statut."<br/>"; | ||
42 | + $message = "Echec lors de l'arrêt !"; | ||
43 | + $color = "alert-danger"; | ||
44 | +} | ||
45 | + | ||
46 | +$size = count($retour); | ||
47 | +for($i = 0; $i<$size; $i++) | ||
48 | +{ | ||
49 | + $ansible = $ansible.$retour[$i]."<br/>"; | ||
50 | +} | ||
51 | + | ||
52 | +?> | ||
53 | +<div class="alert <?php echo $color;?>" role="alert"> | ||
54 | + <?php echo $message;?> | ||
55 | +</div> | ||
56 | +<div class="alert alert-secondary" role="alert"> | ||
57 | + <?php echo $ansible;?> | ||
58 | +</div> | ||
59 | + | ||
60 | +<?php | ||
61 | +*/ | ||
62 | +//header("Location: data.php"); | ||
30 | ?> | 63 | ?> |