-
Notifications
You must be signed in to change notification settings - Fork 0
/
bilet.php
162 lines (136 loc) · 3.12 KB
/
bilet.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
<?php
include_once 'header.php';
?>
<style media="screen">
@import url('https://fonts.googleapis.com/css?family=Lato&display=swap');
* {
box-sizing: border-box;
}
.movie-container {
margin: 20px 0;
}
.container {
perspective: 1000px;
margin-bottom: 30px;
justify-content: center;
}
.seat {
background-color: red;
height: 20px;
width: 20px;
margin: 3px;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
.seat.selected {
background-color: #6feaf6;
}
.seat.occupied {
background-color: #fff;
}
.seat:nth-of-type(<?php require_once 'coloaneSupraDoi.php' ?>) {
margin-right: 18px;
}
.seat:nth-last-of-type(<?php require_once 'coloaneSupraDoi.php' ?>) {
margin-left: 18px;
}
.seat:not(.occupied):hover {
cursor: pointer;
transform: scale(1.2);
}
.showcase .seat:not(.occupied):hover {
cursor: default;
transform: scale(1);
}
.showcase {
background-color: rgba(0, 0, 0, 0.1);
padding: 5px 10px;
border-radius: 5px;
color: #777;
list-style-type: none;
display: flex;
justify-content: space-between;
width:20%;
margin-left: 40%;
}
.showcase li {
display: flex;
align-items: center;
justify-content: center;
margin: 0 10px;
}
.showcase li small {
margin-left: 10px;
}
.row {
display: flex;
margin: 0 auto;
justify-content: center;
}
.screen {
background-color: #fff;
height: 70px;
width: 50%;
margin: 0% 25% 15px;
transform: rotateX(-45deg);
box-shadow: 0 3px 10px rgba(255, 255, 255, 0.75);
}
</style>
<div class="movie-container">
<ul class="showcase">
<li>
<div class="seat"></div>
<small>Liber</small>
</li>
<li>
<div class="seat selected"></div>
<small>Selectat</small>
</li>
<li>
<div class="seat occupied"></div>
<small>Ocupat</small>
</li>
</ul>
<div class="container">
<div class="screen"></div>
<?php
include_once 'generareScaune.php';
?>
<button onclick="salvare()" type="button" name="submit">Rezerva</button>
</div>
<script src="script.js"></script>
</div>
<script>
function select(id){
//alert(id);
var x = document.getElementsByClassName("seat selected");
var c1 = document.getElementById(id).className;
//alert(c1);
if (c1 == 'seat') {
if(x.length<=4){
document.getElementById(id).className = "seat selected";
} else {
alert("Puteti selecta maxim 4 locuri!");
}
}
else if (c1 == "seat selected") {
document.getElementById(id).className = "seat";
}
}
function salvare(){
var proiectie = window.location.href.split(/[=]+/)[1];
var t = "rezervare.php?proiectie="+proiectie;
var myElements = document.getElementsByClassName("seat selected");
for(var counter = 1; counter < 5; counter++){
if (myElements[counter]!=undefined) {
t = t + "&l" + counter + "=" + myElements[counter].id;
}
else {
t = t + "&l" + counter + "=null";
}
//alert(t);
}
//alert(proiectie);
window.location.href = t;
}
</script>