<?
	include("connect.php");
	include("admin.config.inc.php");
	include("security.php");

	$content = addslashes($_POST["description"]);
	
	if($_POST["editfaq"]!="")
	{
		$id = $_POST["editid"];
//		$qrys = "select * from faq where que_title='$quetitle' and id<>'$id'";
		$qrys = "select * from faq where id<>'$id'";
		$ress = mysql_query($qrys);
		$totals = mysql_affected_rows();
		if($totals>0)
		{
			header("location: message.php?msg=27");
			exit;
		}
		else
		{
//		$qryupd = "Update faq set parent_topic='$topic', que_title='$quetitle', que_content='$content'";
		$qryupd = "Update faq set que_content='".addslashes($_POST["description"])."'";
		
		$qryupd .= " where id=1";
		mysql_query($qryupd) or die(mysql_error());
		header("location: message.php?msg=26");
		exit;
		}
	}
	
	
	
	if($_GET["faq_edit"]!="" || $_GET["faq_delete"]!="")
	{	
		if($_GET["faq_edit"]!=""){ $id = $_GET["faq_edit"]; }
		else{$id = $_GET["faq_delete"];}
		
		$qrysel = "select * from faq where id='$id'";
		$ressel = mysql_query($qrysel);
		$totalrow = mysql_affected_rows();
		$rows = mysql_fetch_array($ressel);
	}
	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$lng_characset;?>" />
<title></title>
<LINK href="main.css" type=text/css rel=stylesheet>
<script language="javascript" type="text/javascript" src="editor/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript" src="editor.js"></script>
<script language="JavaScript" type="text/javascript" class="g-s">				
</script> 


</head>

<body bgColor=#ffffff>   
<form name="f1" action="addfaq.php" method="post" onsubmit="return Check(f1)">
<table width="100%" cellpadding="0" cellSpacing="10">
  <tr>
	<td class="H1">±à¼­ÄÚÈÝ</td>
  </tr>
  <tr>
	<td background="<?=DIR_WS_ICONS?>vdots.gif"><IMG height=1 src="<?=DIR_WS_ICONS?>spacer.gif" width=1 border=0></td>
  </tr>
  
		<tr>
          <td class=f-c align=right valign="middle" width="191"><font class=a>*</font> ÄÚÈÝ :</td>
		  <td><textarea name="description<?=$i;?>" cols="80" rows="25" id="description"><?=stripslashes($rows["que_content"]);?></textarea></td>
		</tr>  	
		
		<input type="hidden" name="countervalue" value="1" />
		<tr>
			<td>&nbsp;</td>
		</tr>
		<tr valign="middle">
			<td colspan="2" align="center">
			
				<input type="submit" name="editfaq" value="±à¼­" class="bttn" />
				<input type="hidden" name="editid" value="1" />
			
			
			</td>
		</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
