-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlearning.php
More file actions
141 lines (103 loc) · 5.22 KB
/
learning.php
File metadata and controls
141 lines (103 loc) · 5.22 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?php
require_once('include/header.php');
require_once('include/sidebar.php');
error_reporting(0);
?>
<!-- Main Content -->
<div class="main-content">
<section class="section">
<div class="card col-12 col-md-8 col-lg-12">
<div class="card-header">
<h4>New Question </h4>
</div>
<form method="post" action="scripts.php" autocomplete="off" enctype="multipart/form-data">
<div class="card-body" >
<div class="form-row">
<div class="form-group col-md-5">
<label>Category</label>
<select class="form-control" name="category">
<?php
$result = $conn->query("SELECT * FROM category WHERE status = 1");
while($row = $result -> fetch_assoc()) {
echo '<option value="'.$row['category'].'">'.$row['category'].'</option>';
}
?>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="inputEmail4"> Question <spam style="color:red;">*</spam></label>
<input type="text" class="form-control" id="inputText" name="ques" placeholder=" Question" required maxlength="150">
</div>
<div class="form-group col-md-6">
<label for="inputEmail4"> Answer <spam style="color:red;">*</spam></label>
<input type="text" class="form-control" id="inputText" name="answ" placeholder=" Answer" required maxlength="150">
</div>
</div>
<div class="card-footer text-center">
<button type="submit" name="NewLearnQuesiton" value="" class="btn btn-primary">Add</button>
</div>
</div>
</form>
</section>
<section class="section">
<div class="section-body">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<div class="col-10">
<h4>Questions</h4>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped" id="table-1">
<thead>
<tr>
<th class="text-center">
#
</th>
<th class="align-middle">Category </th>
<th class="align-middle"> Question</th>
<th class="align-middle">Answer </th>
<th class="align-middle"> Action</th>
</tr>
</thead>
<tbody>
<?php
$result = $conn->query("SELECT * FROM learn ");
if($result->num_rows>0){
$no = 1;
while ($row = $result->fetch_assoc()) {
echo '<tr>
<td class="align-middle">
'.$no.'
</td>
<td>'.$row['category'].'</td>
<td>'.$row['ques'].'</td>
<td>'.$row['answer'].'</td>
<td>
<a href="learn.php?s='.$row['id'].'" class="badge badge-shadow" data-toggle="tooltip" data-placement="left"
title="Update This Question"><span class="far fa-edit text-warning"> </span></a>
<a href="scripts.php?DlLernQuestion=true&s='.$row['id'].'" class="badge badge-shadow" data-toggle="tooltip" data-placement="left"
title="Delete This Questions Without Conformation "><span class="text-danger font-weight-bold">X </span></a>
</td>
</tr>';
$no++;
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<?php
require_once('include/footer.php');
?>