<?php
if (!defined('IN_SAS'))
{
	die("Hacking attempt");
}

/*
** DGS Search
** query.php written by James Sella
** Copyright (c) 2000-2001 Digital Genesis Software, LLC. All Rights Reserved.
** Released under the GPL Version 2 License.
** http://www.digitalgenesis.com
*#$Id: query.php,v 1.2 2006/10/15 19:08:55 fstuurman Exp $
*/

function query($retVal, $q, $r, $o, $s, $timer)
{
	global $config, $sas_lang, $serverpath, $site_url;

	$installBase = "$serverpath/modules/dgs_search";
	//	$urlBase = $site_url;

	$fonts = 'Arial, Sans-Serif, Helvetica';
	$target = '_self';
	$dispR = ($r == 65535) ? 0 : $r;

	//Fcs added for compatibilty with S@S	
	if (IsSet ($_GET['page']))
	{
		$page = intval($_GET['page']);
	}
	if (IsSet ($_GET['section']))
	{
		$section = intval($_GET['section']);
	}
	//Fcs end


	$searchURL = explode($serverpath, $installBase);
	$searchURL = $site_url . str_replace('\\', '/', $searchURL[1]) . '/search.php';
	$searchURL = $_SERVER['PHP_SELF'];
	printf("\t<DIV> <!-- Display Module: query -->\n\t\t<FORM METHOD=\"get\" ACTION=\"%s\" TARGET=\"%s\">\n\t\t\t<FONT FACE=\"%s\">%s</FONT>&nbsp;\n\t\t\t
	  <INPUT TYPE=\"text\" NAME=\"q\" VALUE=\"%s\" SIZE=\"30\" tabindex=\"1\">\n\t\t\t<INPUT TYPE=\"hidden\" NAME=\"r\" VALUE=\"%d\">
	  <INPUT TYPE=\"hidden\" NAME=\"page\" VALUE=\"$page\">
	  <INPUT TYPE=\"hidden\" NAME=\"section\" VALUE=\"$section\">\n\t\t\t
	  <INPUT TYPE=\"submit\" VALUE=\"%s\">\n\t\t</FORM>\n\t</DIV>\n", $searchURL, $target, $fonts, '', $q, $dispR, $sas_lang['search_module_submit']);

	return true;
}
?>
