Location: PHPKode > projects > phpCAMALEO > common/contents/FAQ_mngr.tpl
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
	<title>phpCAMALEO.org @> <?=$title?> <?=$_SESSION[misc][server_name_title]?></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";
	?>
</head>
<body>
<form action="<?=$_SERVER[PHP_SELF]?>" method="post" name="faq">
<table width="100%" height="100%" cellpadding="3" cellspacing="0" border="0">
	<tr><td id="bgcol0" align="center" height="30" colspan="4"><h1><?=$title?></h1></td></tr>
	<tr><td height="15" colspan="4"></td></tr>
<?php
#include('header.inc');
#
switch($_GET[optype])
{
	case 'cadd': ?><tr><td><input class="form" type="text" name="category" size="64"><br /><input style="margin-top:5px;" class="button" type="submit" name="submit" value="<?=ADD_FAQC?>" accesskey="a"></td></tr><?php break;
	case 'cmod': ?><tr><td><input type="hidden" name="id" value="<?=$_SESSION[catid]?>"><input class="form" type="text" name="category" size="64" value="<?=$category?>"><br /><input style="margin-top:5px;" class="button" type="submit" name="submit" value="<?=UPD_FAQC?>" accesskey="u"></td></tr><?php break;
	case 'cdel': ?><tr><td><input type="hidden" name="id" value="<?=$_SESSION[catid]?>"><font color="red"><b><?=FAQ_CONFDELCAT?></b></font><br /><br /><b><?=$category?></b><br /><input class="button" style="margin-top:50px;color:red;" type="submit" name="submit" value="<?=DEL_FAQC?>"></td></tr><?php break;
	#
	case 'flist':
			$sth=db_query("SELECT * FROM faqs WHERE category_id='$_SESSION[catid]'"); $row=db_fetch($sth[0]);
			?><tr><td colspan="4"><b><?=FAQ_FAQ?>:</b>&nbsp;<a href="<?=$_SERVER[PHP_SELF]?>?optype=fadd" accesskey="a"><?=ADD?></a></td></tr><tr><td height="15px"></td></tr>
			  <tr><td class="QA"><?=FAQ_Q?></td><td class="QA"><?=FAQ_A?></td><td colspan="2">&nbsp;</td></tr><?php
			for($i=0;$i<$sth[1];$i++)
			{
				?><tr>
					<td width="49%" valign="top"><a href="<?=$_SERVER[PHP_SELF]?>?optype=fmod&catid=<?=$row[$i][category_id]?>&faqid=<?=$row[$i][id]?>"><?=$row[$i][question]?></a></td>
					<td width="49%" valign="top"><?=$row[$i][answer]?></td>
					<td valign="top" align="right" colspan="2"><input class="button_sml" style="color:red;" type="button" onclick="javascript:window.location='<?=$_SERVER[PHP_SELF]?>?optype=fdel&faqid=<?=$row[$i][id]?>';" value="<?=DEL_FAQ?>"></td>
				</tr><?php
			}
		break;
	#
	case 'fadd': ?>	<tr>
						<td class="QA" valign="top"><?=FAQ_Q?><input type="hidden" name="catid" value="<?=$_SESSION[catid]?>"><input type="hidden" name="id" value="<?=$_SESSION[faqid]?>"></td><td>&nbsp;</td>
						<td><textarea class="form" name="question" cols="60" rows="3" wrap="hard"><?=$question?></textarea></td>
					</tr>
					<tr><td height="10px"></td></tr>
					<tr>
						<td class="QA" valign="top"><?=FAQ_A?></td><td width="15px">&nbsp;</td>
						<td><textarea class="form"name="answer" cols="60" rows="10" wrap="hard"><?=$answer?></textarea></td>
					</tr>
					<tr>
						<td colspan="2">&nbsp;</td>
						<td>
							<input style="margin-top:5px;" class="button" type="submit" name="submit" value="<?=ADD_FAQ?>" accesskey="a">
							&nbsp;<input class="button" type="button" onclick="javascript:window.location='<?=$_SERVER[PHP_SELF]?>?optype=flist&catid=<?=$_SESSION[catid]?>&catname=<?=$_SESSION[category]?>';" value="<?=LIST_FAQ?>" accesskey="t">
						</td>
					</tr><?php break;
	#
	case 'fmod': ?>	<tr>
						<td class="QA" valign="top"><?=FAQ_Q?><input type="hidden" name="id" value="<?=$_SESSION[faqid]?>"></td><td>&nbsp;</td>
						<td><textarea class="form" name="question" cols="60" rows="3" wrap="hard"><?=$question?></textarea></td>
					</tr>
					<tr><td height="10px"></td></tr>
					<tr>
						<td class="QA" valign="top"><?=FAQ_A?></td><td width="15px">&nbsp;</td>
						<td><textarea class="form"name="answer" cols="60" rows="10" wrap="hard"><?=$answer?></textarea></td>
					</tr>
					<tr>
						<td colspan="2">&nbsp;</td>
						<td>
							<input style="margin-top:5px;" class="button" type="submit" name="submit" value="<?=UPD_FAQ?>" accesskey="u">
							&nbsp;<input class="button" type="button" onclick="javascript:window.location='<?=$_SERVER[PHP_SELF]?>?optype=flist&catid=<?=$_SESSION[catid]?>&catname=<?=$_SESSION[category]?>';" value="<?=LIST_FAQ?>" accesskey="t">
							<br /><input class="button" style="margin-top:50px;color:red;" type="button" onclick="javascript:window.location='<?=$_SERVER[PHP_SELF]?>?optype=fdel&faqid=<?=$_SESSION[faqid]?>';" value="<?=DEL_FAQ?>">
						</td>
					</tr><?php break;
	#
	case 'fdel': ?><tr><td><input type="hidden" name="id" value="<?=$_SESSION[faqid]?>"><font color="red"><b><?=FAQ_CONFDELFAQ?></b></font><br /><br /><b><?=$question?></b><br /><br /><b><?=$answer?></b><br /><br /><input class="button" style="margin-top:50px;color:red;" type="submit" name="submit" value="<?=DEL_FAQ?>"></td></tr><?php break;
	#
	default:
		?><tr><td colspan="4"><b><?=FAQ_CAT?>:</b>&nbsp;<a href="<?=$_SERVER[PHP_SELF]?>?optype=cadd" accesskey="a"><?=ADD?></a>&nbsp;&nbsp;@&gt;&nbsp;&nbsp;<?=FAQ_CATCMDS_HLP?></td></tr><tr><td height="15px"></td></tr><?php
		$sth=db_query('SELECT * FROM faqcategories WHERE siteid=\''.$_SESSION[misc][skin].'\' ORDER BY category'); $row=db_fetch($sth[0]);
		for($i=0;$i<$sth[1];$i++)
		{
			?><tr>
				<td><input class="button_sml" type="button" onclick="javascript:window.location='<?=$_SERVER[PHP_SELF]?>?optype=flist&catid=<?=$row[$i][id]?>&catname=<?=$row[$i][category]?>';" value="<?=LIST_FAQC?>"></td>
				<td>&nbsp;</td>
				<td width="99%"><a href="<?=$_SERVER[PHP_SELF]?>?optype=cmod&catid=<?=$row[$i][id]?>&catname=<?=$row[$i][category]?>"><?=$row[$i][category]?></a></td>
				<td><input class="button_sml" style="color:red;" type="button" onclick="javascript:window.location='<?=$_SERVER[PHP_SELF]?>?optype=cdel&catid=<?=$row[$i][id]?>&catname=<?=$row[$i][category]?>';" value="<?=DEL_FAQC?>"></td>
			</tr><?php
		}
}
#
#include('footer.inc');
?>

	<tr><td height="99%" valign="top"></td></tr>
	<tr>
		<td colspan="3" height="30" id="bgcol0" style="padding:0px 0 0 15;" align="left" width="90%"><small>
			<a href="<?=$_SERVER[PHP_SELF]?>"><?=ADMIN_FAQH?></a><?php if($_SESSION[faqed]=='@') { ?> @&gt; <a href="<?=$_SERVER[PHP_SELF]?>?optype=flist&catid=<?=$_SESSION[catid]?>&catname=<?=$_SESSION[category]?>"><?=ADMIN_FAQC?></a><?php } ?>
		</small></td>
		<td colspan="2" id="bgcol0" height="30" id="bgcol0" style="padding:0px 15 0 0;" align="right" ><small><a href="../../LoadPage.php?page=siteadmin"><?=ADMIN_HOME?></a></small></td>
	</tr>
</table>
</form><?php 
switch($focus)
{
	case 'category': ?><script>document.faq.category.focus();</script><?php ; break;
	case 'question': ?><script>document.faq.question.focus();</script><?php ; break;
}
?>
</body>
</html>
Return current item: phpCAMALEO