-
Notifications
You must be signed in to change notification settings - Fork 0
/
finalizar.php
547 lines (427 loc) · 29.4 KB
/
finalizar.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
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
<?php
require_once("controller/controller.php");
class index
{
private $cod_cli;
private $logado;
public function __construct()
{
session_start();
if (isset($_SESSION['id_cliente']) && $_SESSION['id_cliente'] > 0) {
$cod_cli = $_SESSION['id_cliente'];
$logado = true;
$controller = new controller();
$cliente = $controller->captar($cod_cli);
$carrinho = $controller->carrinho($cod_cli, 0, 1);
$script = "javascript:document.location='carrinho.php'";
} else {
$script = "javascript:alert('Entre na sua conta para adicionar itens ao seu carrinho...');";
$logado = false;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Magic Hat</title>
<meta content="" name="description">
<meta content="" name="keywords">
<!-- Favicons -->
<link href="img/magichat/icone.ico" rel="icon">
<link href="img/magichat/icone.ico" rel="apple-touch-icon">
<script type="module" src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.esm.js"></script>
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Raleway:300,300i,400,400i,500,500i,600,600i,700,700i|Poppins:300,300i,400,400i,500,500i,600,600i,700,700i" rel="stylesheet">
<!-- Vendor CSS Files -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
<link href="https://unpkg.com/[email protected]/dist/aos.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css" rel="stylesheet">
<link href='https://unpkg.com/[email protected]/css/boxicons.min.css' rel='stylesheet'>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/glightbox/dist/css/glightbox.min.css"/>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/fonts/remixicon.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.css"/>
<!-- Template Main CSS File -->
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<div vw class="enabled">
<div vw-access-button class="active"></div>
<div vw-plugin-wrapper>
<div class="vw-plugin-top-wrapper"></div>
</div>
</div>
<script src="https://vlibras.gov.br/app/vlibras-plugin.js"></script>
<script>
new window.VLibras.Widget('https://vlibras.gov.br/app');
</script>
<!-- ======= Header ======= -->
<header id="header" class="d-flex">
<div class="container d-flex align-items-center justify-content-between">
<div class="logo">
<h1><img src="img/magichat/logo.png">
<a href="index.php">Magic Hat</a></img>
</h1>
</div>
<nav id="navbar" class="navbar">
<ul>
<li><a class="nav-link scrollto" href="index.php">Home</a></li>
<li><a class="nav-link scrollto" href="produtos.php">Brinquedos</a></li>
<li><a class="nav-link scrollto" href="index.php#flipcard">Porque brincar</a></li>
<li><a class="nav-link scrollto" href="faleconosco.php">Fale conosco</a></li>
<li class="dropdown"><a href="#"><span>
<ion-icon id="person" name="person"></ion-icon>
</span> </a>
<ul>
<?php
if($logado == 1){
?>
<li><a href="editarinfo.php">Editar informações</a></li>
<li><a href="model/destroy.php?id=1">Sair da conta</a></li>
<?php
}else{
?>
<li><a href="login.php">Login</a></li>
<li><a href="login_gerente.php">Login - Gerente</a></li>
<li><a href="cadastro.php">Cadastre-se</a></li>
<?php
}
?>
</ul>
</li>
</ul>
<i class="bi bi-list mobile-nav-toggle"></i>
<button id="cart" class="navbar-toggler" type="button" data-bs-toggle="modal" onclick="<?php echo $script; ?>">
<span>
<ion-icon id="cart" name="cart"></ion-icon>
</span>
</button>
</nav><!-- .navbar -->
</div>
</header><!-- End Header -->
<main id="main">
<!-- ====== Pesquisa =======-->
<div id="header">
<div class="col">
<nav class="navbar container text-center">
<div class="col order-first"></div>
<div class="col-9">
<form method="post" action="search.php" id="formPesq" name="formPesq">
<div class="input-group">
<input autofocus type="text" placeholder="Com o que vamos brincar?" class="form-control" name="txtPesquisa" required id="txtPesquisa">
<button style="background-color: #ED4442;" class="btn btn-outline-light" type="submit">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z" />
</svg>
</button>
</div>
</form>
</div>
<div class="col order-last"></div>
</nav>
</div>
</div>
<br><br>
<section id="contact" class="contact">
<center>
<div class="container">
<div class="section-title" data-aos="zoom-out">
<p>Detalhes da Compra</p>
<h2>Confira antes de finalizar sua compra</h2>
</div>
<div id="finalizar-Compra" class="row mt-5">
<center>
<div class="col-lg-8 mt-5 mt-lg-0" data-aos="fade-left">
<form method="post" action="controller/controller.php?funcao=compra" id="formCad" name="formCad">
<div class="row g-3">
<div class="txtLeft col-md-6">
<div class="section-title" data-aos="zoom-out">
<p class="txtLeft">Resumo da Entrega</p>
<h2>Detalhes da Entrega</h2>
</div>
<label for="inputEmail4" class="form-label">Nome do cliente: </label>
<label for="inputEmail4" class="form-label"><?php echo $cliente[0]['nome'] ?></label>
<br>
<label for="inputEmail4" class="form-label">CEP: </label>
<label for="inputEmail4" class="form-label"><?php echo $cliente[0]['cep'] ?></label>
<br>
<label for="inputEmail4" class="form-label">Bairro: </label>
<label for="inputEmail4" class="form-label"><?php echo $cliente[0]['bairro'] ?></label>
<br>
<label for="inputEmail4" class="form-label">Endereço: </label>
<label for="inputEmail4" class="form-label"><?php echo $cliente[0]['endereco'] ?></label>
<br>
<label for="inputEmail4" class="form-label">Estado: </label>
<label for="inputEmail4" class="form-label"><?php echo $cliente[0]['estado'] ?></label>
<br>
<label for="inputEmail4" class="form-label">Cidade: </label>
<label for="inputEmail4" class="form-label"><?php echo $cliente[0]['cidade'] ?></label>
<br>
<a class="editarinf" href="editarinfo.php"><label for="inputEmail4" class="form-label">Alterar endereço de entrega</label>
</a>
</div>
<div class="txtLeft col-md-6">
<div class="section-title" data-aos="zoom-out">
<p class="txtLeft">Resumo da Compra</p>
<h2>Detalhes da compra</h2>
<br>
<?php
$qtdd = 0;
$valor_monte = 0;
$valor_all = 0;
for ($i = 0; $i < count($carrinho); $i++) {
$qtdd = $qtdd + $carrinho[$i]['quant'];
$valor_monte = $carrinho[$i]['quant'] * $carrinho[$i]['preco'];
$valor_all = $valor_monte + $valor_all;
}
if ($cliente[0]['cidade'] == 'São Paulo') {
$frete = rand(15, 25);
} else {
$frete = rand(25, 40);
}
$valor_total = $frete + $valor_all;
$_SESSION['qtdd_total'] = $qtdd;
$_SESSION['valor_total'] = $valor_total;
?>
<label for="inputEmail4" class="form-label">Qtdd. de Produtos: </label>
<label for="inputEmail4" class="form-label"><?php echo $qtdd; ?></label>
<br>
<label for="inputEmail4" class="form-label">Valor: </label>
<label for="inputEmail4" class="form-label">R$</label>
<label for="inputEmail4" class="form-label"><?php echo $valor_all; ?></label>
<br>
<label for="inputEmail4" class="form-label">Frete: </label>
<label for="inputEmail4" class="form-label">R$</label>
<label for="inputEmail4" class="form-label"><?php echo $frete; ?></label>
<br>
<div id="linha-horizontal">
</div>
<label for="inputEmail4" class="form-label">Valor total: </label>
<label for="inputEmail4" class="form-label">R$</label>
<label for="inputEmail4" class="form-label"><?php echo $valor_total; ?></label>
</div>
</div>
<!-- forms do categoria-->
<br>
<div id="linha-horizontal">
</div>
<center>
<div class="row">
<div class="col-12">
<div class="section-title" data-aos="zoom-out">
<p>Opções de pagamento</p>
</div>
</div>
<div class="col-md-2">
</div>
<div class="col-md-4">
<div class="form-check">
<input class="form-check-input" type="radio" name="flexRadioDefault" id="flexRadioDefault2" checked>
<label class="form-check-label" for="flexRadioDefault2">
<div class="finalizar-compra" data-aos="zoom-out">
<h2>Cartão de Crédito</h2>
</div>
</label>
</div>
</div>
<div class="col-md-3">
<div class="form-check">
<input class="form-check-input" type="radio" name="flexRadioDefault" id="flexRadioDefault1">
<label class="form-check-label" for="flexRadioDefault1">
<div class="finalizar-compra" data-aos="zoom-out">
<h2>Cartão de Débito</h2>
</div>
</label>
</div>
</div>
<div class="col-md-3 ">
</div>
</div>
</center>
<div id="linha-horizontal">
<br><br>
</div>
<section id="contact" class="contact">
<div class="row">
<div class="col-12">
<div class="section-title" data-aos="zoom-out">
<p>Dados do pagamento</p>
<h2>Não salvamos informações de pagamento</h2>
</div>
</div>
<div class="txtLeft col-md-2">
</div>
<div class="txtLeft col-md-8">
<label for="inputNumCartão" class="form-label">Número do cartão</label>
<input autofocus type="text" minlength="19" maxlength="19" placeholder="Ex: 1234 1234 1234 1234" class="form-control" name="txtNumCartão" required id="txtNumCartão">
<br>
</div>
<div class="txtLeft col-md-2">
</div>
<div class="txtLeft col-md-2">
</div>
<div class="txtLeft col-md-8">
<label for="inputNomeCompleto" class="form-label">Nome Completo</label>
<input autofocus type="text" placeholder="Nome como está impresso no cartão" class="form-control" name="txtNomeCompleto" required id="txtNomeCompleto">
<br>
</div>
<div class="txtLeft col-md-2">
</div>
<div class="txtLeft col-md-2">
</div>
<div class="txtLeft col-md-4">
<label for="inputValidade" class="form-label">Validade</label>
<input autofocus type="text" minlength="5" maxlength="5" placeholder="Ex: 10/25" class="form-control" name="txtValidade" required id="txtValidade">
<br>
</div>
<div class="txtLeft col-md-4">
<label for="inputCódSegurança" class="form-label">Código de segurança</label>
<input autofocus type="text" minlength="3" maxlength="3" placeholder="Ex: 111" class="form-control" name="txtCódSegurança" required id="txtCódSegurança">
<br>
</div>
<div class="txtLeft col-md-2">
</div>
<div class="txtLeft col-md-2">
</div>
<div class="txtLeft col-md-8">
<label for="inputParcelas" class="form-label">Número de parcelas</label>
<select class="form-select" name="cboParcelas" id="cboParcelas" required value>
<option selected value="1x">1x Sem Juros</option>
<option value="2x">2x Sem Juros</option>
<option value="3x">3x Sem Juros</option>
<option value="4x">4x Sem Juros</option>
</select>
</div>
<div class="txtLeft col-md-2">
</div>
</div>
</section>
<div class="php-email-form text-center col-12">
<button type="submit" id="btnFinalizarCompra" class="btn btn-dark">Finalizar
Compra</button>
</div>
</form>
</div>
</center>
</div>
</div>
</center>
</section><!-- End Contact Section -->
</main><!-- End #main -->
<br><br>
<!-- ======= Footer ======= -->
<svg class="hero-waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28 " preserveAspectRatio="none">
<defs>
<path id="wave-path" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z">
</defs>
<g class="wave1">
<use xlink:href="#wave-path" x="50" y="4" fill="rgba(161,30,29, .1)">
</g>
<g class="wave2">
<use xlink:href="#wave-path" x="70" y="0" fill="rgba(161,30,29, .2)">
</g>
<g class="wave3">
<use xlink:href="#wave-path" x="50" y="7" fill="#A11E1D">
</g>
</svg>
<footer>
<!-- Seção de Mídias Sociais -->
<ul class="social_icon">
<li><a href="https://twitter.com/MagicHatOficial">
<ion-icon name="logo-twitter"></ion-icon>
</a>
</li>
<li><a href="https://www.instagram.com/magic.hat.of/">
<ion-icon name="logo-instagram"></ion-icon>
</a>
</li>
<li><a href="https://www.linkedin.com/in/magic-hat-45bb81257">
<ion-icon name="logo-linkedin"></ion-icon>
</a>
</li>
<li><a href="https://www.facebook.com/profile.php?id=100088264081232">
<ion-icon name="logo-facebook"></ion-icon>
</a>
</li>
</ul>
<div class="container text-center text-md-start mt-5">
<div class="row mt-3">
<!-- 1° Coluna -->
<div class="col-md-3 col-lg-4 col-xl-3 mx-auto mb-4">
<!-- Conteúdo sobre o Site -->
<h3 class="fw-bold">
Magic Hat
</h3>
<p>
A Magic Hat é uma loja virtual de brinquedos que visa atender seus clientes de forma rápida,
interativa, com qualidade em seu atendimento e produtos e, principalmente, com segurança.
</p>
</div>
<!-- 3° Coluna -->
<div class="col-md-3 col-lg-2 col-xl-2 mx-auto mb-4">
<!-- Links Desenvolvedores -->
<h3 class="fw-bold">
Desenvolvedores
</h3>
<p class="txtCenter">
<a class="nav-link scrollto" href="https://github.com/joaopedro2602" target="_blank">João Pedro Cabral</a>
</p>
<p class="txtCenter">
<a class="nav-link scrollto" href="https://github.com/MarianeBS" target="_blank">Mariane Souza</a>
</p>
<p class="txtCenter">
<a class="nav-link scrollto" href="https://github.com/TamirisRC" target="_blank">Tamiris Carvalho</a>
</p>
<p class="txtCenter">
<a class="nav-link scrollto" href="https://github.com/vek03" target="_blank">Victor Cardoso</a>
</p>
<p class="txtCenter">
<a class="nav-link scrollto" href="https://github.com/VictordRoma" target="_blank">Victor Roma</a>
</p>
</div>
<!-- 3° Coluna -->
<div class="col-md-4 col-lg-3 col-xl-3 mx-auto mb-md-0 mb-4">
<!-- Links Contato -->
<h3 class="fw-bold">
Contato
</h3>
<p>
Endereço: Av. Águia de Haia, 2633 - Cidade Antônio Estêvão de Carvalho, São Paulo
</p>
<p>
CEP: 01311-000
</p>
<p>
Atendimento por: [email protected]
</p>
<p>
Contato: (11) 69318-8308
</p>
</div>
</div>
</div>
<p>©2022 Copyright <b>Magic Hat</b> | Todos os Direitos Reservados</p>
</footer>
<!-- End Footer -->
<a href="#" class="back-to-top d-flex align-items-center justify-content-center"><i class="bi bi-arrow-up-short"></i></a>
<!-- Vendor JS Files -->
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://unpkg.com/[email protected]/dist/aos.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/gh/mcstudios/glightbox/dist/js/glightbox.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/3.0.6/isotope.pkgd.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-IDwe1+LCz02ROU9k972gdyvl+AESN10+x7tBKgc9I5HFtuNz0wWnPclzo6p9vxnk" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<!-- JQuery Files -->
<script src="https://code.jquery.com/jquery-3.0.0.min.js"></script>
<script src="js/main.js"></script>
</body>
</html>
<?php
}
}
new index();
?>