forked from Rodolphus85/eCommercePaolo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
product.php
executable file
·95 lines (83 loc) · 3.71 KB
/
product.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
<?php
include_once 'datos_conexion.php';
$src_images = "images\\Products\\";
?>
<!doctype html>
<html lang="en">
<head>
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
<link href="index.css" rel="stylesheet">
<title>Producto</title>
</head>
<body id="body">
<!-- Header -->
<nav id="header" class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container">
<a class="navbar-brand" href="#">
Paolo's Commerce - PRODUCTO
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end" id="navbar">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link active" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Service</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Contact</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- /Header -->
<!-- Producto -->
<div id="contenedor-principal" class="container pt-5 mt-5 mb-2">
<?php
$conexion = mysqli_connect($data_connect['DB_HOST'], $data_connect['DB_USER'],
$data_connect['DB_PASS'], $data_connect['DB_NAME'])
or die("Problemas con la conexión");
$resultadoProducto = mysqli_query($conexion, "SELECT name, price, imagen, description FROM app_product WHERE id = $_GET[id]")
or die("Problemas en el select:" . mysqli_error($conexion));
$producto = mysqli_fetch_array($resultadoProducto);
echo ' <div class="row justify-content-md-center">';
echo ' <div class="col-lg-6 shadow p-3 mb-5 bg-primary rounded text-white">';
echo ' <h1>' . $producto['name'] . '</h1>';
echo ' <img src="'. $src_images . $producto['imagen'] .'" class="card-img-top" alt="...">';
echo ' <h3>Precio: ' . number_format($producto['price'] / 100,2) . '</h3>';
echo ' <h3>Descripcion: ' . $producto['description'] . '</h3>';
echo ' </div>';
echo ' </div>';
mysqli_close($conexion);
?>
</div>
<!-- /Producto -->
<!-- Footer -->
<footer id="footer" class="pb-4 pt-4">
<div class="container">
<div class="row text-center">
<div class="col-12 col-lg">
Copyright © Your Website 2020
</div>
</div>
</div>
</footer>
<!-- /Footer -->
<!-- Optional JavaScript; choose one of the two! -->
<!-- Option 1: Bootstrap Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW" crossorigin="anonymous"></script>
<!-- Option 2: Separate Popper and Bootstrap JS -->
<!--
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js" integrity="sha384-q2kxQ16AaE6UbzuKqyBE9/u/KzioAlnx2maXQHiDX9d4/zp8Ok3f+M7DPm+Ib6IU" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/js/bootstrap.min.js" integrity="sha384-pQQkAEnwaBkjpqZ8RU1fF1AKtTcHJwFl3pblpTlHXybJjHpMYo79HY3hIi4NKxyj" crossorigin="anonymous"></script>
-->
</body>
</html>