-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanage_forum.php
More file actions
48 lines (46 loc) · 1.3 KB
/
manage_forum.php
File metadata and controls
48 lines (46 loc) · 1.3 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
<?php include 'admin/db_connect.php' ?>
<?php
if(isset($_GET['id'])){
$qry = $conn->query("SELECT * FROM forum_topics where id=".$_GET['id'])->fetch_array();
foreach($qry as $k =>$v){
$$k = $v;
}
}
?>
<div class="container-fluid">
<form action="" id="manage-forum">
<input type="hidden" name="id" value="<?php echo isset($_GET['id']) ? $_GET['id']:'' ?>" class="form-control">
<div class="row form-group">
<div class="col-md-8">
<label class="control-label">Title</label>
<input type="text" name="title" class="form-control" value="<?php echo isset($title) ? $title:'' ?>">
</div>
</div>
<div class="row form-group">
<div class="col-md-12">
<label class="control-label">Description</label>
<textarea name="description" class="text-jqte"><?php echo isset($description) ? $description : '' ?></textarea>
</div>
</div>
</form>
</div>
<script>
$('.text-jqte').jqte();
$('#manage-forum').submit(function(e){
e.preventDefault()
start_load()
$.ajax({
url:'admin/ajax.php?action=save_forum',
method:'POST',
data:$(this).serialize(),
success:function(resp){
if(resp == 1){
alert_toast("Data successfully saved.",'success')
setTimeout(function(){
location.reload()
},1000)
}
}
})
})
</script>