-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathManualControl.php
66 lines (59 loc) · 1.7 KB
/
ManualControl.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html>
<html>
<head>
<title>Fishy Pi</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css" />
<script src="./javascript/ManualControlValidations.js"></script>
</head>
<body>
<div id = "header">
<h1>Fishy Pi</h1>
</div>
<?php $currentPage=basename($_SERVER['PHP_SELF']); // looks up the name of the current page?>
<?php include("menu.php"); ?>
<!--Saves the temperature in to a cookies-->
<?php
if(isset($_COOKIE["temp"])) {
$temp=$_COOKIE["temp"];
}
else{
$temp = "";
}
?>
<div id ="main">
<!--Form for the temperature-->
<form name="temp" onsubmit="return validateTemp()" action="savetemp.php" method="post">
<p><strong>Target temperature:</strong></p>
<input type="text" name="temp" value="<?php echo $temp; ?>">
<input type="submit" value="Submit">
</form><br>
<!--Form for the light color-->
<form name="lightColor" onsubmit="return validateColor()" action="savecolor.php" method="post">
<p><strong>Select light color:</strong></p>
<select name="lights" id="lights">
<option value=""></option>
<option value="blue">Blue</option>
<option value="yellow">Yellow</option>
<option value="pink">Pink</option>
<option value="white">White</option>
</select>
<input type="submit" value="Submit">
</form><br>
<table>
<tr>
<th>Relay</th>
<th>On</th>
<th>Off</th>
</tr>
<tr>
<td>1</td>
<!--This buttons will use ajax to operate relays this is why they are not in a form -->
<td><button type="button"id="relay1">On</button></td>
<td><button type="button"id="relay2">Off</button></td>
</tr>
</table>
</div>
<div id ="footer">
</div>
</body>