<?php
include("postget.php");
include_once("common.php");
checklevel(2,$_REQUEST['clientid']);

echo '
<meta http-equiv="Content-Type" content="text/html; charset='.$config[72][1].'">
<link rel="stylesheet" type="text/css" media="screen" href="css/style.css">
';

if($mark=="".ucfirst(_MARK_AS_SPAM)."") {
	//// verificar si ya existe el filtro
	$data = query("SELECT type, text FROM hd_spamfilters WHERE type='".$newtype."' AND text='".$newtext."'",2);
	if ($data==0) {
		$query="INSERT INTO hd_spamfilters (type,text) VALUES ('$newtype','$newtext')";
		if(!mysql_query($query,$db_link)){
			messagetop("ERROR","DEBUG: ".$query."<br>MYSQL ERROR: ".mysql_error(),'spamfilters.php',0);
		}else{
			print("
		<font color='green' style='text-shadow: -1px 0 white, 0 1px white, 1px 0 white, 0 -1px white'><br><b>".ucfirst(_FILTER_ADDED)."</b></font><br><br>
		<a href='javascript:close();'><b>".strtoupper(_RETURN)."</b></a>
		");
		}
	}else{
		print("
		<font color='red'><br><b>".ucfirst(_FILTER_ALREADY_EXISTS)."</b></font><br><br>
		<a href='javascript:close();'><b>".strtoupper(_RETURN)."</b></a>
		");
	}


}else{
	print("<b>".ucfirst(_MARK_AS_SPAM)."</b>");

	print("<br><br>".ucfirst($type).": ".$text);

	print("<br><br><form method='POST'>");
	print("<input type='hidden' name='newtype' value='$type'>");
	print("<input type='hidden' name='newtext' value='$text'>");

	print("<input type='submit' name='mark' value='".ucfirst(_MARK_AS_SPAM)."' class='btnformred'>");
	print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='javascript:close()' class='btnformyellow'><b>".ucfirst(_RETURN)."</b></a>");
	
	print("</form>");
	
	print("");
}

?>