-
Notifications
You must be signed in to change notification settings - Fork 0
/
agendar.php
347 lines (310 loc) · 11.4 KB
/
agendar.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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
<!DOCTYPE html>
<?php
session_start();
require('php/calendarphp/getvar.php');
?>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" >
<title>Agende seu Horário</title>
<link rel="shortcut icon" type="image/png" href="css/img/logo/logoRest.png">
<link rel="stylesheet" href="css/agendar.css">
<link rel="stylesheet" href="css/header.css">
<style rel=stylesheet href="css/Rodape.css"></style>
<link rel="stylesheet" type="text/css" href="css/calendar.css">
<script type="text/javascript" src="libs/jquery.min.js"></script>
<script type="text/javascript" src="libs/agendar.js"></script>
<script type="text/javascript" src="libs/verificarCadastro.js"></script>
<script src="libs/jquery-3.4.1.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<script>
$(document).ready(function() {
$('.table-mesas').hide();
$('.square, .square+p').hide();
$('#confirmarReserva-panel button').hide();
$('#mesaSelecionada-panel h3').hide();
$('#mesaSelecionada-panel input').hide();
$('#Hora p, #selectHora').hide();
var url = window.location.href;
var msg = url.split('=')[1];
switch(msg){
case '1':
alert("Mesa reservada com sucesso!");
opcao = confirm("Deseja escolher um prato para sua reserva?");
if(opcao == true){
window.location.assign("cardapio.php");
}else{
window.location.assign("perfil.php");
}
break;
case '2':
alert("Você já possui uma reserva pendente");
break;
case '3':
alert("Erro ao reservar mesa. Por favor, contate-nos em um de nossos canais para resolver o problema");
break;
case '4':
alert("É preciso fazer uma reserva para escolher o prato");
break;
default:
break;
}
});
$.ajax({
url: 'php/verificar_login.php',
success: function(data) {
console.log(data);
if(data == "Logado"){
$('#form-login').hide();
$('#usuario').show();
}
if(data == "NaoLogado"){
$('#usuario').hide();
$('#form-login').show();
}
}
});
function escolherMesa(numMesa){
$("#mesaSelecionada").val(numMesa);
$('#confirmarReserva-panel button').fadeIn('300');
}
</script>
</head>
<body>
<header id="header">
<a href="#"><img src="css/img/logo/logoRest.png" alt="logo" height="80px"></a>
<ul id="header-container">
<li><a href="home.php"><h1>Home</h1></a></li>
<li><a href="agendar.php"><h1>Agende seu horário</h1></a></li>
<li><a href="cardapio.php"><h1>Cardápio</h1></a></li>
<li><a href="sobre.php"><h1>Sobre</h1></a></li>
<div class="login">
<!--logado-->
<div id="usuario">
<div id="info-usuario">
<p id="nome"><?php echo $_SESSION['nomeUsuario'] ?></p>
<div class="sair"><a href="php/sair.php">Sair</a></div>
</div>
<div id="container-foto">
<div id="fotoUsuario">
<a href="perfil.php">
<img src="./css/img/usuarioIcon/user1.png" alt="userIcon">
</a>
</div>
</div>
</div>
<!--não logado-->
<form id="form-login" method="post" action="php/logar.act.php">
<input type="email" name="email" placeholder="Login">
<input type="password" name="senha" placeholder="Senha">
<input type="submit" value="LOGAR">
</form>
</ul>
<?php
if(isset($_SESSION['usuario_invalido'])){
?>
<script>
alert("Email e/ou senha invalidos");
location.reload();
</script>
<?php
};
unset($_SESSION['usuario_invalido']);
?>
<?php
if(isset($_SESSION['campo_vazio'])){
?>
<script>
alert("Preencha todos os campos");
location.reload();
</script>
<?php
};
unset($_SESSION['campo_vazio']);
?>
</div>
</header>
<div id="menu-aux">
<form action="php/reservarMesa.act.php" method="post">
<table class="table-mesas"> <!-- Tabela das mesas -->
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="cadeira"></td>
<td class="cadeira"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="mesaDisponivel" colspan="2">
<a href="javascript:escolherMesa(1)" class="btn-mesa" id="Mesa1">Mesa 1</a>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="cadeira"></td>
<td class="cadeira"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr> <!-- Mesa 2 e 3 estão nesta linha -->
<td></td>
<td class="cadeira"></td>
<td class="mesaDisponivel">
<a class="btn-mesa" onclick="escolherMesa(2)" id="Mesa2">Mesa 2</a>
</td>
<td class="cadeira"></td>
<td></td>
<td></td>
<td class="cadeira"></td>
<td class="mesaDisponivel">
<a class="btn-mesa" onclick="escolherMesa(3)" id="Mesa3">Mesa 3</a>
</td>
<td class="cadeira"></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
<div class="legendaMenu">
<!--<div id="legendaTitle">Legendas</div>-->
<div>
<div class="square" style="background-color:#69e584"></div>
<p>Disponivel</p>
</div>
<div>
<div class="square" style="background-color:#bb5a5a"></div>
<p>Ocupado</p>
</div>
<div id="Data">
<h4 style="color:white;text-align:center;">Selecione a data</h4>
<table style="border:2px solid transparent;" class="cal"> <!--calendario bugado -->
<tr style="background-color:#464343;">
<td><a class="back"><</a></td>
<td colspan="5" style="text-align:center;color:white;">
<?php echo "<span class=MYdiv id=".$month."/".$Year."/".$numDays.">".$day." / ".$monthName." / ".$Year."</span>";
echo "<div class='daysel' style='display:none;' id=".$day."></div>";
?>
</td>
<td><a class="next">></a></td>
<input type="hidden" name="data" value="" id="dataforphp">
</tr>
<?php
echo "<div class='viewtype' id=".$viewtype." style='display:none;'></div>";
if ($viewtype=="month") {
require 'php/calendarphp/month.php';
}
if ($viewtype=="day") {
require 'php/calendarphp/day.php';
}
?>
</table>
</div>
<div id="Hora"> <!-- Hora -->
<p>Horários disponíveis</p>
<select name="selectHora" id="selectHora">
<option value="none"></option>
</select>
</div>
<div id="mesaSelecionada-panel"> <!-- Mesa Selecionada PANEL -->
<h3>Mesa selecionada</h3>
<input id="mesaSelecionada" name="IdMesa" readonly="readonly" value="Escolha uma de nossas mesas"/>
</div>
<div id="confirmarReserva-panel"> <!-- Confirmação da Reserva -->
<button type="submit">Confirmar Reserva</button>
</div>
</div>
</form>
</div>
<?php require('Rodape.php');
?>
</body>
</html>