forked from jeruick/A-Pro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
134 lines (113 loc) · 4.97 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
<?php
session_start();
require_once("clases/Categoria.php");
require_once("clases/ArticuloMapper.php");
require_once("clases/Usuario.php");
$categoria = new Categoria();
$result = $categoria->ObtenerCategorias();
$result2 = $categoria->ObtenerCategorias();
if (isset($_POST["email"]) && isset($_POST["password"]))
{
$email = $_POST["email"];
$password = $_POST["password"];
$usuario = new Usuario();
$usuario->LogearUsuario($email, $password);
}
if(isset($_SESSION["usuario_valido"]))
{
$id = $_SESSION["usuario_valido"];
$usuario = new Usuario();
$user = $usuario->ObtenerUsuario($id);
$rowUser = mysqli_fetch_assoc($user);
}
$i = 5;
?>
<!DOCTYPE html>
<html lang="es">
<head>
<title>APro Tienda en line Electronica| Moda |Deportes</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="css/bootstrap.css" />
<link rel="stylesheet" href="css/simplePagination.css">
<link rel="stylesheet" href="css/index.css">
<link rel="stylesheet" href="css/header.css">
</head>
<body>
<?php require_once("header.php"); ?>
<div id="contenedor" >
<div id="myCarousel" class="carousel slide" >
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
<li data-target="#myCarousel" data-slide-to="3"></li>
<li data-target="#myCarousel" data-slide-to="4"></li>
<li data-target="#myCarousel" data-slide-to="5"></li>
<li data-target="#myCarousel" data-slide-to="6"></li>
</ol>
<!-- Carousel items -->
<div class="carousel-inner">
<div class="active item"><img src="publicity/buy.png" alt="banner1" /></div>
<div class="item"><img src="publicity/cool_phones.png" alt="banner2" /></div>
<div class="item"><img src="publicity/shopping_girl.png" alt="banner3" /></div>
<div class="item"><img src="publicity/any_phone.png" alt="banner4" /></div>
<div class="item"><img src="publicity/Tenis-Nike-HyperShield.jpg" alt="banner5" /></div>
<div class="item"><img src="publicity/shopping.png" alt="banner6" /></div>
<div class="item"><img src="publicity/lenovo-convertable-miix.jpg" alt="banner7"></div>
<div class="item"><img src="publicity/men.jpg" alt="banner8"></div>
<div class="item"><img src="publicity/girls.jpg" alt="banner9"></div>
</div>
<!-- Carousel nav -->
<a class="carousel-control left" href="#myCarousel" data-slide="prev">‹</a>
<a class="carousel-control right" href="#myCarousel" data-slide="next">›</a>
</div>
</div>
<nav class="navbar navbar-default navbar-inverse" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" id="boton-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse " id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav" id="categorias">
<?php while ($row = mysqli_fetch_assoc($result))
{
?>
<li value='<?php echo $row["id"]; ?>'><a href="#"><?php echo $row["nombre_categoria"]; ?></a></li>
<?php
} mysqli_free_result($result);
?>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<div id="articulos-mas-vistos" >
<?php while($row = mysqli_fetch_assoc($resultado)){
if(($i%5 == 0)){ ?>
<div class="articulos-categoria" >
<h4><?php echo $row["nombre_categoria"]; ?></h4>
<?php } ?>
<div class="top_articles">
<span class="photo_article"><img src="<?php echo "articulos/".$row["foto_articulo"]; ?>"></span>
<p style="color: gray;font-weight:bold;"><?php echo $row["nombre_articulo"]; ?></p>
<p>Precio: <span style="color: red;"><?php echo "L.".$row["precio_unidad"]; ?></span></p>
<p><a class="addCart" href="#" value="<?php echo $row["id"]; ?>">Agregar al carro</a></p>
</div>
<?php $i++; if($i%5 == 0){ ?>
</div>
<?php } } mysqli_free_result($resultado); ?>
</div>
</div>
<div id="articulos-por-categoria"></div>
<footer>
<h3>Apro © Derechos Reservados</h3>
</footer>
<?php require("footer.php"); ?>
</body>
</html>