<? include_once("../includes/main.inc.php");





if(isset($_REQUEST['Submit'])){

	if($f_id!='' && $f_id!=0){

		$u_r=fetchRecArr("tbl_feedback","f_name,f_email,f_id"," f_id ='$f_id'");

		if(!empty($u_r)){

		@extract($u_r);

		$fname2="$f_name $l_name";

		$email_subject	=	stripslashes($subject);

		$body			=	readmyfile(SITE_WS_PATH."/includes/email/reply.txt");

		$body			=	str_replace('{SITE}',"<b>".SITE_NAME."</b>",$body);

		$body			=	str_replace('{member}',ucfirst($fname2),$body);

		$body			=	str_replace('{message}',$reply,$body);

		$body			=	str_replace('{SITE_PATH}',SITE_WS_PATH,$body);

		$body			=	str_replace('{ADMIN_EMAIL}',ADMIN_EMAIL,$body);

		$body			= 	nl2br($body);

		$email_to		=	$f_email;

		

		$email_toname	=	ucfirst($fname2);	

		sendMail($email_to,$emailto_name,$email_subject,$body,ADMIN_EMAIL,ADMIN_EMAIL,$html=true);	

	    set_session_msg("Your reply has been send successfully.");

		db_query("Update tbl_feedback set f_reply='Sent',f_reply_date=now() where f_id='$f_id'");

	    echo "<script language='javascript'> window.opener.document.location.href='feedback_list.php?start=".$start."'; </script>";

	    echo "<script language='javascript'> window.close('reply.php'); </script>";

	    exit;

	  }

	}

}







if($_REQUEST['f_id']!='' && $_REQUEST['f_id']!=0) {

	$sql = "select * from tbl_feedback where f_id = '$f_id'";

	$result = db_query($sql);

	if ($line_raw = mysql_fetch_array($result)) {

		$line = ms_form_value($line_raw);

		@extract($line);

	}

}

?>	

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

"http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title><?=SITE_NAME?></title>

<script type="text/javascript" src="swfobject.js"></script>

<link href="styles.css" rel="stylesheet" type="text/css">

</head>

<body background="images/bg2a.gif">

<form name="send_reply" action="" method="post" onSubmit="return validate(this)">

<table border="0" cellpadding="0" width="100%" cellspacing="0">

   <tr>

  

    <td  align="left"  id="pageHead"><div id="txtPageHead">

      Reply Feedback</div></td>

   

  </tr>

  </table><br>

  <table border="0" cellpadding="0" cellspacing="0">

  <tr>

    <td background="images/winlt.gif"></td>

    <td height="25" align="left" valign="top" bgcolor="#FFFFFF" class="btmbrdr"><strong>Subject</strong></td>

    <td align="left" valign="top" bgcolor="#FFFFFF">:</td>

    <td align="left" valign="top" bgcolor="#FFFFFF" class="btmbrdr"><input name="subject" type="text" class="textfield1" size="58" value="Reply to:<?=$f_subject?>"></td>

    <td background="images/winrt.gif"></td>

  </tr>

  <tr>

    <td background="images/winlt.gif"></td>

    <td align="left" valign="top" bgcolor="#FFFFFF" class="btmbrdr"><strong>Reply</strong></td>

    <td align="left" valign="top" bgcolor="#FFFFFF">:</td>

    <td align="left" valign="top" bgcolor="#FFFFFF" class="btmbrdr"><textarea name="reply" cols="60" rows="7" class="textfield1"></textarea></td>

    <td background="images/winrt.gif"></td>

  </tr>

  <tr>

    <td background="images/winlt.gif"></td>

    <td height="30" align="left" valign="middle" bgcolor="#FFFFFF">&nbsp;</td>

    <td height="30" align="left" valign="middle" bgcolor="#FFFFFF">&nbsp;</td>

    <td height="30" align="left" valign="middle" bgcolor="#FFFFFF"><input name="Submit" type="submit" class="button" value="Send">

	  <input type="hidden" name="f_id" value="<?=$f_id?>">

	  <input type="hidden" name="start" value="<?=$start?>">

	  <input name="reset" type="reset" class="button" value="Reset"></td>

    <td background="images/winrt.gif"></td>

  </tr>

  <tr>

    <td><img src="images/win3.gif" width="5" height="6"></td>

    <td colspan="3" background="images/win-btm.gif"></td>

    <td><img src="images/win4.gif" width="6" height="6"></td>

  </tr>

</table>

</form>

<map name="Map">

  <area shape="rect" coords="49,81,184,96" href="#">

  <area shape="rect" coords="49,97,185,112" href="#">

</map>

</body>

</html>

