-
Notifications
You must be signed in to change notification settings - Fork 0
/
lebonplan.php
158 lines (113 loc) · 4.85 KB
/
lebonplan.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
<?php
// Initialize the session
session_start();
// Check if the user is logged in, if not then redirect him to login page
if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){
header("location: lebonplan_login.php");
exit;
}
?>
<html>
<head>
<!DOCTYPE html>
<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="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Dancing+Script&display=swap" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Raleway' rel='stylesheet'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</head>
<header>
<TITLE>Nova City</TITLE>
<link rel="shortcut icon" href="img/logo_nova_city.png" type="image/x-icon">
<nav>
<div class="nav_barre ">
<div>
<a href="index.html">
<img class="icone_nav_home" src="img/home.png ">
</a>
</div>
<div>
<img class="icone_nav_bluetooth " src="img/Bluetooth.png ">
</div>
<div>
<img class="icone_nav_wifi " src="img/wifi.png ">
</div>
<div>
<img class="icone_nav_batterie " src="img/batterie.png ">
</div>
<div id="time_live">
<script>
function startTime() {
const today = new Date();
let h = today.getHours();
let m = today.getMinutes();
m = checkTime(m);
document.getElementById('time_live').innerHTML = h + ":" + m;
setTimeout(startTime, 1000);
}
function checkTime(i) {
if (i < 10) {
i = "0" + i
}; // add zero in front of numbers < 10
return i;
}
</script>
</div>
<div id="date_live">
<script>
n = new Date();
y = n.getFullYear();
m = n.getMonth() + 1;
d = n.getDate();
document.getElementById("date_live").innerHTML = d + "/" + m + "/" + y;
</script>
</div>
</div>
</nav>
</header>
<body onload="startTime()">
<img src="img/lebonplan_fond.jpg" class="background-img ">
<div class="lebonplan_div_01">
<div class="lebonplan_div_02">
<div>
<h1 class="my-5">Bonjour, <b><?php echo htmlspecialchars($_SESSION["rpname"]); ?></b></h1>
<h2>Bienvenue sur le site lebonplan de Nova City</h1>
</div>
<div class="btn_logout_reset_div">
<div>
<a href="lebonplan_reset_password.php" class="btn_logout_reset_01">Réinitialiser votre mot de
passe</a>
</div>
<div>
<a href="lebonplan_logout.php" class="btn_logout_reset_01">Déconnexion de votre compte</a>
</div>
<div>
<a href="lebonplan_post.php" class="btn_logout_reset_01">Poster une annonce de vente</a>
</div>
</div>
</div>
</div>
<div class="post_lebonplan_div_main">
<?php
$mysqli = new mysqli("localhost", "root", "X@JA64iui**8", "novacityapp");
$mysqli->set_charset("utf8");
$requete = "SELECT * FROM annonces_lebonplan";
$resultat = $mysqli->query($requete);
?>
<div class="post_lebonplan_div_01">
<?php while ($ligne = $resultat->fetch_assoc()) {
echo '<div class="post_lebonplan_div_02"> Titre de la vente : ' .$ligne['titre'] . '<br><br> ' . 'Catégorie : ' .$ligne['type'] . '<br><br> <img class="lebonplan_img_01" src="'.$ligne['photo'].'" /><br><br> ' . 'Description : ' . $ligne['description'] . '<br><br> ' . 'Prix de vente : ' . $ligne['prix'] . '<br><br> ' . 'Nom du vendeur : ' . $ligne['username'] . '<br><br> ' . 'Numéro du vendeur : ' . $ligne['phone_number'] . '</div>';
}
$mysqli->close();
?>
</div>';
</div>
</body>
</html>