Skip to content
Snippets Groups Projects
Commit 611f3f84 authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #74 from protich/feature/kelli-scp-kb-layout-cleanup

Feature/kelli scp kb layout cleanup

Reviews By: Peter Rotich 04/23/12
parents 0833e3d0 47a842f6
No related branches found
No related tags found
No related merge requests found
......@@ -3,59 +3,51 @@ if(!defined('OSTSTAFFINC') || !$thisstaff) die('Access Denied');
?>
<h2>Frequently Asked Questions</h2>
<form id="kbSearch" action="kb.php" method="get" style="padding-top:15px;">
<form id="kbSearch" action="kb.php" method="get">
<input type="hidden" name="a" value="search">
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="440">
<input id="query" type="text" size="20" name="q" value="<?php echo Format::htmlchars($_REQUEST['q']); ?>">
<select name="cid">
<option value="">&mdash; All Categories &mdash;</option>
<?php
$sql='SELECT category_id, name, count(faq.category_id) as faqs '
.' FROM '.FAQ_CATEGORY_TABLE.' cat '
.' LEFT JOIN '.FAQ_TABLE.' faq USING(category_id) '
.' GROUP BY cat.category_id '
.' HAVING faqs>0 '
.' ORDER BY cat.name DESC ';
if(($res=db_query($sql)) && db_num_rows($res)) {
while($row=db_fetch_array($res))
echo sprintf('<option value="%d" %s>%s (%d)</option>',
$row['category_id'],
($_REQUEST['cid'] && $row['category_id']==$_REQUEST['cid']?'selected="selected"':''),
$row['name'],
$row['faqs']);
}
?>
</select>
</td>
<td width="100" rowspan="2">
<input id="searchSubmit" type="submit" value="Search">
</td>
</tr>
<tr>
<td width="400">
<select name="topicId" style="width:350px;">
<option value="">&mdash; All Help Topics &mdash;</option>
<?php
$sql='SELECT ht.topic_id, ht.topic, count(faq.topic_id) as faqs '
.' FROM '.TOPIC_TABLE.' ht '
.' LEFT JOIN '.FAQ_TOPIC_TABLE.' faq USING(topic_id) '
.' GROUP BY ht.topic_id '
.' HAVING faqs>0 '
.' ORDER BY ht.topic DESC ';
if(($res=db_query($sql)) && db_num_rows($res)) {
while($row=db_fetch_array($res))
echo sprintf('<option value="%d" %s>%s (%d)</option>',
$row['topic_id'],
($_REQUEST['topicId'] && $row['topic_id']==$_REQUEST['cid']?'selected="selected"':''),
$row['topic'], $row['faqs']);
}
?>
</select>
</td>
</tr>
</table>
<div>
<input id="query" type="text" size="20" name="q" value="<?php echo Format::htmlchars($_REQUEST['q']); ?>">
<select name="cid" id="cid">
<option value="">&mdash; All Categories &mdash;</option>
<?php
$sql='SELECT category_id, name, count(faq.category_id) as faqs '
.' FROM '.FAQ_CATEGORY_TABLE.' cat '
.' LEFT JOIN '.FAQ_TABLE.' faq USING(category_id) '
.' GROUP BY cat.category_id '
.' HAVING faqs>0 '
.' ORDER BY cat.name DESC ';
if(($res=db_query($sql)) && db_num_rows($res)) {
while($row=db_fetch_array($res))
echo sprintf('<option value="%d" %s>%s (%d)</option>',
$row['category_id'],
($_REQUEST['cid'] && $row['category_id']==$_REQUEST['cid']?'selected="selected"':''),
$row['name'],
$row['faqs']);
}
?>
</select>
<input id="searchSubmit" type="submit" value="Search">
</div>
<div>
<select name="topicId" style="width:350px;" id="topic-id">
<option value="">&mdash; All Help Topics &mdash;</option>
<?php
$sql='SELECT ht.topic_id, ht.topic, count(faq.topic_id) as faqs '
.' FROM '.TOPIC_TABLE.' ht '
.' LEFT JOIN '.FAQ_TOPIC_TABLE.' faq USING(topic_id) '
.' GROUP BY ht.topic_id '
.' HAVING faqs>0 '
.' ORDER BY ht.topic DESC ';
if(($res=db_query($sql)) && db_num_rows($res)) {
while($row=db_fetch_array($res))
echo sprintf('<option value="%d" %s>%s (%d)</option>',
$row['topic_id'],
($_REQUEST['topicId'] && $row['topic_id']==$_REQUEST['cid']?'selected="selected"':''),
$row['topic'], $row['faqs']);
}
?>
</select>
</div>
</form>
<hr>
<div>
......@@ -96,7 +88,7 @@ if($_REQUEST['q'] || $_REQUEST['cid'] || $_REQUEST['topicId']) { //Search.
echo '<div>Click on the category to browse FAQs.</div>
<ul id="kb">';
while($row=db_fetch_array($res)) {
echo sprintf('
<li>
<h4><a href="kb.php?cid=%d">%s (%d)</a> - <span>%s</span></h4>
......
......@@ -11,23 +11,23 @@ if(!defined('OSTSTAFFINC') || !$category || !$thisstaff) die('Access Denied');
<div>
<strong><?php echo $category->getName() ?></strong>
<span>(<?php echo $category->isPublic()?'Public':'Internal'; ?>)</span>
<br>
<div class="faded">&nbsp;Last updated <?php echo Format::db_daydatetime($category->getUpdateDate()); ?></div>
<time>Last updated <?php echo Format::db_daydatetime($category->getUpdateDate()); ?></time>
</div>
<p>
<div class="cat-desc">
<?php echo Format::safe_html($category->getDescription()); ?>
</p>
</div>
<?php
if($thisstaff->canManageFAQ()) {
echo sprintf('<a href="categories.php?id=%d" class="Icon editCategory">Edit Category</a>
| <a href="categories.php" class="Icon deleteCategory">Delete Category</a>
| <a href="faq.php?cid=%d&a=add" class="Icon newFAQ">Add New FAQ</a>',
echo sprintf('<div class="cat-manage-bar"><a href="categories.php?id=%d" class="Icon editCategory">Edit Category</a>
<a href="categories.php" class="Icon deleteCategory">Delete Category</a>
<a href="faq.php?cid=%d&a=add" class="Icon newFAQ">Add New FAQ</a></div>',
$category->getId(),
$category->getId());
}
} else {
?>
<hr>
<?php
}
$sql='SELECT faq.faq_id, question, ispublished, count(attach.file_id) as attachments '
.' FROM '.FAQ_TABLE.' faq '
......@@ -39,7 +39,7 @@ if(($res=db_query($sql)) && db_num_rows($res)) {
<ol>';
while($row=db_fetch_array($res)) {
echo sprintf('
<li><a href="faq.php?id=%d" class="previewfaq">%s</a> - <span>%s</span></li>',
<li><a href="faq.php?id=%d" class="previewfaq">%s <span>- %s</span></a></li>',
$row['faq_id'],$row['question'],$row['ispublished']?'Published':'Internal');
}
echo ' </ol>
......
This diff is collapsed.
scp/images/kb_category_bg.png

937 B

scp/images/kb_large_folder.png

2.47 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment