-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcheckout.php
More file actions
138 lines (128 loc) · 4.38 KB
/
checkout.php
File metadata and controls
138 lines (128 loc) · 4.38 KB
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
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<title>Checkout GM Multimarcas</title>
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/estilo.css">
<link rel="stylesheet" href="css/mobile.css" media="(max-width: 320px)">
<link rel="stylesheet" href="css/mobile.css" media="(max-width: 480px)">
<link rel="stylesheet" href="css/mobile.css" media="(max-width: 720px)">
<link rel="stylesheet" href="css/mobile.css" media="(max-width: 939px)">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/checkout.css">
<meta name="viewport" content="width=device-width">
<script>
document.querySelector('input[type=email]').oninvalid = function() {
// remove mensagens de erro antigas
this.setCustomValidity("");
// reexecuta validação
if (!this.validity.valid) {
// se inválido, coloca mensagem de erro
this.setCustomValidity("Email inválido");
}
};
</script>
</head>
<body>
<?php include("cabecalho.php"); ?>
<div class="jumbotron">
<div class="container">
<h1>Ótima escolha!</h1>
<p>Obrigado por comprar na Mirror Fashion! Preencha seus dados para efetivar a compra.</p>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-sm-4">
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">Sua Compra</h2>
</div>
<div class="panel-body">
<img src="img/produtos/foto<?= $_POST['id'] ?>-<?= $_POST['cor'] ?>.png" class="img-thumbnail img-responsive">
<dl>
<dt>Produto</dt>
<dd><?= $_POST['nome'] ?> </dd>
<dt>Preço</dt>
<dd id="preco"><?= $_POST['preco'] ?></dd>
<dt>Cor</dt>
<dd><?= $_POST['cor'] ?></dd>
<dt>Tamanho</dt>
<dd><?= $_POST['tamanho'] ?></dd>
</dl>
<div class="form-group">
<label for="qt">Quantidade</label>
<input id="qt" class="form-control" type="number" min="0" max="99" value="1">
</div>
<div class="form-group">
<label for="total">Total</label>
<output for="qt valor" id="total" class="form-control">
<?= $_POST['preco'] ?>
</output>
</div>
</div>
</div>
</div>
<form class="col-sm-8">
<div class="row">
<fieldset class="col-md-6">
<legend>Dados Pessoais</legend>
<div class="form-group">
<label for="nome">Nome completo</label>
<input type="text" class="form-control" id="nome" name="nome" autofocus required>
</div>
<div class="form-group">
<label for="email">E-mail</label>
<input type="email" class="form-control" id="email" name="email" placeholder="email@exemplo.com" required>
</div>
<div class="form-group">
<label for="cpf">CPF</label>
<input type="text" class="form-control" id="cpf" name="cpf" placeholder="000.000.000-00">
</div>
<div class="checkbox">
<label>
<input type="checkbox" value="sim" name="spam" checked>
</label>
Quero receber e-mail da Mirror Fashion
</div>
</fieldset>
<fieldset class="col-md-6">
<legend>Cartão de crédito</legend>
<div class="form-group">
<label for="numero-cartao">Número - CVV</label>
<input type="text" class="form-control"
id="numero-cartao" name="numero-cartao">
</div>
<div class="form-group">
<label for="bandeira-cartao">Bandeira</label>
<select name="bandeira-cartao" id="bandeira-cartao"
class="form-control">
<option value="master">MasterCard</option>
<option value="visa">VISA</option>
<option value="amex">American Express</option>
</select>
</div>
<div class="form-group">
<label for="validade-cartao">Validade</label>
<input type="month" class="form-control"
id="validade-cartao" name="validade-cartao">
</div>
</fieldset>
</div>
<button type="submit" class="btn btn-primary btn-lg pull-right">
<span class="glyphicon glyphicon-thumbs-up"></span>
Confirmar Pedido
</button>
</form>
</div>
</div>
<?php include("rodape.php"); ?>
<script src="js/converteMoeda.js"></script>
<script src="js/testaConversao.js"></script>
<script src="js/total.js"></script>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/inputmask-plugin.js"></script>
</body>
</html>