This repository was archived by the owner on Dec 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompra.php
More file actions
92 lines (75 loc) · 3.53 KB
/
Compra.php
File metadata and controls
92 lines (75 loc) · 3.53 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
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Lato|Roboto" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css\estilocompra.css">
<title>Compra</title>
</head>
<body>
<div class="menu">
<div class="search">
<input class="entre" placeholder="Pesquise aqui..."></input>
</div>
<div class="linha" align='center'></div>
<div>
<select class="campos" placeholder="Produto">
<option hidden>Produto...</option>
<?php //Isso aqui tá só pra dar o select, mas tem que alterar o html pra mostrar de acordo com o resultado da consulta
include 'conectar.php';
//$database = new $conn;
//$db = ;
$consulta_produto = "SELECT NOME, MARCA from PRODUTO";
//$resultado_consulta = mysqli_query($conn, $consulta_produto);
$result = $conn->query($consulta_produto);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
if( $row["MARCA"] != null )
echo "<option>".$row["MARCA"]." - ".$row["NOME"]."</option>";
else
echo "<option>".$row["NOME"]."</option>";
}
} else {
echo "<option>0 results</option>";
}
?>
</select>
<select class="campos" placeholder="Comanda">
<option hidden>Comanda...</option>
<?php //Isso aqui tá só pra dar o select, mas tem que alterar o html pra mostrar de acordo com o resultado da consulta
include 'conectar.php';
//$database = new $conn;
//$db = ;
$consulta_produto = "SELECT ID_COMANDA, VALOR_TOTAL from COMANDA ORDER BY ID_COMANDA desc";
//$resultado_consulta = mysqli_query($conn, $consulta_produto);
$result = $conn->query($consulta_produto);
echo "<option> Nova comanda </option>";
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<option>".$row["ID_COMANDA"]." - ".$row["VALOR_TOTAL"]."</option>";
}
} else {
echo "<option>0 results</option>";
}
?>
</select>
<form method="POST" id="quant" action="quantidadeproduto.php">
<input class="campo" type="text" placeholder="Quantidade" name="qt" id="qt" onchange="functionone()"></input>
</form>
<div class="infor">Valor: R$
</div>
</div>
<button class="item">Confirmar Compra</button><br>
<button class="item" onclick="window.location.href='\index.html'">Voltar</button>
</div>
<script>
function functionone(){
document.getElementByID("quant").reset();
}
</script>
</body>
</html>