-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
283 lines (237 loc) · 7.36 KB
/
index.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
<?php
@session_start();
require 'Conexion.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>BC |</title>
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/font-awesome.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="slick/slick.css"/>
<link rel="stylesheet" type="text/css" href="slick/slick-theme.css"/>
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/app.js"></script>
<script src="js/scripts.js"></script>
</head>
<body>
<header>
<div class="header-main">
<?php
if (empty($_SESSION['sesion'])) {
?>
<div class="bienvenida">
<strong>Bienvenido</strong>, <a href="login.php" title="Iniciar sesión">Iniciar sesión</a> o <a href="login.php" title="Regístrate">Regístrate</a> para empezar a comprar.
</div>
<?php
}else{
?>
<div class="bienvenida">
<strong>Bienvenido, </strong><?php echo $_SESSION['sesion'] ; ?>
<div class="cart">
<form action="" method="POST">
<button name='ir' class='btn btn-secondary'>Ver pedidos</button>
<button type='submit' class='btn btn-secondary' name='cerr'>Cerrar sesion</button>
</form>
</div>
</div>
<?php
}
if (isset($_POST['cerr'])) {
?>
<script>alert('Cerrando session')
location.href='index.php'
</script>;
<?php
unset( $_SESSION["sesion"] );
}
if (isset($_POST['ir'])) {
?>
<script>
location.href='vercompras.php'
</script>;
<?php
}
?>
</div>
<div class="header">
<div class="logo">
<img src="img/descarga.png" height="150" alt="">
</div>
<div class="link">
<a href="historia.php">¿Quienes Somos?</a>
<a href="servicios.php">Servicios</a>
<a href="preguntas.php">Preguntas Frecuentes</a>
<a href="contacto.php">Contactos</a>
</div>
<div class="redes">
<a target="_blank" href="#"><img src="./img/facebook-ico.png"></a>
<a target="_blank" href="#"><img src="./img/twitter-ico.png"></a>
<a target="_blank" href="#"><img src="./img/instagram-ico.png"></a>
</div>
</div>
<nav>
<div class="menu-icon">
<i class="fa fa-bars fa-2x"></i>
</div>
<div class="menu">
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="apple.php">Apple</a></li>
<li><a href="samsung.php">Samsung</a></li>
<li><a href="accesorios.php">Accesorios</a></li>
<li><a href="especiales.php">Especiales</a></li>
<li><a href="otros.php">Otros</a></li>
<li><a href="compras.php" title="Compras"><img src="img/bolsa2.png" alt=""></a></li>
</ul>
</div>
</nav>
</header>
<!--Menu-toggle button-->
<script type="text/javascript">
$(document).ready(function() {
$(".menu-icon").on("click", function() {
$("nav ul").toggleClass("showing");
});
});
</script>
<div class="slideshow">
<ul class="slider">
<li>
<img src="img/1.jpg" alt="">
</li>
<li>
<img src="img/2.jpg" alt="">
</li>
<li>
<img src="img/3.jpg" alt="">
</li>
<li>
<img src="img/4.jpg" alt="">
</li>
</ul>
<ol class="pagination"></ol>
<div class="left">
<span class="fa fa-chevron-left"></span>
</div>
<div class="right">
<span class="fa fa-chevron-right"></span>
</div>
</div>
<div class="box-main">
<div class="box-cabezera">
<h2 class="cabezera">Especiales</h2>
</div>
<div class="box-contenido">
<?php
$sql="SELECT * FROM productos WHERE Agotado='No' AND Especial='On'";
$result = $con->query($sql);
?>
<div class="responsive">
<?php
while ($f=mysqli_fetch_array($result)) {
$desc=$f['Precio']*$f['Descuento'];
?>
<div>
<div class="card">
<img class="sobre" src="./img/descuento.png" width="75" height="75" />
<div class="imagen"><a href="detalle-producto/456456456<?php echo $f['Id']; ?>"><img width="180" height="175" src="img/<?php echo $f['Imagen'];?>"></a></div>
<div class="card-body">
<div class="nombre"><?php echo substr($f['Nombre'], 0, 12).'...'; ?></div>
<div class="precio">RD$ <?php echo ($f['Precio']-$desc); ?></div>
</div>
<div class="ifc">
<center>
<a style="display: inline-block;" data-id='<?php echo $f['Id']; ?>' class="button-comprar" ><img src="img/bolsa.png" title="Comprar" alt=""></a>
<a style="display: inline-block;"class="button" href="detalle-producto/456456456<?php echo $f['Id']; ?>"><img src="img/plus.png" title="Ver mas" alt=""></a>
</center>
</div>
</div>
<br><br>
</div>
<?php
}
?></div>
</div>
<?php
$sql="SELECT * FROM productos ORDER BY Id DESC LIMIT 31";
$result = $con->query($sql);
?>
<div class="box-cabezera">
<h2 class="cabezera">Últimos Productos</h2>
</div>
<div class="box-contenido">
<div class="responsive" >
<?php
while ($f=mysqli_fetch_array($result)) {
$desc=$f['Precio']*$f['Descuento'];
?>
<div>
<div class="card">
<div class="imagen"><a href="detalle-producto/456456456<?php echo $f['Id']; ?>"><img width="180" height="175" src="img/<?php echo $f['Imagen'];?>"></a></div>
<div class="card-body">
<div class="nombre"><?php echo substr($f['Nombre'], 0, 12).'...'; ?></div>
<div class="precio">RD$ <?php echo ($f['Precio']-$desc); ?></div>
</div>
<div class="ifc">
<center>
<a style="display: inline-block;" data-id='<?php echo $f['Id']; ?>' class="button-comprar" ><img src="img/bolsa.png" title="Comprar" alt=""></a>
<a style="display: inline-block;"class="button"href="detalle-producto/456456456<?php echo $f['Id']; ?>"><img src="img/plus.png" title="Ver mas" alt="Ver mas"></a>
</center>
</div>
</div>
<br>
</div>
<?php
}
?>
</div>
</div>
</div>
<script type="text/javascript" src="slick/slick.min.js"></script>
<script type="text/javascript">
$('.responsive').slick({
dots: false,
infinite: false,
speed: 1000,
slidesToShow: 4,
slidesToScroll: 4,
responsive: [
{
breakpoint: 1024,
settings: {
slidesToShow: 2,
slidesToScroll: 2,
infinite: false,
dots: false
}
},
{
breakpoint: 600,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
},
{
breakpoint: 480,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
]
});
</script>
<footer>
<div class="footer" id="footer">
<div class="copy">
**** | Copyright 2018 <br>
Powered by <a href="">Luis Martinez</a>
</div>
</div>
</footer>
</body>
</html>