<?
	#---------------------------------------------------------------------#
	# This source code is (c)2000 White Pajamas, Inc                      #
	# see http://www.stonekeep.com/license.html for licensing information #
	#---------------------------------------------------------------------#

	#----------------------------------------------------------------------
	# $Id: postfilter.php3,v 1.6 2000/12/14 19:13:54 shevett Exp $
	#----------------------------------------------------------------------
	
?>

<?
if ($f_flag == "addfilter") {
	$fixedquery = addslashes("$a_fselect");
	$ustring = "insert into filters (uid,fdesc,ftable,fpublic,fselect) values ('$a_uid','$a_fdesc','$a_ftable',$a_fpublic,'$fixedquery')";
	$spost = db_query($ustring);
       $filtrow = db_insertid($spost);
	$lastresult[0] = 0;
	$lastresult[1] = "Filter #$filtrow added successfully.";
} else {
	if ($f_flag == "modfilter") {
		$fixedquery=addslashes("$a_fselect");
		$ustring = "update filters set uid='$a_uid',fdesc='$a_fdesc',ftable='$a_ftable',fpublic=$a_fpublic,fselect='$fixedquery' where _rowid=$a_rowid";
		$spost = db_query("$ustring");
		$lastresult[0] = 0;
		$n=db_affected_rows($spost);
		$lastresult[1] = "Update complete.  $n rows updated.";
	} else {
		# we shouldn't have gotten here.
		$lastresult[0]=1;
		$lastresult[1]="Unexpected condition occured! [postfilter.php3]";
	}
}
?>
