<?php include("../includes/connection.php"); ?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<SCRIPT language=JavaScript src="include/yusasp_ace.js"></SCRIPT>
<SCRIPT language=JavaScript src="include/yusasp_color.js"></SCRIPT>

</head>

<body>
<!-- <form name="frm" method=post onsubmit="javascript: assignvalue();"> -->
<form name="frm" method=post action="edit.php" onsubmit="javascript: assignvalue();">
<SCRIPT>
	var ArticleObj = new ACEditor("ArticleObj")
	ArticleObj.width = "100%"
	ArticleObj.height = 400
	ArticleObj.useStyle = false
	ArticleObj.useAsset = false
	ArticleObj.useImage = true
	ArticleObj.usePageProperties = false
	ArticleObj.isFullHTML = false;
	ArticleObj.RUN()
</SCRIPT>
<table border=0 cellspacing=0 cellpadding=0 valign=top align=center>
<DIV style="VISIBILITY: hidden"><TEXTAREA name=txt rows=5 cols=10>
<?php
		//opendb();
		if ($HTTP_GET_VARS[merchant_id] !='')
		{
		$sql="select merchant_description from merchant_master where  merchant_id=". $HTTP_GET_VARS[merchant_id];
		$cmd = mysql_query($sql);
		$rs = mysql_fetch_array($cmd);
		echo  str_replace(chr(13),"<br>",$rs[0]); 
		}
		if ($HTTP_GET_VARS[merchant_id_rules] !='')
		{
		$sql="select merchant_rules from merchant_master where  merchant_id=". $HTTP_GET_VARS[merchant_id_rules];
		$cmd = mysql_query($sql);
		$rs = mysql_fetch_array($cmd);
		echo  str_replace(chr(13),"<br>",$rs[0]); 
		}
		if ($HTTP_GET_VARS[faq_id] !='')
		{
		$sql="select faq_answer from faq_master where  faq_id=". $HTTP_GET_VARS[faq_id];
		$cmd = mysql_query($sql);
		$rs = mysql_fetch_array($cmd);
		echo  str_replace(chr(13),"<br>",$rs[0]); 
		}
?>
</TEXTAREA></DIV></TD></TR>
<input type="hidden" name="finaltxt" value="">

<tr><td align=middle><input name="Save" type="submit" value="Save"><br>
<font face=arial size=1>(Don't Save in HTML View)<font></td></tr>
</table>
</form>
</body>
</html>
<SCRIPT language=javascript>

	ArticleObj.putContent(document.frm.txt.value);

</SCRIPT>
<script>
	function assignvalue()
	{
		<?if ($HTTP_GET_VARS[type] =='3')
		{?>
		document.frm.finaltxt.value = ArticleObj.getContentBody();
		window.opener.document.frmCatPopup.faq_answer.value = ArticleObj.getContentBody();	
		window.close();
		<?}
		if ($HTTP_GET_VARS[type] =='3') {?>
			document.frm.finaltxt.value = ArticleObj.getContentBody();
		window.opener.document.frmCatPopup.merchant_description.value = ArticleObj.getContentBody();	
		window.close();
		<?}
			if ($HTTP_GET_VARS[type] =='4') {?>
			document.frm.finaltxt.value = ArticleObj.getContentBody();
		window.opener.document.frmCatPopup.merchant_rules.value = ArticleObj.getContentBody();	
		window.close();
		<?}?>
	}
</script>
