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