-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
121 lines (117 loc) · 4.88 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
<?php
require 'back/Database.php';
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title> Kooseyl phone </title>
<link rel="stylesheet" type="text/css" href="css/acceuil.css">
<meta name="viewport" content="width=device-width, initia-scale=1">
<link rel="icon" type="images/css" href="images/logo.png">
</head>
<style>
.nav-text{
<?php if($_SESSION)
echo 'width: 14.8%;';
else
echo 'width: 18.5%;';
?>
}
</style>
<body>
<div class="contenu">
<div class="collonne1">
<div class="nav" >
<?php
echo '<header>
<ul> ';
$db = Database::connect();
$statement = $db->query('SELECT * FROM categories');
$categories = $statement->fetchAll();
echo '<li class="logo"><img src="images/logo.png"> Kooseyl phone </li>';
foreach($categories as $category){
if($category['id'] == '1'){
echo '<li class="nav-text"><a href="index.php">'.$category['name'].'</a></li>';
}
else{
if($category['id'] == '2') {
echo '<li class="nav-text"><a href="#">Nos produits</a><ul>';
}
echo '<li class="nav-text"><a href="back/'.$category['name'].'.php">'.$category['name'].'</a> </li>';
}
}
echo'</ul>
</li>';
echo '<li class="nav-text"><a href="back/about.php"> A propos </a></li>';
if($_SESSION)
echo'<li class="nav-text"><a href="back/panier.php"><img src="images/panier.png"> Panier</a></li>
<li class="nav-text"><a href="back/deconnexion.php">Deconnexion</a></li>';
else
echo '<li class="nav-text"><a href="back/connexion.php">Connexion</a></li>';
echo '
</ul>
</header>
</div>
<div class="head">';
if($_SESSION)
echo 'Bienvenue '.Strtoupper($_SESSION['Firstname']);
else echo 'Veuillez vous connecter ou vous inscrire pour decouvrir nos produits';
echo '</div>
</div>
<div class="collonne2">
<div class="nouveau">
<span> Les nouveautés </span>
</div>
<div class="row"> ';
$statement = $db->prepare('SELECT * FROM items WHERE items.category = ?');
$statement->execute(array(1));
while ($item = $statement->fetch()){
echo ' <div class="colon">
<img src="images/'.$item['image'].'">
<strong> '.$item['name'].' </strong>
<br>
'.$item['description'].'
<br>
<h1> '.$item['price'].'DA</h1>
<br>
<p><a href="back/addpanier.php?id_item='.$item['id'].'">Ajouter au panier</a></p>
<br>
</div>';
}
Database::disconnect();
?>
</div>
</div>
<footer >
<div class=footer_container>
<div class="footer_horaire">
<h3>Horaires :</h3>
<p>✅ Sam: 10h-19h</p>
<p>✅ Dim: 8h-19h</p>
<p>✅ Lun: 8h-19h</p>
<p>✅ Mar: 8h-19h</p>
<p>✅ Mer: 8h-19h</p>
<p>✅ Jeu: 8h-19h</p>
<p>❌ Ven: Fermé</p>
</div>
<div class="footer_media">
<h3>Nos reseaux :</h3>
<p><a href="http://www.facebook.com/kooseylphone/" target="_blank">Facebook</a></p>
<p><a href="http://www.instagram.com/kooseylphone/" target="_blank">Instagram</a></p>
</div>
<div class="footer_services :">
<h3>Nos services :</h3>
<p>Smartphones</p>
<p>Ordinateurs</p>
<p>Accessoires</p>
</div>
</div>
<div class="copyright">
<p>©2022 Copyright - Tous droits réservés</p>
</div>
</footer>
</div>
</body>
</html>