-
Notifications
You must be signed in to change notification settings - Fork 0
/
gallery.php
256 lines (229 loc) · 6.5 KB
/
gallery.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
<?php
include 'session.php';
if(isset($_GET['produto']) && isset($_GET['nome_produto']) && isset($_GET['preco_produto'])){
$_SESSION['idProdutoCarrinho'] = $_GET['produto'];
$_SESSION['nomeProduto']=$_GET['nome_produto'];
$_SESSION['precoProduto']=$_GET['preco_produto'];
}
?>
<!--
Author: W3layouts
Author URL: http://w3layouts.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
-->
<!DOCTYPE HTML>
<html>
<head>
<?php
function chamarprodutopf(){
conectar();
$sql = "select * from produto where tipo = 'Prato'";
$consulta = mysql_query($sql);
if(count($consulta)>0){
while($usuario = mysql_fetch_row($consulta)){
$id = $usuario[0];
$nome = $usuario[1];
$valor = $usuario[2];
$tipo = $usuario[3];
$desc = $usuario[4];
$img = $usuario[5];
echo "<li name='licardapio' style='border:ridge; margin-right: 10px;'>";
echo "<h3 style='margin: 0px 5px'>$nome</h3>";
echo "<img style='width:205px; height:125px' src=$img>";
echo "<p style='margin: 0px 5px'>$desc</p>";
echo "<h3 style='margin: 0px 5px'>R$ $valor</h3>";
echo "<form>";
echo "<input type='radio' name='guarni' value='ovo' checked>Ovo Frito";
echo "<br>";
echo "<input type='radio' name='guarni' value='batata'>Batata Frita";
echo "<br>";
echo "<input type='radio' name='guarni' value='omelete'>Omelete";
echo "<br>";
echo "<input type='hidden' name='produto' value='$id'></input>";
echo "<input type='hidden' name='nome_produto' value='$nome'></input>";
echo "<input type='hidden' name='preco_produto' value='$valor'></input>";
echo "<input style='margin: 0px 5px' type='submit' name='#' value='Comprar'>";
echo "</form>";
echo "</li>";
}
}
mysql_close();
}
?>
<?php
function chamarprodutolanche(){
conectar();
$sql = "select * from produto where tipo = 'Lanche'";
$consulta = mysql_query($sql);
if(count($consulta)>0){
while($usuario = mysql_fetch_row($consulta)){
$id = $usuario[0];
$nome = $usuario[1];
$valor = $usuario[2];
$tipo = $usuario[3];
$desc = $usuario[4];
$img = $usuario[5];
echo "<li name='licardapio' style='border:ridge; margin-right: 10px;'>";
echo "<h3 style='margin: 0px 5px'>$nome</h3>";
echo "<img style='width:205px; height:125px' src=$img>";
echo "<p style='margin: 0px 5px'>$desc</p>";
echo "<h3 style='margin: 0px 5px'>R$ $valor</h3>";
echo "<form>";
echo "<input style='margin: 0px 5px' type='submit' name='#' value='Comprar'>";
echo "<input type='hidden' name='produto' value='$id'></input>";
echo "<input type='hidden' name='nome_produto' value='$nome'></input>";
echo "<input type='hidden' name='preco_produto' value='$valor'></input>";
echo "</form>";
echo "</li>";
}
}
mysql_close();
}
?>
<?php
function chamarprodutobebidas(){
conectar();
$sql = "select * from produto where tipo = 'Bebida'";
$consulta = mysql_query($sql);
if(count($consulta)>0){
while($usuario = mysql_fetch_row($consulta)){
$id = $usuario[0];
$nome = $usuario[1];
$valor = $usuario[2];
$tipo = $usuario[3];
$desc = $usuario[4];
$img = $usuario[5];
echo "<li name='licardapio' style='border:ridge; margin-right: 10px;'>";
echo "<h3 style='margin: 0px 5px'>$nome</h3>";
echo "<img style='width:205px; height:125px' src=$img>";
echo "<p style='margin: 0px 5px'>$desc</p>";
echo "<h3 style='margin: 0px 5px'>R$ $valor</h3>";
echo "<form>";
echo "<input style='margin: 0px 5px' type='submit' name='#' value='Comprar'>";
echo "<input type='hidden' name='produto' value='$id'></input>";
echo "<input type='hidden' name='nome_produto' value='$nome'></input>";
echo "<input type='hidden' name='preco_produto' value='$valor'></input>";
echo "</form>";
echo "</li>";
}
}
mysql_close();
}
?>
<?php
function chamarprodutocreditos(){
conectar();
$sql = "select * from produto where tipo = 'Crédito'";
$consulta = mysql_query($sql);
if(count($consulta)>0){
while($usuario = mysql_fetch_row($consulta)){
$id = $usuario[0];
$nome = $usuario[1];
$valor = $usuario[2];
$tipo = $usuario[3];
$desc = $usuario[4];
$img = $usuario[5];
echo "<li>";
echo "<h3>$nome</h3>";
echo "<img src=$img>";
echo "<p>$desc</p>";
echo "<h3>R$ $valor</h3>";
echo "</li>";
}
}
mysql_close();
}
?>
<title>Cantina Fatec Praia Grande | Cardápio</title>
<?php include 'head.php'; ?>
<link href='http://fonts.googleapis.com/css?family=Libre+Baskerville' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="js/jquery1.js"></script>
<script type="text/javascript" src="js/jquery.lightbox.js"></script>
<link rel="stylesheet" type="text/css" href="css/lightbox.css" media="screen" />
<script type="text/javascript">
$(function() {
$('.gallery a').lightBox();
});
</script>
<script>
$(document).ready(function(){
$("#botao1").click(function(){
$(".prato1").toggle();
});
});
</script>
<script>
$(document).ready(function(){
$("#botao2").click(function(){
$(".prato2").toggle();
});
});
</script>
<script>
$(document).ready(function(){
$("#botao3").click(function(){
$(".prato3").toggle();
});
});
</script>
<script>
$(document).ready(function(){
$("#botao4").click(function(){
$(".prato4").toggle();
});
});
</script>
</head>
<body>
<div class="wrap">
<?php include 'header.php'; ?>
<?php include 'menu.php'; ?>
<div class="main-body1">
<?php include 'menulateral.php'; ?>
<div class="titulo">
<h1>Cardápio</h1>
</div>
<br>
<div class="grids2"><button id="botao1">Pratos Feitos</button></div>
<div class="prato1" style="display:none">
<div class="grids">
<ul>
<?php chamarprodutopf(); ?>
</ul>
</div>
</div>
<div class="grids2"><button id="botao2">Lanches</button></div>
<div class="prato2" style="display:none">
<div class="grids">
<?php chamarprodutolanche(); ?>
</div>
</div>
<div class="grids2"><button id="botao3">Bebidas</button></div>
<div class="prato3" style="display:none">
<div class="grids">
<ul>
<?php chamarprodutobebidas(); ?>
</ul>
</div>
</div>
<div class="grids2"><button id="botao4"
style="margin-top: 0px;
width: 700px;
margin-bottom: 0px;
padding-bottom: 0px;
padding-top: 0px;
padding-right: 0px;
padding-left: 0px;
height: 0px;">=D</button></div>
<div class="prato4" style="display:none">
<div class="grids">
<?php chamarprodutocreditos(); ?>
</div>
</div>
</div>
<div class="clear"> </div>
<?php include 'footer.php'; ?>
</div>
</body>
</html>