-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmi-perfil.php
643 lines (608 loc) · 34.1 KB
/
mi-perfil.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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
<?php
session_start();
if (!isset($_SESSION["correo"]) || $_SESSION["correo"] == '') {
header("location:login_html.php");
die;
}
$id = $_SESSION["correo"];
$conexion = mysqli_connect("sql302.byethost13.com.comster.com", "b13_36951409", "benjamin5");
mysqli_select_db($conexion, "b13_36951409_proyecto");
$consulta2 = 'SELECT * FROM usuario';
$usuarios = mysqli_query($conexion, $consulta2);
while ($reg = mysqli_fetch_array($usuarios)) {
if ($id == $reg['correo'] || $id == $reg['nombre']) {
$_SESSION["id"] = $reg['id'];
break;
}
}
$consulta2 = "SELECT * FROM usuario WHERE `id` = '{$_SESSION["id"]}'";
$consulta2_1 = mysqli_query($conexion, $consulta2);
$_SESSION = mysqli_fetch_array($consulta2_1);
$usuario = $_SESSION;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Mi perfil</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="format-detection" content="telephone=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="author" content="">
<meta name="keywords" content="">
<meta name="description" content="">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@9/swiper-bundle.min.css">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="css/vendor.css">
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&family=Open+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
<style>
.container {
background-color: white;
width: 100%;
max-width: 95%;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
border-radius: 10px;
overflow: hidden;
}
.header {
display: flex;
align-items: center;
background-color: #f0f0f0;
padding: 20px;
}
.profile-pic {
width: 60px;
height: 60px;
border-radius: 50%;
background-color: #bbb;
display: flex;
justify-content: center;
align-items: center;
font-size: 24px;
color: white;
margin-right: 20px;
}
.user-info {
display: flex;
flex-direction: column;
}
.user-info h1 {
margin: 0;
font-size: 24px;
}
.user-info a {
color: #0073e6;
text-decoration: none;
margin-top: 5px;
}
.content {
display: flex;
justify-content: space-around;
padding: 20px;
}
.left-column, .right-column {
flex: 1;
margin: 10px;
}
.details-photo-wrapper {
display: flex;
justify-content: space-between;
gap: 20px;
width: 100%;
}
.header1 {
display: flex;
justify-content: space-between;
align-items: center;
}
.footer-buttons {
display: flex;
justify-content: space-between;
margin-top: 20px;
}
.footer-buttons form {
margin-left: 20px;
}
.card {
flex: 1;
padding: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-radius: 8px;
background-color: white;
}
.card h2 {
margin-top: 0;
}
.card p {
margin: 10px 0;
}
img {
max-width: 100%;
height: auto;
}
.cerrarsesion {
display: flex;
justify-content: right;
}
.user-details {
margin-right: 20px;
}
.profile-photo {
display: flex;
flex-direction: column;
justify-content: left;
}
.editar-foto {
display: flex;
justify-content: right;
margin-top: 20px;
}
</style>
</head>
<body>
<?php
$conexion = mysqli_connect("sql302.byethost13.com.comster.com", "b13_36951409", "benjamin5");
mysqli_select_db($conexion, "b13_36951409_proyecto");
$consulta1='SELECT * FROM productos';
$productos= mysqli_query($conexion, $consulta1);; ?>
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<defs>
<symbol xmlns="http://www.w3.org/2000/svg" id="link" viewBox="0 0 24 24">
<path fill="currentColor" d="M12 19a1 1 0 1 0-1-1a1 1 0 0 0 1 1Zm5 0a1 1 0 1 0-1-1a1 1 0 0 0 1 1Zm0-4a1 1 0 1 0-1-1a1 1 0 0 0 1 1Zm-5 0a1 1 0 1 0-1-1a1 1 0 0 0 1 1Zm7-12h-1V2a1 1 0 0 0-2 0v1H8V2a1 1 0 0 0-2 0v1H5a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V6a3 3 0 0 0-3-3Zm1 17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-9h16Zm0-11H4V6a1 1 0 0 1 1-1h1v1a1 1 0 0 0 2 0V5h8v1a1 1 0 0 0 2 0V5h1a1 1 0 0 1 1 1ZM7 15a1 1 0 1 0-1-1a1 1 0 0 0 1 1Zm0 4a1 1 0 1 0-1-1a1 1 0 0 0 1 1Z"/>
</symbol>
<symbol xmlns="http://www.w3.org/2000/svg" id="arrow-right" viewBox="0 0 24 24">
<path fill="currentColor" d="M17.92 11.62a1 1 0 0 0-.21-.33l-5-5a1 1 0 0 0-1.42 1.42l3.3 3.29H7a1 1 0 0 0 0 2h7.59l-3.3 3.29a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l5-5a1 1 0 0 0 .21-.33a1 1 0 0 0 0-.76Z"/>
</symbol>
<symbol xmlns="http://www.w3.org/2000/svg" id="category" viewBox="0 0 24 24">
<path fill="currentColor" d="M19 5.5h-6.28l-.32-1a3 3 0 0 0-2.84-2H5a3 3 0 0 0-3 3v13a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-10a3 3 0 0 0-3-3Zm1 13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-13a1 1 0 0 1 1-1h4.56a1 1 0 0 1 .95.68l.54 1.64a1 1 0 0 0 .95.68h7a1 1 0 0 1 1 1Z"/>
</symbol>
<symbol xmlns="http://www.w3.org/2000/svg" id="calendar" viewBox="0 0 24 24">
<path fill="currentColor" d="M19 4h-2V3a1 1 0 0 0-2 0v1H9V3a1 1 0 0 0-2 0v1H5a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3Zm1 15a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-7h16Zm0-9H4V7a1 1 0 0 1 1-1h2v1a1 1 0 0 0 2 0V6h6v1a1 1 0 0 0 2 0V6h2a1 1 0 0 1 1 1Z"/>
</symbol>
<symbol xmlns="http://www.w3.org/2000/svg" id="heart" viewBox="0 0 24 24">
<path fill="currentColor" d="M20.16 4.61A6.27 6.27 0 0 0 12 4a6.27 6.27 0 0 0-8.16 9.48l7.45 7.45a1 1 0 0 0 1.42 0l7.45-7.45a6.27 6.27 0 0 0 0-8.87Zm-1.41 7.46L12 18.81l-6.75-6.74a4.28 4.28 0 0 1 3-7.3a4.25 4.25 0 0 1 3 1.25a1 1 0 0 0 1.42 0a4.27 4.27 0 0 1 6 6.05Z"/>
</symbol>
<symbol xmlns="http://www.w3.org/2000/svg" id="plus" viewBox="0 0 24 24">
<path fill="currentColor" d="M19 11h-6V5a1 1 0 0 0-2 0v6H5a1 1 0 0 0 0 2h6v6a1 1 0 0 0 2 0v-6h6a1 1 0 0 0 0-2Z"/>
</symbol>
<symbol xmlns="http://www.w3.org/2000/svg" id="minus" viewBox="0 0 24 24">
<path fill="currentColor" d="M19 11H5a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2Z"/>
</symbol>
<symbol xmlns="http://www.w3.org/2000/svg" id="cart" viewBox="0 0 24 24">
<path fill="currentColor" d="M8.5 19a1.5 1.5 0 1 0 1.5 1.5A1.5 1.5 0 0 0 8.5 19ZM19 16H7a1 1 0 0 1 0-2h8.491a3.013 3.013 0 0 0 2.885-2.176l1.585-5.55A1 1 0 0 0 19 5H6.74a3.007 3.007 0 0 0-2.82-2H3a1 1 0 0 0 0 2h.921a1.005 1.005 0 0 1 .962.725l.155.545v.005l1.641 5.742A3 3 0 0 0 7 18h12a1 1 0 0 0 0-2Zm-1.326-9l-1.22 4.274a1.005 1.005 0 0 1-.963.726H8.754l-.255-.892L7.326 7ZM16.5 19a1.5 1.5 0 1 0 1.5 1.5a1.5 1.5 0 0 0-1.5-1.5Z"/>
</symbol>
<symbol xmlns="http://www.w3.org/2000/svg" id="check" viewBox="0 0 24 24">
<path fill="currentColor" d="M18.71 7.21a1 1 0 0 0-1.42 0l-7.45 7.46l-3.13-3.14A1 1 0 1 0 5.29 13l3.84 3.84a1 1 0 0 0 1.42 0l8.16-8.16a1 1 0 0 0 0-1.47Z"/>
</symbol>
<symbol xmlns="http://www.w3.org/2000/svg" id="trash" viewBox="0 0 24 24">
<path fill="currentColor" d="M10 18a1 1 0 0 0 1-1v-6a1 1 0 0 0-2 0v6a1 1 0 0 0 1 1ZM20 6h-4V5a3 3 0 0 0-3-3h-2a3 3 0 0 0-3 3v1H4a1 1 0 0 0 0 2h1v11a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3V8h1a1 1 0 0 0 0-2ZM10 5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v1h-4Zm7 14a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V8h10Zm-3-1a1 1 0 0 0 1-1v-6a1 1 0 0 0-2 0v6a1 1 0 0 0 1 1Z"/>
</symbol>
<symbol xmlns="http://www.w3.org/2000/svg" id="star-outline" viewBox="0 0 15 15">
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M7.5 9.804L5.337 11l.413-2.533L4 6.674l2.418-.37L7.5 4l1.082 2.304l2.418.37l-1.75 1.793L9.663 11L7.5 9.804Z"/>
</symbol>
<symbol xmlns="http://www.w3.org/2000/svg" id="star-solid" viewBox="0 0 15 15">
<path fill="currentColor" d="M7.953 3.788a.5.5 0 0 0-.906 0L6.08 5.85l-2.154.33a.5.5 0 0 0-.283.843l1.574 1.613l-.373 2.284a.5.5 0 0 0 .736.518l1.92-1.063l1.921 1.063a.5.5 0 0 0 .736-.519l-.373-2.283l1.574-1.613a.5.5 0 0 0-.283-.844L8.921 5.85l-.968-2.062Z"/>
</symbol>
<symbol xmlns="http://www. w3.org/2000/svg" id="search" viewBox="0 0 24 24">
<path fill="currentColor" d="M21.71 20.29L18 16.61A9 9 0 1 0 16.61 18l3.68 3.68a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.39ZM11 18a7 7 0 1 1 7-7a7 7 0 0 1-7 7Z"/>
</symbol>
<symbol xmlns="http://www.w3.org/2000/svg" id="user" viewBox="0 0 24 24">
<path fill="currentColor" d="M15.71 12.71a6 6 0 1 0-7.42 0a10 10 0 0 0-6.22 8.18a1 1 0 0 0 2 .22a8 8 0 0 1 15.9 0a1 1 0 0 0 1 .89h.11a1 1 0 0 0 .88-1.1a10 10 0 0 0-6.25-8.19ZM12 12a4 4 0 1 1 4-4a4 4 0 0 1-4 4Z"/>
</symbol>
<symbol xmlns="http://www.w3.org/2000/svg" id="close" viewBox="0 0 15 15">
<path fill="currentColor" d="M7.953 3.788a.5.5 0 0 0-.906 0L6.08 5.85l-2.154.33a.5.5 0 0 0-.283.843l1.574 1.613l-.373 2.284a.5.5 0 0 0 .736.518l1.92-1.063l1.921 1.063a.5.5 0 0 0 .736-.519l-.373-2.283l1.574-1.613a.5.5 0 0 0-.283-.844L8.921 5.85l-.968-2.062Z"/>
</symbol>
</defs>
</svg>
<!-- EMPIEZA SITIO -->
<div class="preloader-wrapper">
<div class="preloader">
</div>
</div>
<!-- CARRITO -->
<?php if (!isset($_SESSION['id']) || empty($_SESSION['id']) || $_SESSION['id'] == '') { ?>
<div class="offcanvas offcanvas-end" data-bs-scroll="true" tabindex="-1" id="offcanvasCart" aria-labelledby="My Cart">
<div class="offcanvas-header justify-content-center">
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<div class="order-md-last">
<h4 class="d-flex justify-content-between align-items-center mb-3">
<span class="text-primary">Tu Carrito</span>
<span class="badge bg-primary rounded-pill">0</span>
</h4>
<?php
echo "<h3>Para ver los productos que tienes en el carrito debes iniciar sesión en tu cuenta de <strong>PlayONRetro.</strong> </h3>";
echo '<br><a class="btn btn-secondary" data-bs-dismiss="offcanvas" aria-label="Close" >Volver a la página <strong>PRINCIPAL</strong>.</a>';
echo '<a href="login_html.php" class="btn btn-success">Iniciar Sesión</a>';
echo '<br><br><label for="no-tener">¿No tienes una cuenta?</label><a href="signup_html.php" class="btn btn-info"> Registrarse </a>';; ?>
</div>
</div>
</div> <?php } else {?>
<div class="offcanvas offcanvas-end" data-bs-scroll="true" tabindex="-1" id="offcanvasCart" aria-labelledby="My Cart">
<div class="offcanvas-header justify-content-center">
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<div class="order-md-last">
<h4 class="d-flex justify-content-between align-items-center mb-3">
<span class="text-primary">Tu Carrito</span>
<?php
$usuario_id = $_SESSION['id'];
$carrito_query = "SELECT * FROM carrito WHERE usuario_id = $usuario_id";
$carrito_result = mysqli_query($conexion, $carrito_query);
$cantidad_total= 0;
while ($carrito2 = mysqli_fetch_array($carrito_result)) {
$cantidad_total= $cantidad_total + $carrito2['cantidad'];
}
?>
<span class="badge bg-primary rounded-pill"> <?php echo $cantidad_total; ?> </span>
</h4>
<ul class="list-group mb-3">
<?php
$usuario_id = $_SESSION['id'];
$carrito_query = "SELECT * FROM carrito WHERE usuario_id = $usuario_id";
$carrito_result = mysqli_query($conexion, $carrito_query);
$cantidad_total= 0;
$total_carrito= 0;
while ($carrito = mysqli_fetch_array($carrito_result)) {
$producto_id = $carrito['producto_id'];
$producto_query = "SELECT * FROM productos WHERE id = $producto_id";
$producto_result = mysqli_query($conexion, $producto_query);
while ($producto = mysqli_fetch_array($producto_result)) {
?>
<form method="post" action="carrito_borrar.php">
<li class="list-group-item d-flex justify-content-between lh-sm">
<div>
<h6 class="my-0"><?php echo $producto['nombre']; ?></h6>
<small class="text-body-secondary"><?php echo $producto['descripcion']; ?></small>
</div>
<span class="text-body-secondary"><?php echo "$" . $producto['precio'] . "x" . "<strong>" . $carrito['cantidad'] . "</strong>"; ?></span>
<?php $total_carrito = $total_carrito + ($producto['precio'] * $carrito['cantidad']); ?>
<input type="hidden" name="producto_id" value="<?php echo $producto_id; ?>">
<button type="submit" class="btn btn-danger">Borrar</button>
</li>
</form>
<?php
}
}
?>
</ul>
<label for="total"><?php echo "<strong>TOTAL a pagar: </strong>" . "$" . $total_carrito; ?></label>
<button class="w-100 btn btn-primary btn-lg" type="submit">Comprar</button>
</div>
</div>
</div> <?php }; ?>
<!-- SOLO CELU -->
<!-- LINK BUSQUEDA CELU-->
<div class="offcanvas offcanvas-end" data-bs-scroll="true" tabindex="-1" id="offcanvasSearch" aria-labelledby="Search">
<div class="offcanvas-header justify-content-center">
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<div class="order-md-last">
<h4 class="d-flex justify-content-between align-items-center mb-3">
<span class="text-primary">Buscar</span>
</h4>
<form id="search-form" class="w-100 d-flex align-items-center" action="busqueda.php" method="get">
<select name="tipo" class="form-select border-0 bg-transparent me-2">
<option value="">Todas las categorías</option>
<option value="Consolas">Consolas</option>
<option value="Juegos">Juegos</option>
<option value="Ropa">Ropa</option>
<option value="Accesorios">Accesorios</option>
</select>
<br>
<input type="hidden" name="ordenar_por" value="ORDER BY estrellas DESC">
<input name="nombre" type="text" class="form-control border-0 bg-transparent me-2" placeholder="¡Puedes buscar entre más de 60 productos!" />
<br>
<button type="submit" class="btn border-0 bg-transparent p-0">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path fill="currentColor" d="M21.71 20.29L18 16.61A9 9 0 1 0 16.61 18l3.68 3.68a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.39ZM11 18a7 7 0 1 1 7-7a7 7 0 0 1-7 7Z"/>
</svg>
</button>
</form>
</div>
</div>
</div>
<!-- LOGO -->
<header>
<div class="container-fluid">
<div class="row py-3 border-bottom">
<div class="col-sm-4 col-lg-1 text-center text-sm-start">
<div class="main-logo">
<a href="index.php">
<img src="images/logo.png" alt="logo" class="img-fluid">
</a>
</div>
</div>
<!-- BUSCADOR -->
<div class="col-sm-6 offset-sm-2 offset-md-0 col-lg-6 d-none d-lg-block">
<div class="search-bar d-flex bg-light p-2 my-2 rounded-4 align-items-center">
<form id="search-form" class="w-100 d-flex align-items-center" action="busqueda.php" method="get">
<select name="tipo" class="form-select border-0 bg-transparent me-2">
<option value="">Todas las categorías</option>
<option value="Consolas">Consolas</option>
<option value="Juegos">Juegos</option>
<option value="Ropa">Ropa</option>
<option value="Accesorios">Accesorios</option>
</select>
<input type="hidden" name="ordenar_por" value="ORDER BY estrellas DESC">
<input name="nombre" type="text" class="form-control border-0 bg-transparent me-2" placeholder="¡Puedes buscar entre más de 60 productos!" />
<button type="submit" class="btn border-0 bg-transparent p-0">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path fill="currentColor" d="M21.71 20.29L18 16.61A9 9 0 1 0 16.61 18l3.68 3.68a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.39ZM11 18a7 7 0 1 1 7-7a7 7 0 0 1-7 7Z"/>
</svg>
</button>
</form>
</div>
</div>
<!-- INFO CONTACTO -->
<div class="col-sm-8 col-lg-5 d-flex justify-content-end gap-5 align-items-center mt-4 mt-sm-0 justify-content-center justify-content-sm-end">
<div class="support-box text-end d-none d-xl-block">
<span class="fs-6 text-muted">¿Te ayudamos?</span>
<a href="https://wa.me/+542915341257" target="_blank">
<h5 class="mb-0">+54 - 9 2915341257</h5>
</a>
</div>
<ul class="d-flex justify-content-end list-unstyled m-0">
<!-- FOTO PERFIL -->
<li>
<a href="mi-perfil.php" class="rounded-circle bg-light p-2 mx-1">
<?php if (!isset($usuario['icono']) || empty($usuario['icono'])) {?>
<!-- Si no hay un icono en la sesión, se muestra el icono por defecto -->
<svg width="24" height="24" viewBox="0 0 24 24"><use xlink:href="#user"></use></svg>
<?php } else { ?>
<img src="data:image/png;base64, <?php echo base64_encode($usuario['icono']); ?>" alt="NA" width="30px" height="30px">
<?php }; ?>
</a>
</li>
<!-- FAVORITOS-->
<li>
<a href="favoritos_html.php" class="rounded-circle bg-light p-2 mx-1">
<svg width="24" height="24" viewBox="0 0 24 24"><use xlink:href="#heart"></use></svg>
</a>
</li>
<!-- SOLO CELU -->
<!-- CARRITO -->
<li class="d-lg-none">
<a href="#" class="rounded-circle bg-light p-2 mx-1" data-bs-toggle="offcanvas" data-bs-target="#offcanvasCart" aria-controls="offcanvasCart">
<svg width="24" height="24" viewBox="0 0 24 24"><use xlink:href="#cart"></use></svg>
</a>
</li>
<!-- BUSQUEDA -->
<li class="d-lg-none">
<a href="#" class="rounded-circle bg-light p-2 mx-1" data-bs-toggle="offcanvas" data-bs-target="#offcanvasSearch" aria-controls="offcanvasSearch">
<svg width="24" height="24" viewBox="0 0 24 24"><use xlink:href="#search"></use></svg>
</a>
</li>
</ul>
<!-- CARRITO -->
<div class="cart text-end d-none d-lg-block dropdown">
<button class="border-0 bg-transparent d-flex flex-column gap-2 lh-1" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasCart" aria-controls="offcanvasCart">
<span class="fs-6 text-muted dropdown-toggle">Tu Carrito</span>
<span class="cart-total fs-5 fw-bold"><?php if (!isset($_SESSION['id']) || empty($_SESSION['id']) || $_SESSION['id'] == '') { echo "$ " . 0 . ".00"; } else echo "$ " . $total_carrito . ".00";?> </span>
</button>
</div>
<!-- BOTON INICIAR SESION -->
<?php if (isset($_SESSION['id'])) { ?>
<a class="btn btn-dark btn-lg" href="cerrarsesion.php">Cerrar Sesión</a>
<?php } else { ?>
<a class="btn btn-dark btn-lg" href="login_html.php">Iniciar Sesion</a>
<?php }; ?>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row py-3">
<div class="d-flex justify-content-center justify-content-sm-between align-items-center">
<nav class="main-menu d-flex navbar navbar-expand-lg">
<button class="navbar-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasNavbar"
aria-controls="offcanvasNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="offcanvas offcanvas-end" tabindex="-1" id="offcanvasNavbar" aria-labelledby="offcanvasNavbarLabel">
<div class="offcanvas-header justify-content-center">
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<!-- NAVEGADOR -->
<div class="offcanvas-body">
<ul class="navbar-nav justify-content-end menu-list list-unstyled d-flex gap-md-3 mb-0">
<li class="nav-item active">
<a href="consolas.php" class="nav-link">Consolas</a>
</li>
<li class="nav-item dropdown">
<a href="juegos.php" class="nav-link">Juegos</a>
</li>
<li class="nav-item">
<a href="ropa.php" class="nav-link">Ropa</a>
</li>
<li class="nav-item">
<a href="accesorios.php" class="nav-link">Accesorios</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" role="button" id="pages" data-bs-toggle="dropdown" aria-expanded="false">Marcas</a>
<ul class="dropdown-menu" aria-labelledby="pages">
<form method="get" action="marca.php">
<?php
// La consulta SQL
$sql = "SELECT DISTINCT marca FROM productos";
// Ejecutar la consulta
$result = $conexion->query($sql);
while ($row = $result->fetch_assoc()) {
$marca2 = $row["marca"];
// Contar el número de productos para cada marca
$consulta2 = "SELECT COUNT(*) AS total FROM productos WHERE marca = '$marca2'";
$resultado2 = $conexion->query($consulta2);
$datos2 = $resultado2->fetch_assoc();
$numeromarca = $datos2['total'];
echo "<li><button type='submit' name='marca' value='$marca2' class='dropdown-item'>$marca2 ($numeromarca)</button></li>";
}
?>
</form>
<li><a href="playonretro.php" class="dropdown-item">PlayONRetro<span class="badge bg-success text-dark ms-2">Propia</span></a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
</div>
</div>
</div>
</header>
<section>
<br>
<div class="container">
<div class="header">
<div class="profile-pic">
<?php if (!isset($usuario['icono']) || empty($usuario['icono'])): ?>
<use xlink:href="#user"></use>
<?php else: ?>
<image xlink:href="data:image/png;base64,<?php echo base64_encode($usuario['icono']); ?>" width="24" height="24" />
<?php endif; ?>
</svg>
</a>
<img src="data:image/png;base64, <?php echo base64_encode($usuario['icono']); ?>" alt="NA">
</div>
<div class="user-info">
<h1>
<?php echo $usuario['nombre']; ?>
</h1>
<p><?php echo $usuario['correo']; ?></p>
</div>
</div>
<div class="content">
<div class="details-photo-wrapper">
<div class="card user-details">
<div class="header1">
<h2>Detalles de usuario</h2>
<a href="modificar_user_html.php" class="btn btn-primary">Editar Perfil</a>
</div>
<p><strong>Nombre:</strong>
<?php
if ($usuario['nombre'] == '' || $usuario['nombre'] == null) {
echo 'Nombre no definido';
} else {
echo $usuario['nombre'];
}
?>
</p>
<p><strong>Dirección de correo:</strong>
<?php echo $usuario['correo']; ?>
</p>
<p><strong>País:</strong>
<?php
if ($usuario['pais'] == '' || $usuario['pais'] == null) {
echo 'País no definido';
} else {
echo $usuario['pais'];
}
?>
</p>
<p><strong>Ciudad:</strong>
<?php
if ($usuario['ciudad'] == '' || $usuario['ciudad'] == null) {
echo 'Ciudad no definida';
} else {
echo $usuario['ciudad'];
}
?>
</p>
<br>
<div class="footer-buttons">
<?php if ($_SESSION['admin']) { ?>
<a class="btn btn-dark btn-lg" href="crud.php">Administrar</a>
<?php }; ?>
<form action="cerrarsesion.php" method="post">
<button type="submit" class="btn btn-dark btn-lg">Cerrar Sesión</button>
</form>
</div>
</div>
<div class="card profile-photo">
<h2>Foto de perfil</h2>
<?php if (!isset($usuario['icono']) || empty($usuario['icono'])) {?>
<!-- Si no hay un icono en la sesión, se muestra el icono por defecto -->
<svg width="24" height="24" viewBox="0 0 24 24"><use xlink:href="#user"></use></svg>
<?php } else { ?>
<img src="data:image/png;base64, <?php echo base64_encode($usuario['icono']); ?>" alt="NA" width="200px" height="200px">
<?php }; ?>
<div class="editar-foto">
<form method="POST" action="icono.php" enctype="multipart/form-data">
<input type="file" name="imagen" placeholder="Imagen">
<input type="submit" name="submit" value="Ingresar">
</form>
</div>
</div>
</div>
</div>
<footer class="py-5">
<div class="container-fluid">
<div class="row">
<div class="col-lg-3 col-md-6 col-sm-6">
<div class="footer-menu">
<img src="images/logo.png" alt="logo">
<div class="social-links mt-5">
<ul class="d-flex list-unstyled gap-2">
<li>
<a href="https://www.facebook.com/benja.bohn/ttps://www.facebook.com/benja.bohn/" class="btn btn-outline-light">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"><path fill="currentColor" d="M15.12 5.32H17V2.14A26.11 26.11 0 0 0 14.26 2c-2.72 0-4.58 1.66-4.58 4.7v2.62H6.61v3.56h3.07V22h3.68v-9.12h3.06l.46-3.56h-3.52V7.05c0-1.05.28-1.73 1.76-1.73Z"/></svg>
</a>
</li>
<li>
<a href="https://x.com/Bencraft0ttps://x.com/Bencraft0" class="btn btn-outline-light">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"><path fill="currentColor" d="M22.991 3.95a1 1 0 0 0-1.51-.86a7.48 7.48 0 0 1-1.874.794a5.152 5.152 0 0 0-3.374-1.242a5.232 5.232 0 0 0-5.223 5.063a11.032 11.032 0 0 1-6.814-3.924a1.012 1.012 0 0 0-.857-.365a.999.999 0 0 0-.785.5a5.276 5.276 0 0 0-.242 4.769l-.002.001a1.041 1.041 0 0 0-.496.89a3.042 3.042 0 0 0 .027.439a5.185 5.185 0 0 0 1.568 3.312a.998.998 0 0 0-.066.77a5.204 5.204 0 0 0 2.362 2.922a7.465 7.465 0 0 1-3.59.448A1 1 0 0 0 1.45 19.3a12.942 12.942 0 0 0 7.01 2.061a12.788 12.788 0 0 0 12.465-9.363a12.822 12.822 0 0 0 .535-3.646l-.001-.2a5.77 5.77 0 0 0 1.532-4.202Zm-3.306 3.212a.995.995 0 0 0-.234.702c.01.165.009.331.009.488a10.824 10.824 0 0 1-.454 3.08a10.685 10.685 0 0 1-10.546 7.93a10.938 10.938 0 0 1-2.55-.301a9.48 9.48 0 0 0 2.942-1.564a1 1 0 0 0-.602-1.786a3.208 3.208 0 0 1-2.214-.935q.224-.042.445-.105a1 1 0 0 0-.08-1.943a3.198 3.198 0 0 1-2.25-1.726a5.3 5.3 0 0 0 .545.046a1.02 1.02 0 0 0 .984-.696a1 1 0 0 0-.4-1.137a3.196 3.196 0 0 1-1.425-2.673c0-.066.002-.133.006-.198a13.014 13.014 0 0 0 8.21 3.48a1.02 1.02 0 0 0 .817-.36a1 1 0 0 0 .206-.867a3.157 3.157 0 0 1-.087-.729a3.23 3.23 0 0 1 3.226-3.226a3.184 3.184 0 0 1 2.345 1.02a.993.993 0 0 0 .921.298a9.27 9.27 0 0 0 1.212-.322a6.681 6.681 0 0 1-1.026 1.524Z"/></svg>
</a>
</li>
<li>
<a href="www.youtube.com/@BENCRAFT0ww.youtube.com/@BENCRAFT0" class="btn btn-outline-light">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"><path fill="currentColor" d="M23 9.71a8.5 8.5 0 0 0-.91-4.13a2.92 2.92 0 0 0-1.72-1A78.36 78.36 0 0 0 12 4.27a78.45 78.45 0 0 0-8.34.3a2.87 2.87 0 0 0-1.46.74c-.9.83-1 2.25-1.1 3.45a48.29 48.29 0 0 0 0 6.48a9.55 9.55 0 0 0 .3 2a3.14 3.14 0 0 0 .71 1.36a2.86 2.86 0 0 0 1.49.78a45.18 45.18 0 0 0 6.5.33c3.5.05 6.57 0 10.2-.28a2.88 2.88 0 0 0 1.53-.78a2.49 2.49 0 0 0 .61-1a10.58 10.58 0 0 0 .52-3.4c.04-.56.04-3.94.04-4.54ZM9.74 14.85V8.66l5.92 3.11c-1.66.92-3.85 1.96-5.92 3.08Z"/></svg>
</a>
</li>
<li>
<a href="https://www.instagram.com/benja.bohn/ttps://www.instagram.com/benja.bohn/" class="btn btn-outline-light">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"><path fill="currentColor" d="M17.34 5.46a1.2 1.2 0 1 0 1.2 1.2a1.2 1.2 0 0 0-1.2-1.2Zm4.6 2.42a7.59 7.59 0 0 0-.46-2.43a4.94 4.94 0 0 0-1.16-1.77a4.7 4.7 0 0 0-1.77-1.15a7.3 7.3 0 0 0-2.43-.47C15.06 2 14.72 2 12 2s-3.06 0-4.12.06a7.3 7.3 0 0 0-2.43.47a4.78 4.78 0 0 0-1.77 1.15a4.7 4.7 0 0 0-1.15 1.77a7.3 7.3 0 0 0-.47 2.43C2 8.94 2 9.28 2 12s0 3.06.06 4.12a7.3 7.3 0 0 0 .47 2.43a4.7 4.7 0 0 0 1.15 1.77a4.78 4.78 0 0 0 1.77 1.15a7.3 7.3 0 0 0 2.43.47C8.94 22 9.28 22 12 22s3.06 0 4.12-.06a7.3 7.3 0 0 0 2.43-.47a4.7 4.7 0 0 0 1.77-1.15a4.85 4.85 0 0 0 1.16-1.77a7.59 7.59 0 0 0 .46-2.43c0-1.06.06-1.4.06-4.12s0-3.06-.06-4.12ZM20.14 16a5.61 5.61 0 0 1-.34 1.86a3.06 3.06 0 0 1-.75 1.15a3.19 3.19 0 0 1-1.15.75a5.61 5.61 0 0 1-1.86.34c-1 .05-1.37.06-4 .06s-3 0-4-.06a5.73 5.73 0 0 1-1.94-.3a3.27 3.27 0 0 1-1.1-.75a3 3 0 0 1-.74-1.15a5.54 5.54 0 0 1-.4-1.9c0-1-.06-1.37-.06-4s0-3 .06-4a5.54 5.54 0 0 1 .35-1.9A3 3 0 0 1 5 5a3.14 3.14 0 0 1 1.1-.8A5.73 5.73 0 0 1 8 3.86c1 0 1.37-.06 4-.06s3 0 4 .06a5.61 5.61 0 0 1 1.86.34a3.06 3.06 0 0 1 1.19.8a3.06 3.06 0 0 1 .75 1.1a5.61 5.61 0 0 1 .34 1.9c.05 1 .06 1.37.06 4s-.01 3-.06 4ZM12 6.87A5.13 5.13 0 1 0 17.14 12A5.12 5.12 0 0 0 12 6.87Zm0 8.46A3.33 3.33 0 1 1 15.33 12A3.33 3.33 0 0 1 12 15.33Z"/></svg>
</a>
</li>
<li>
<a href="https://wa.me/+542915341257ttps://wa.me/+542915341257" class="btn btn-outline-light">
<img "rchttps:s//ssvgsilhiccm/svm/sv71331.071331.svg" width="16" heighwspp
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 col-sm-6">
<div class="footer-menu">
<h5 class="widget-title">Suscribete</h5>
<p>Suscríbase a nuestro boletín para recibir información actualizada sobre nuestras grandes ofertas.</p>
<form class="d-flex mt-3 gap-0" role="newsletter">
<input class="form-control rounded-start rounded-0 bg-light" type="email" placeholder="Correo electronico" aria-label="Email Address">
<button class="btn btn-dark rounded-end rounded-0" type="submit">Suscribirse</button>
</form>
</div>
</div>
</div>
</div>
</footer>
<div id="footer-bottom">
<div class="container-fluid">
<div class="row">
<div class="col-md-6 copyright">
<p>©2024 PlayONRetro. Todos los derechos reservados.</p>
</div>
</div>
</div>
</div>
<script src="js/jquery-1.11.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/swiper@9/swiper-bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
<script src="js/plugins.js"></script>
<script src="js/script.js"></script>
</body>
</html>