forked from tim3233/webrms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
225 lines (207 loc) · 4.84 KB
/
index.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<?php
for($i=1;$i<=6;$i++){
$fileName = 'core/data/car.'.$i.'.rnd';
$fuelName = 'core/data/car.'.$i.'.fuel';
$startName = 'core/data/start.log';
if (!file_exists($fileName)) {
fopen($fileName,"x+");
chmod($fileName, 0777);
}
if (!file_exists($fuelName)) {
fopen($fuelName,"x+");
chmod($fuelName, 0777);
}
}
if (!file_exists($startName)) {
fopen($startName,"x+");
chmod($startName, 0777);
}
?>
<!DOCTYPE html>
<html>
<head>
<title>webrms 0.1</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="css/style.css" rel="stylesheet" media="screen">
<link href='http://fonts.googleapis.com/css?family=Oswald:400,700,300' rel='stylesheet' type='text/css'>
<script src="js/jquery-2.0.3.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<script>
function getLaps(car) {
var car_id=car;
var request = $.ajax({
url: "core/webrms_get_lap.php",
type: "POST",
data: {car: car_id},
dataType: "html"
});
request.done(function(msg) {
var lapData = jQuery.parseJSON(msg);
if(lapData.last_round>0){
$("#driver_laptime_"+car_id).html(lapData.last_round + ' s');
$("#driver_laprounds_"+car_id).html(lapData.rounds);
}
});
setTimeout(function () {
getLaps(car_id)
}, 500);
}
$( document ).ready(function() {
//Rundenzähler starten
getLaps(1);
getLaps(2);
getLaps(3);
getLaps(4);
getLaps(5);
getLaps(6);
//Start-Server-Function
$("#start").click(function(){
});
//Reset-Function
$("#reset").click(function(){
var request = $.ajax({
url: "core/webrms_reset.php",
type: "POST",
data: {reset: 'true'},
dataType: "html"
});
});
});
</script>
<div class="top-menu">
<div class="container">
<div class="row">
<div class="span4">
<div class="btn-group">
<a class="btn dropdown-toggle btn-inverse" data-toggle="dropdown" href="#">
Rennen
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="#" id="reset">Zurücksetzen</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="container rennergebnisse">
<div class="row">
<div class="span12 header">
<div class="span3">
Fahrer
</div>
<div class="span2">
letzte Runde
</div>
<div class="span2">
Runden
</div>
<div class="span2">
beste Runde
</div>
</div>
</div>
<div class="row">
<div class="span12">
<div class="span3">
Fahrer 1
</div>
<div class="span2 lap-time" id="driver_laptime_1">
0.0000 s
</div>
<div class="span2" id="driver_laprounds_1">
0
</div>
<div class="span2 lap-time" id="driver_besttime_1">
0.0000s
</div>
</div>
</div>
<div class="row">
<div class="span12">
<div class="span3">
Fahrer 2
</div>
<div class="span2 lap-time" id="driver_laptime_2">
0.0000 s
</div>
<div class="span2" id="driver_laprounds_2">
0
</div>
<div class="span2 lap-time" id="driver_besttime_2">
0.0000s
</div>
</div>
</div>
<div class="row">
<div class="span12">
<div class="span3">
Fahrer 3
</div>
<div class="span2 lap-time" id="driver_laptime_3">
0.0000 s
</div>
<div class="span2" id="driver_laprounds_3">
0
</div>
<div class="span2 lap-time" id="driver_besttime_3">
0.0000s
</div>
</div>
</div>
<div class="row">
<div class="span12">
<div class="span3">
Fahrer 4
</div>
<div class="span2 lap-time" id="driver_laptime_4">
0.0000 s
</div>
<div class="span2" id="driver_laprounds_4">
0
</div>
<div class="span2 lap-time" id="driver_besttime_4">
0.0000s
</div>
</div>
</div>
<div class="row">
<div class="span12">
<div class="span3">
Fahrer 5
</div>
<div class="span2 lap-time" id="driver_laptime_5">
0.0000 s
</div>
<div class="span2" id="driver_laprounds_5">
0
</div>
<div class="span2 lap-time" id="driver_besttime_5">
0.0000s
</div>
</div>
</div>
<div class="row">
<div class="span12">
<div class="span3">
Fahrer 6
</div>
<div class="span2 lap-time" id="driver_laptime_6">
0.0000 s
</div>
<div class="span2" id="driver_laprounds_6">
0
</div>
<div class="span2 lap-time" id="driver_besttime_6">
0.0000s
</div>
</div>
</div>
</div>
</body>
</html>