-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
156 lines (113 loc) · 5.64 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="estilos.css">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
<title>Tu Mascota | Principal</title>
</head>
<body>
<header class="main-header">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Tu Mascota</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTogglerDemo02">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Inicio</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Compras</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Acerca de</a>
</li>
</ul>
<form class="d-flex">
<input class="form-control me-2" type="search" placeholder="Buscar" aria-label="Search">
<button class="btn btn-outline-success" type="submit">SBuscar</button>
</form>
</div>
</div>
</nav>
</header>
<main>
<div class="container-slider">
<div class="slider" id="slider">
<div class="slider-section">
<img src="img/1.jpg" alt="imagen perro">
<p>Tu mejor amigo</p>
</div>
<div class="slider-section">
<img src="/img/2.jpg" alt="imagen perro">
<p>Tu mejor aliado</p>
</div>
<div class="slider-section">
<img src="/img/3.png" alt="imagen perro">
<p>La mejor compania</p>
</div>
<div class="slider-section">
<img src="/img/4.jpg" alt="imagen perro">
<p>Tu mascota</p>
</div>
</div>
<div class="slider-btn" id="btn-right" onclick="Next()">></div>
<div class="slider-btn" id="btn-left" onclick="Preview()"><</div>
</div>
<div class="container">
<div class="container-productos">
<?php
$mascotas;
$conexion=mysqli_connect("127.0.0.1","danielstvn","daniel123","tienda_mascotas");
if(mysqli_connect_errno()){
echo "Conexion Falló:".mysqli_connect_error();
}
else{
//Seleccionar Base de Datos
mysqli_select_db($conexion,"tienda_mascotas") or die("No se selecciono Base de Datos");
//Consulta
$SQL = "SELECT * from mascotas";
$resultado = mysqli_query($conexion,$SQL);
while($mascotas = mysqli_fetch_assoc($resultado)){
$nombre = $mascotas['nombre'];
$raza =$mascotas['raza'];
$edad = $mascotas['edad'];
$precio = $mascotas['precio'];
$imgRuta = $mascotas['img_ruta'];
$razaURL = $mascotas['raza_url'];
$id = $mascotas['id'];
?>
<div class="producto">
<?php
echo "<img src='".$imgRuta."'>";
?>
<div class="producto-descripcion">
<h1 class="mascota-raza"><?php echo $raza;?></h1>
<h3 class="mascota-nombre">Nombre: <?php echo $nombre;?></h3>
<h3 class="mascota-edad">Edad: <?php echo $edad;?></h3>
<h1 class="mascota-precio">$ <?php echo $precio;?></h1>
<span > </span>
</div>
<?php
echo "<a href='".$razaURL."'><button type='button' class='btn btn-primary'>Detalles de la raza</button></a>";
echo " ";
echo "<a href='formulario.compras.php?id=".$id."'><button type='button' class='btn btn-success'>Solicitar</button></a>";
?>
</div>
<?php
}
mysqli_free_result($resultado);
}
?>
</div>
</div>
</main>
<script src="/js/script.js"></script>
</body>
</html>