-
Notifications
You must be signed in to change notification settings - Fork 0
/
user_notes_others.php
85 lines (76 loc) · 2.39 KB
/
user_notes_others.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
<?php
session_start();
$_SESSION["group"] = get_session();
$_SESSION["log"] = get_login();
$_SESSION["useracc"] = get_useracc();
if(isset($_SESSION['userName'])) {
$root = $_SESSION['userName'];
if ($_SESSION['userName'] == 'User') {
include("header_op.php");
include("configCSS_adm.html");
} else if ($_SESSION['userName'] == 'Root') {
include("header_op.php");
include("configCSS_adm.html");
} else {
include("header.php");
include("configCSS.html");
}
} else {
include("header.php");
include("configCSS.html");
}
include("config.php");
function get_session() {
if(isset($_SESSION['userName'])) {
return $_SESSION['userName'];
} else {
return '';
}
}
function get_login() {
if(isset($_SESSION['login'])) {
return $_SESSION['login'];
} else {
return '';
}
}
function get_useracc() {
if(isset($_GET["id"])) {
return $_GET["id"];
} else {
return '';
}
}
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Notations utilisateur</title>
</head>
<body>
<table style="width:70%">
<tr>
<th>Référence produit</th>
<th>Image</th>
<th>Date</th>
<th>Utilisateur</th>
<th>Note</th>
<th>Commentaire</th>
</tr>
<?php
$test = $_SESSION["log"];
$sql4 = 'SELECT DISTINCT product.name as "nom", rating.dateOfPub as "date",utilisateur.username as "user", utilisateur.image as image, rating.rate as "rate",rating.comm as "comm" FROM utilisateur,rating,product WHERE product.id = rating.idProduct AND utilisateur.id = rating.idUser AND utilisateur.id ="'.$_SESSION["useracc"].'"';
$connect2 = $conn->query($sql4);
while ($row2 = $connect2->fetch_assoc()) {
echo (empty($row2['nom'])) ? "<td> NA </td>" : "<td>" . $row2['nom'] . "</td>";
echo (empty($row2['image'])) ? '<td> <img src="assets/no_pp.png" width="100" height="100" alt="User Image"/> </td>' : '<td> <img src="'.$row2['image'].'" width="100" height="100" alt="User Image"/> </td>' ;
echo (empty($row2['date'])) ? "<td> NA </td>" : "<td>" . $row2['date'] . "</td>";
echo (empty($row2['user'])) ? "<td> NA </td>" : "<td>" . $row2['user'] . "</td>";
echo (empty($row2['rate'])) ? "<td> NA </td>" : "<td>" . $row2['rate'] . "/5 </td>";
echo (empty($row2['comm'])) ? "<td> NA </td>" : "<td>" . $row2['comm'] . "</td>";
echo "<tr>";
}
?>
</body>
</html>