-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathknowledgebase.php
More file actions
109 lines (99 loc) · 3.56 KB
/
knowledgebase.php
File metadata and controls
109 lines (99 loc) · 3.56 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
<?php
require_once('config.php');
$page = 'knowledgebase';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Support Center » <?php echo $sitename; ?></title>
<?php require_once('assets/inc/inc.head.php'); ?>
</head>
<body>
<?php require_once('assets/inc/inc.nav.php'); ?>
<div class="container">
<?php
if(!isset($_GET['article']) && !isset($_GET['category']) && !isset($_GET['search']))
{
?>
<div class="row">
<div class="col-md-12">
<h1 class="page-header">Knowledgebase <small>Answers to frequently asked questions...</small></h1>
</div>
</div>
<div class="row">
<div class="col-md-2 well">
<h3>Categories</h3>
<?php $frontend->kb_categories($system_url); ?>
</div>
<div class="col-md-10">
<form action="<?php echo $system_url.'knowledgebase/search/submit'; ?>" method="post">
<div class="input-group">
<span class="input-group-addon">Search</span>
<input type="text" class="form-control" name="search" placeholder="What do you need help with?" />
<span class="input-group-btn">
<input type="submit" class="btn btn-default" value="Search Now">
</span>
</div>
</form>
<h2><small>Random Articles</small></h2>
<?php $frontend->featured_kb($core->Setting('kb_featured')); ?>
</div>
</div>
<?php
}
else if(isset($_GET['category'])) {
$category = $core->EscapeString($_GET['category']);
$cat = $frontend->categoryInfo($category, 'name');
if(!$cat) {
header("Location: ".$system_url."knowledgebase");
die();
}
?>
<div class="row">
<div class="col-md-12">
<h1 class="page-header">Knowledgebase <small><?php echo $cat; ?></small></h1>
</div>
</div>
<div class="row">
<div class="col-md-2 well">
<h3>Categories</h3>
<?php $frontend->kb_categories($system_url); ?>
<br>
<a href="<?php echo $system_url.'knowledgebase'; ?>"><button class="btn btn-info">« Back</button></a>
</div>
<div class="col-md-10">
<form action="<?php echo $system_url.'knowledgebase/search/submit'; ?>" method="post">
<div class="input-group">
<span class="input-group-addon">Search</span>
<input type="text" class="form-control" name="search" placeholder="What do you need help with?" />
<span class="input-group-btn">
<input type="submit" class="btn btn-default" value="Search Now">
</span>
</div>
</form>
<br>
<?php $frontend->displayKBCategory($category); ?>
</div>
</div>
<?php
}
else if(isset($_GET['article'])) {
echo 'Show article';
}
else if(isset($_GET['search'])) {
echo '%'.str_replace(" ","%",$_POST['search']).'%';
//Use above formula in search
}
?>
<hr>
<footer>
<?php require_once('assets/inc/inc.footer.php'); ?>
</footer>
</div> <!-- /container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="<?php echo $system_url; ?>assets/js/bootstrap.min.js"></script>
</body>
</html>