-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a2a0b3b
commit d643a74
Showing
6 changed files
with
70 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
include 'connect.php'; | ||
|
||
|
||
|
||
//if ($conn->query($r) === TRUE) { | ||
//echo "New record created successfully"; | ||
//} else { | ||
//echo "Error: " . $sql . "<br>" . $conn->er | ||
|
||
|
||
$id = $_GET['i']; | ||
$hub = $_GET['id']; | ||
$stat=$_GET['stat']; | ||
if($stat=='ON') | ||
$query = "UPDATE sensor_list set status='OFF' WHERE Sensor_id='".$id."' and hub_id = '".$hub."'"; | ||
else | ||
$query = "UPDATE sensor_list set status='ON' WHERE Sensor_id='".$id."' and hub_id = '".$hub."'"; | ||
|
||
echo $query; | ||
if ($conn->query($query) === TRUE) { | ||
echo 'ok'; | ||
|
||
header("Location: sensor.php?id=".$hub); | ||
} | ||
|
||
exit; // finish execution since we only need the "ok" or "err" answers from the server. | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters