-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tampilan Antrian.php
136 lines (103 loc) · 3.02 KB
/
Tampilan Antrian.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GoQueue</title>
<link rel="icon" type="image/x-icon" href="Logo.jpg">
</head>
<?php
//Data yang di input pada page sebelumnya
if($_SERVER['REQUEST_METHOD'] == 'POST'){
$_SESSION['loket'] = $_POST['loket'];
$_SESSION['operator'] = $_POST['operator'];
$_SESSION['kode'] = $_POST['kode'];
$_SESSION['antrian'] = $_POST['antrian'];
}
?>
<body>
<?php
$angka_awal = 1; // Angka awal yang ingin ditampilkan
$batas_angka = $_SESSION['antrian']; // Batas angka untuk mengganti fungsi tombol
?>
<div class="info"> <!-- Bagian yang akan di tampilkan -->
<h1 class="nama"><?php echo $_SESSION['loket']; ?></h1>
<hr>
<h1><?php echo $_SESSION['operator']; ?></h1>
<br>
<br>
<h3>Nomor Antrian</h3>
<h1><?php echo $_SESSION['kode']?> - <span id="angka"><?php echo $angka_awal; ?></span></h1>
<div class="fungsi">
<a id="tombol" onclick="tambahAngka()"><img class="gambar" src="kanan.png" alt="Selanjutnya">Selanjutnya</a>
<a id="tombol" onclick="play()"><img class="gambar" src="audio.jpeg" alt="panggil">Panggil</a>
<audio id="audio" src="Bel panggilan.mpeg"></audio>
</div>
<script> //Bagian Fungsi
function play() {
document.getElementById("audio").play();
}
function tambahAngka() {
var angka = document.getElementById("angka").innerHTML;
var hasil = parseInt(angka) + 1;
document.getElementById("angka").innerHTML = hasil;
if(hasil >= <?php echo $batas_angka; ?>) {
document.getElementById("tombol").setAttribute("onclick", "pindahHalaman()");
}
}
function pindahHalaman() {
window.location.href = "selesai.html";
}
</script>
</div>
</body>
<style>
body{
margin: 0%;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
background: #284B34;
}
.info{
background-color: #BED7C9;
margin: 5px;
display: flex;
flex-direction: column;
align-content: center;
width: 500px;
align-items: center;
height: 100vh;
}
.nama{
display: flex;
align-content: flex-start;
}
hr{
width: 170px;
}
#tombol{
display: flex;
justify-content: space-around;
align-items: center;
background-color: #BED7C9;
padding: 0%;
flex-direction: column;
height: 100px;
}
.gambar{
border-radius: 100%;
width: 50px;
}
.fungsi{
display: flex;
flex-direction: row-reverse;
justify-content: space-around;
margin-bottom: 25%;
margin-top: auto;
width: 500px;
}
</style>
</html>