-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmanage.php
More file actions
94 lines (67 loc) · 2.72 KB
/
manage.php
File metadata and controls
94 lines (67 loc) · 2.72 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
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
<?php echo file_get_contents("head.php"); ?>
<?php echo file_get_contents("header.php");?>
<div class="container">
<!-- Jumbotron Header -->
<header class="jumbotron fp-jt">
<h1>Edit Quiz</h1>
<div class="col-sm-6 col-md-6 text-right">
<div class="btn-group inline" role="group">
<a href="add_quiz.php" class="btn btn-primary">Create question</a>
<a href="quiz.php" class="btn btn-danger">Go back</a>
</div>
</div>
</header>
<hr>
<!--Quiz -->
<div class="row">
<div class="col-lg-12">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Number</th>
<th>Question</th>
<th>Wrong answer1</th>
<th>Wrong answer2</th>
<th>Wrong answer3</th>
<th>Correct answer</th>
</tr>
</thead>
<tbody>
<?php
include 'db.php';
$pdo = Database::connect();
$sql = 'SELECT * FROM quiz';
foreach ($pdo->query($sql) as $row) {
echo '<tr>';
echo '<td>'. $row['questionid'] . '</td>';
echo '<td>'. $row['name'] . '</td>';
echo '<td>'. $row['choice1'] . '</td>';
echo '<td>'. $row['choice2'] . '</td>';
echo '<td>'. $row['choice3'] . '</td>';
echo '<td>'. $row['answer'] . '</td>';
echo '<td>';
echo '<a href="delete.php?id='.$row['questionid'].'"><i class="fa fa-trash fa-2x">
</a></i>';
echo '</td>';
echo '<td>';
echo '<a href="edit.php?id='.$row['questionid'].'"><i class="fa fa-edit fa-2x"></a></i>';
echo '</td>';
echo '</tr>';
}
?>
</tbody>
</table>
</div>
</div>
<!-- /.row -->
<!-- Quiz-->
<!-- /.row -->
<hr>
</div>
<!-- Footer -->
<?php
echo file_get_contents("pagefooter.php");
?>
<?php
echo file_get_contents("footer.php");
?>