forked from Anenth/Buzzer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
result.php
71 lines (66 loc) · 2.12 KB
/
result.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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="main.css" type="text/css" rel="stylesheet"/>
<title></title>
<script language="javascript" type="text/javascript">
function playSound() {
document.getElementById("dummy").innerHTML=
"<embed src='buzzer.mp3' hidden='true' autostart='true' loop='false' />";
}
function timedRefresh(timeoutPeriod) {
setTimeout("location.reload(true);",timeoutPeriod);
}
</script>
</head>
<body>
<span id="dummy"></span>
<?php
$myFile = "rank.txt";
$fh = fopen($myFile, 'r') or die("can't open file");
$tp = fread($fh, '2');
fclose($fh);
if ($tp == 1) {
?>
<h1>Team A</h1>
<script> playSound()</script>
<?php
}
// continue;
elseif ($tp == 2) {
?>
<h1>Team B</h1>
<script> playSound()</script>
<?php
} elseif ($tp == 3) {
?>
<h1>Team C</h1>
<script> playSound()</script>
<?php
} elseif ($tp == 4) {
?>
<h1>Team D</h1>
<script> playSound()</script>
<?php
} else {
?> <script>
JavaScript:timedRefresh(5);
</script>
<?php
}
?>
<form method="get" action="refresh.php">
<input style="position: absolute; bottom: 10px; right: 10px; width: 100px; padding: 10px;
margin: 10px;
background: darkred;
box-shadow: 2px 2px 2px black;
color: white;
font-size: 15px;
font-weight: bold;
text-shadow: 1px 0px 2px black;
cursor: pointer;
"type="submit" name="clear" value="Clear" />
</form>
</body>
</html>