-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfaqs.php
98 lines (90 loc) · 3.1 KB
/
faqs.php
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
include 'db_connection.php';
?>
<?php
session_start();
?>
<?php
//TEMPLATES
include 'templates/head.html';
include 'templates/nav-bar.php';
include 'templates/search-bar.php';
?>
<?php
$sql = "SELECT question
FROM FAQ";
$result = $conn->query($sql);
$ques = $result->fetch_assoc();
$q = $ques['question'];
?>
<?php
$sql = "SELECT answer
FROM FAQ";
$result = $conn->query($sql);
$ans = $result->fetch_assoc();
$a = $ans['answer'];
?>
<main class="flex w-full">
<section class="w-full p-4">
<div class="w-full text-md">
<div class="bg-white shadow sm:rounded">
<div class="mt-5 md:mt-0 md:col-span-2">
<div class="bg-white p-8 rounded-md w-full">
<div class=" flex items-center justify-between pb-6">
<div>
<h2 class="text-gray-600 font-semibold">FAQ</h2>
</div>
<div class="flex items-center justify-between"></div>
</div>
<!--Table-->
<div>
<div class="-mx-4 sm:-mx-8 px-4 sm:px-8 py-4 overflow-x-auto">
<div class="inline-block min-w-full shadow rounded-lg overflow-hidden">
<!--Table Header-->
<table class="min-w-full leading-normal">
<thead>
<tr>
<th
class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider">
Question
</th>
<th
class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider">
Answer
</th>
</tr>
</thead>
<?php
$sql = "SELECT *
FROM FAQ";
$result = $conn->query($sql);
while($row = mysqli_fetch_array($result)) {
?>
<!--Table Body-->
<tbody>
<tr>
<!--Qustion-->
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<p class="text-gray-900 whitespace-no-wrap"><?php echo $row['question']?></p>
</td>
<!--Answer-->
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<p class="text-gray-900 whitespace-no-wrap"><?php echo $row['answer']?></p>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
<!------>
</div>
</div>
</div>
</div>
</section>
</main>
<?php // TEMPLATES
include 'templates/footer.html';
?>