-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresponds.php
More file actions
50 lines (43 loc) · 1.74 KB
/
Copy pathresponds.php
File metadata and controls
50 lines (43 loc) · 1.74 KB
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
<?php
session_start();
include 'service/database.php';
$quizer_id = $_GET['id'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Responds</title>
<link rel="stylesheet" href="styles.css">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
</head>
<body>
<?php include 'components/header.php'; ?>
<?php
$sql1 = "SELECT * FROM responds WHERE quizer_id = '$quizer_id' ORDER BY created_at DESC";
$result = mysqli_query($conn, $sql1);
if($row = mysqli_num_rows($result) > 0) {
echo "<table><thead><td>ID</td><td>Responden</td><td>Q1 Answer</td><td>Q2 Answer</td><td>Q3 Answer</td><td>Q4 Answer</td><td>Q5 Answer</td></thead>";
while($row = mysqli_fetch_assoc($result)) {
$sql2 = "SELECT * FROM users WHERE user_id = $row[user_id]";
$result1 = mysqli_query($conn, $sql2);
echo "<tr>";
echo "<td>" . $row['respond_id'] . "</td>";
if($row2 = mysqli_num_rows($result1) > 0) {
while($row2 = mysqli_fetch_assoc($result1)) {
echo "<td>" . $row2['username'] . "</td>";
}
}
echo "<td>" . $row['q1a'] . "</td>";
echo "<td>" . $row['q2a'] . "</td>";
echo "<td>" . $row['q3a'] . "</td>";
echo "<td>" . $row['q4a'] . "</td>";
echo "<td>" . $row['q5a'] . "</td>";
echo "</tr>";
}
echo "</table>";
}
?>
</body>
</html>