-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
84 lines (74 loc) · 3.24 KB
/
Copy pathindex.php
File metadata and controls
84 lines (74 loc) · 3.24 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
<?php
/*
PHP4FUN
*/
if ($_POST) {
$url = "https://www.cepcerto.com/ws/json-frete/" . $_POST['origem'] . "/" . $_POST['destino'] . "/" . $_POST['peso'] . "/" . $_POST['comprimento'] . "/" . $_POST['altura'] . "/" . $_POST['largura'] . "";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
$obj = json_decode($output);
}
?>
<!doctype html>
<html data-bs-theme="dark">
<head>
<meta charset="utf-8">
<title>Cálculo de Frete - Correios</title>
<link rel="icon" type="image/png" href="https://www.correios.com.br/++theme++tema-do-portal-correios/static/imagens/favicon-32x32.png" sizes="32x32" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
</head>
<body class="p-5">
<h1>Cálculo de Frete</h1>
<sub>Correios</sub>
<table class="table table-dark table-striped mt-5">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">$</th>
</tr>
</thead>
<tbody>
<?php foreach ($obj as $key => $value) { ?>
<tr>
<th scope="row"><?php echo $key ?></th>
<td><?php echo $value ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<form class="mt-5" method="post">
<fieldset>
<legend>Informações da encomenda:</legend>
<div class="input-group mb-3">
<input type="text" class="form-control" name="origem" placeholder="CEP Origem" value="89207350">
</div>
<div class="input-group mb-3">
<input type="text" class="form-control" name="destino" placeholder="CEP Destino" value="85506040">
</div>
<div class="input-group mb-3">
<input type="text" class="form-control" name="peso" placeholder="Peso (gramas)" value="200">
</div>
<div class="input-group mb-3">
<input type="text" class="form-control" name="comprimento" placeholder="Comprimento (cm)" value="30">
</div>
<div class="input-group mb-3">
<input type="text" class="form-control" name="altura" placeholder="Altura (cm)" value="20">
</div>
<div class="input-group mb-3">
<input type="text" class="form-control" name="largura" placeholder="Largura (cm)" value="10">
</div>
<p>
A soma resultante do comprimento + largura + altura não deve superar 200 cm.<br>
A soma resultante do comprimento + o dobro do diâmetro não pode ser menor que 28 cm.
</p>
<button type="submit" class="btn btn-warning">ENVIAR</button>
</fieldset>
</form>
<p class="mt-5">
<a href="https://vinteum.com/" target="_blank">vinteum</a>
</p>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
</body>
</html>