<?
$page = "support_faq.php";
include "manager_header.php";
echo $head;


if($admin_info[faq_on] != 1) {
echo "
<h2>$support_faq1</h2>
$support_faq2
";
echo $foot;
exit();
}


if(isset($_GET['q_id'])) { $q_id = $_GET['q_id']; }



if($q_id != "") {
$question_query = mysql_query("SELECT * FROM bhost_faq WHERE q_id='$q_id'");
$question = mysql_fetch_assoc($question_query);
if(mysql_num_rows($question_query) == 0) {
echo "<h2>$support_faq1</h2>
$support_faq3
";
}

echo "
<h2>$question[question]</h2>
$question[answer]

<br><br>

<table cellpadding='0' cellspacing='0'>
<form action='support_faq.php' method='POST'>
<tr>
<td><input type='submit' class='button' value='$support_faq4'>&nbsp;</td>
</form>
<form action='support.php' method='POST'>
<td><input type='submit' class='button' value='$support_faq5'></td>
</form>
</tr>
</table>
";




} else {





echo "

<h2>$support_faq6</h2>
";

$faq_questions = mysql_query("SELECT * FROM bhost_faq");
$numofquestions = mysql_num_rows($faq_questions);

if($numofquestions > 0) {
echo "
$support_faq7

<br>
";
} else {
echo "
$support_faq8
<br><br>
<form action='support.php' method='POST'>
<input class='button' type='submit' value='$support_faq9'>
</form>


";

echo $foot;
exit();
}

$counter = 0;
$faqcat = mysql_query("SELECT * FROM bhost_faqcat ORDER BY c_order");
$num_of_kitties = mysql_num_rows($faqcat);
while($faqcat_info = mysql_fetch_assoc($faqcat)) {
$counter++;
echo "
<br><font class='bold'>$faqcat_info[category]</font><br>
";
$count = 0;
$questions1 = mysql_query("SELECT q_id, fc_id, question FROM bhost_faq WHERE fc_id='$faqcat_info[fc_id]' ORDER BY q_order");
while($question = mysql_fetch_assoc($questions1)) {
$count++;
echo "$count. <a href='support_faq.php?q_id=$question[q_id]'>$question[question]</a><br>";
}
echo "
";
}

echo "
<br>
<form action='support.php' method='POST'>
<input type='submit' class='button' value='$support_faq9'>
</form>
";

}





echo $foot;
?>
