-
Notifications
You must be signed in to change notification settings - Fork 0
/
number_gen.php
62 lines (47 loc) · 1.54 KB
/
number_gen.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
<?php
include "LoadClass.php";
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sensor Reading Generator</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="css/animate.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
</head>
<body class="gray-bg">
<div class="middle-box text-center animated fadeInDown">
<h3 class="font-bold">Sensor Data Generator</h3>
<div class="error-desc">
This page generates sensor readings
<?php
$index = 8;
$value1 = 30;
$value2 = 35;
$readingController = new ReadingController();
while(true){
sleep(10);
if($index==8){
$index = 9;
}
elseif($index==9){
$index = 10;
}
else{
$index = 8;
}
$reading_object = new Reading(0,$index,date("Y-m-d"), date("h:i:sa"), rand($value1,$value2));
$readingController->insert($reading_object);
}
?>
</div>
</div>
<!-- Mainly scripts -->
<script src="js/jquery-1.10.2.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>