-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquizer_main.php
More file actions
54 lines (48 loc) · 1.75 KB
/
Copy pathquizer_main.php
File metadata and controls
54 lines (48 loc) · 1.75 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
51
52
53
54
<?php
session_start();
include 'service/database.php';
if(isset($_POST['logout'])) {
session_unset();
session_destroy();
header('location: index.php');
}
if($_SESSION['is_login'] == false) {
header ('location: index.php');
}
$role = $_SESSION['role'];
$user_id = $_SESSION['user_id'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles.css">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<title>Dashboard</title>
</head>
<body class="dashboard-body">
<?php include 'components/header.php'; ?>
<h2 class="h22">Quizer Anda</h2>
<div class="quizer-cont">
<?php
$sql1 = "SELECT * FROM quizers WHERE user_id = '$user_id'";
$result = mysqli_query($conn, $sql1);
if($row = mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
echo "<div class='quizer-card'>";
echo "<h3>" . $row['title'] . "</h3> <br>";
echo "<p>" . $row['q1'] . "</p><br>";
echo "<p> Visibility :" . $row['visibility'] . "</p><br>";
echo "<p> ID :" . $row['quizer_id'] . "</p><br>";
echo "<p class='date'>" . $row['created_at'] . "</p><br>";
echo "<a class='btn-pri' href='responds.php?id=$row[quizer_id]'> Lihat Responden </a>";
echo "<a class='btn-sec edi' href='edit.php?id=$row[quizer_id]'> Edit </a>";
echo "</div>";
}
}
?>
</div><br>
<a class="btn-pri cre" href="create.php">Buat Quizer</a>
</body>
</html>