<?php
/***************************************************************************
* FAQ.php
*
* begin : December 2005
* version : 2 October 2006
* copyright : (C) 2005,2006 grandolini.net
*
* FAQ display manager
*
***************************************************************************/
include('Session.php'); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title><?=$cat_name?></title>
<link rel="stylesheet" type="text/css" href="skins/<?=$_SESSION[misc][skin]?>/MAIN.CSS">
<?php
switch($_SESSION[browser])
{
case 'FF': ?><link rel="stylesheet" href="skins/<?=$_SESSION[misc][skin]?>/MAIN_FF.CSS" type="text/css" /><?php break;
case 'IE': ?><link rel="stylesheet" href="skins/<?=$_SESSION[misc][skin]?>/MAIN_IE.CSS" type="text/css" /><?php break;
}
echo "\n\n";
?>
<script type="text/javascript" src="common/js/fun2inc.js"></script>
</head>
<body onload="javascript=window.focus();" style="margin:15px;">
<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td valign="middle"><h1><?=$cat_name?></h1><br /></td></tr>
<tr>
<td valign="top" class="faqcontent" height="99%">
<table width="100%" border="0" cellpadding="7" cellspacing="0"><?php
$sth=db_query("SELECT * FROM faqs WHERE category_id='$category_id'");
$row=db_fetch($sth[0]);
for($i=0;$i<$sth[1];$i++)
{
if($answer==$row[$i][id])
{
?><tr>
<td class="QA" valign="top">Q <a name="<?=$answer?>"></a></td><td width="10px"></td>
<td class="question"><a href="<?=$_SERVER[PHP_SELF]?>?answer=0&cat_name=<?=$cat_name?>&category_id=<?=$category_id?>"><?=$row[$i][question]?></a></td>
</tr>
<tr>
<td class="QA" valign="top">A</td><td width="10px"></td>
<td class="answer"><?=$row[$i][answer]?></td>
</tr><?php
}
else
{
?><tr>
<td class="QA" valign="top">Q <a name="<?=$row[$i][id]?>"></td><td width="10px"></td>
<td class="question"><a href="<?=$_SERVER[PHP_SELF]?>?answer=<?=$row[$i][id]?>&cat_name=<?=$cat_name?>&category_id=<?=$category_id?>#<?=$row[$i][id]?>"><?=$row[$i][question]?></a></td>
</tr><?php
}
}
?>
</table>
</td>
</tr>
<tr><td align="center" valign="middle" height="30"><small><?=FAQW_HLP?></small></td></tr>
<tr><td align="right"><small><a href="javascript:window.print();" accesskey="p"><?=W_PRINT?></a> @> <a href="javascript:window.close();"><?=W_CLOSE?></a></small></td></tr>
<tr><td height="5"></td></tr>
</table>
<script type="text/javascript">
var top=getCookie('makePopup.top'); left=getCookie('makePopup.left');
var w=getCookie('makePopup.w'); h=getCookie('makePopup.h');
if(top!='undefined' && top!=null) { window.moveTo(left,top); }
if(w!='undefined' && top!=null) { window.resizeTo(w,h); }
//
// how to get the window top/left position to be saved in a cookie?
//
deleteCookie('makePopup.top');
deleteCookie('makePopup.left');
</script>
</body>
</html>