-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathadministrator_page.php
123 lines (99 loc) · 2.97 KB
/
administrator_page.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
<?php
include("db_connection.php");
session_start();
if (isset($_SESSION['IsLogedIn']) && $_SESSION['IsLogedIn'] == true) {
} else {
header("location:login_page.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<title> Administration Page</title>
<link rel="stylesheet" href="administrator_page.css">
</head>
<body>
<div class="header">
<p class="logo"> Maroc PC</p>
</div>
<div class="main">
<table align="center">
<h2>Table clients</h2>
<tr>
<th> Id </th>
<th> Nom et Prénom</th>
<th> Email Adresse</th>
<th> Date Registration</th>
</tr>
<?php
$sql = "SELECT * FROM clients ";
$result = mysqli_query($link, $sql);
if ($result && mysqli_num_rows($result) > 0) {
while ($row = $result->fetch_assoc()) {
echo "<tr><td>" . $row["id_client"] . "</td><td>" . $row["nom_client"] . "</td><td>"
. $row["email_client"] . "</td><td>" . $row["date_login_client"] . "</td></tr> . ";
}
echo "</table>";
} else {
echo "0 données";
}
?>
<p> <br> <br> <br> <br></p>
</table>
<table align="center">
<h2>Table Produits</h2>
<tr>
<th> Id </th>
<th> Nom </th>
<th> Prix Unitaire</th>
<th> Inventaire</th>
</tr>
<?php
$sql = "SELECT * FROM produits ";
$result = mysqli_query($link, $sql);
if ($result && mysqli_num_rows($result) > 0) {
while ($row = $result->fetch_assoc()) {
echo "<tr><td>" . $row["id_produit"] . "</td><td>" . $row["nom_produit"] . "</td><td>"
. $row["prix_produit"] . "</td><td>" . $row["inventaire_produit"] . "</td></tr> . ";
}
echo "</table>";
} else {
echo "0 données";
}
?>
<p> <br> <br> <br> <br></p>
</table>
<table align="center">
<h2>Table achats</h2>
<tr>
<th> Id </th>
<th> id_client </th>
<th> id_produit</th>
<th> date_achat</th>
</tr>
<?php
$sql = "SELECT * FROM achat ";
$result = mysqli_query($link, $sql);
if ($result && mysqli_num_rows($result) > 0) {
while ($row = $result->fetch_assoc()) {
echo "<tr><td>" . $row["id_achat"] . "</td><td>" . $row["id_client"] . "</td><td>"
. $row["id_produit"] . "</td><td>" . $row["date_achat"] . "</td></tr> . ";
}
echo "</table>";
} else {
echo "0 données";
}
?>
<p> <br> <br> <br> <br></p>
</table>
</div>
<div class="contactUs">
<p style="font-size: 40px;">Contact Us</p>
<p>Email : conatctmarocpc@gmail.com <br>
Adress : Route d Eljadida, KM 7, CASABLANCA, Maroc <br>
Télephone : 212 522 231 560/565 <br>
Fax : 212 522 252 245 <br>
</p>
</div>
</body>
</html>