-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdeleteQuestion.php
More file actions
100 lines (77 loc) · 3.14 KB
/
deleteQuestion.php
File metadata and controls
100 lines (77 loc) · 3.14 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
95
96
97
98
<?php $page_title = 'Quiz Master > Delete Question'; ?>
<?php
require 'bin/functions.php';
require 'db_configuration.php';
include('header.php');
$page="questions_list.php";
verifyLogin($page);
?>
<div class="container">
<style>#title {text-align: center; color: darkgoldenrod;}</style>
<?php
include_once 'db_configuration.php';
if (isset($_GET['id'])){
$id = $_GET['id'];
$sql = "SELECT * FROM questions
WHERE id = '$id'";
if (!$result = $db->query($sql)) {
die ('There was an error running query[' . $connection->error . ']');
}//end if
}//end if
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo '<form action="deleteTheQuestion.php" method="POST">
<br>
<h3 id="title">Delete Question</h3><br>
<h2>'.$row["topic"].' - '.$row["question"].' </h2> <br>
<div class="form-group col-md-4">
<label for="id">Id</label>
<input type="text" class="form-control" name="id" value="'.$row["id"].'" maxlength="5" readonly>
</div>
<div class="form-group col-md-8">
<label for="name">Topic</label>
<input type="text" class="form-control" name="topic" value="'.$row["topic"].'" maxlength="255" readonly>
</div>
<div class="form-group col-md-4">
<label for="category">Question</label>
<input type="text" class="form-control" name="question" value="'.$row["question"].'" maxlength="255" readonly>
</div>
<div class="form-group col-md-4">
<label for="level">Choice 1</label>
<input type="text" class="form-control" name="choice_1" value="'.$row["choice_1"].'" maxlength="255" readonly>
</div>
<div class="form-group col-md-4">
<label for="facilitator">Choice 2</label>
<input type="text" class="form-control" name="choice_2" value="'.$row["choice_2"].'" maxlength="255" readonly>
</div>
<div class="form-group col-md-12">
<label for="description">Choice 3</label>
<input type="text" class="form-control" name="choice_3" value="'.$row["choice_3"].'" maxlength="255" readonly>
</div>
<div class="form-group col-md-6">
<label for="required">Choice 4</label>
<input type="text" class="form-control" name="choice_4" value="'.$row["choice_4"].'" maxlength="255" readonly>
</div>
<div class="form-group col-md-6">
<label for="optional">Answer</label>
<input type="text" class="form-control" name="answer" value="'.$row["answer"].'" maxlength="255" readonly>
</div>
<div class="form-group col-md-4">
<label for="cadence">Image Path</label>
<input type="text" class="form-control" name="image_name" value="'.$row["image_name"].'" maxlength="255" readonly>
</div>
<br>
<div class="text-left">
<a href="questions_list.php" class="btn btn-secondary btn-md align-items-center">Cancel</a>
<button type="submit" name="submit" class="btn btn-primary btn-md align-items-center">Confirm Delete Question</button>
</div>
<br> <br>
</form>';
}//end while
}//end if
else {
echo "0 results";
}//end else
?>
</div>