-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_faq.php
129 lines (97 loc) · 5.42 KB
/
add_faq.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
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
<?php
require 'inc/Header.php';
?>
<!-- Loader ends-->
<!-- page-wrapper Start-->
<div class="page-wrapper compact-wrapper" id="pageWrapper">
<!-- Page Header Start-->
<?php require 'inc/Navbar.php';?>
<!-- Page Header Ends-->
<!-- Page Body Start-->
<div class="page-body-wrapper">
<!-- Page Sidebar Start-->
<?php require 'inc/Sidebar.php';?>
<!-- Page Sidebar Ends-->
<div class="page-body">
<div class="container-fluid">
<div class="page-title">
<div class="row">
<div class="col-sm-6">
<h3>FAQ Management</h3>
</div>
</div>
</div>
</div>
<!-- Container-fluid starts-->
<div class="container-fluid dashboard-default">
<div class="row">
<div class="col-sm-12">
<div class="card">
<div class="card-body">
<?php
if(isset($_GET['id']))
{
$data = $dating->query("select * from tbl_faq where id=".$_GET['id']."")->fetch_assoc();
?>
<form method="POST" enctype="multipart/form-data">
<div class="form-group mb-3">
<label id="basic-addon1">Enter Question</label>
<input type="text" class="form-control" placeholder="Enter Question" value="<?php echo $data['question'];?>" name="question" aria-label="Username" aria-describedby="basic-addon1">
</div>
<div class="form-group mb-3">
<label id="basic-addon1">Enter Answer</label>
<input type="text" class="form-control" placeholder="Enter Answer" value="<?php echo $data['answer'];?>" name="answer" aria-label="Username" aria-describedby="basic-addon1">
<input type="hidden" name="type" value="edit_faq"/>
<input type="hidden" name="id" value="<?php echo $_GET['id'];?>"/>
</div>
<div class="form-group mb-3">
<label for="inputGroupSelect01">Select Status</label>
<select class="form-control" name="status" id="inputGroupSelect01" required>
<option value="">Choose...</option>
<option value="1" <?php if($data['status'] == 1){echo 'selected';}?>>Publish</option>
<option value="0" <?php if($data['status'] == 0){echo 'selected';}?>>Unpublish</option>
</select>
</div>
<button type="submit" class="btn btn-primary">Edit FAQ</button>
</form>
<?php
}
else
{
?>
<form method="POST" enctype="multipart/form-data">
<div class="form-group mb-3">
<label id="basic-addon1">Enter Question</label>
<input type="text" class="form-control" placeholder="Enter Question" name="question" aria-label="Username" aria-describedby="basic-addon1">
</div>
<div class="form-group mb-3">
<label id="basic-addon1">Enter Answer</label>
<input type="text" class="form-control" placeholder="Enter Answer" name="answer" aria-label="Username" aria-describedby="basic-addon1">
<input type="hidden" name="type" value="add_faq"/>
</div>
<div class="form-group mb-3">
<label for="inputGroupSelect01">Select Status</label>
<select class="form-control" name="status" id="inputGroupSelect01" required>
<option value="">Choose...</option>
<option value="1">Publish</option>
<option value="0">Unpublish</option>
</select>
</div>
<button type="submit" class="btn btn-primary">Add FAQ</button>
</form>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
<!-- Container-fluid Ends-->
</div>
<!-- footer start-->
</div>
</div>
<!-- latest jquery-->
<?php require 'inc/Footer.php'; ?>
<!-- login js-->
</body>
</html>