<?
function search($QUERY_START_DATETIME,$QUERY_END_DATETIME,$QUERY_MODE,$QUERY_IP,$QUERY_INFORM,$QUERY_FORWARD,$QUERY_STAUTS){
	$_path = "../_read_source/_".$QUERY_STAUTS.".php";
	require($_path);
	
	if ($QUERY_START_DATETIME == '') $QUERY_START_DATETIME = "1900-00-00 00:00:00";
	if ($QUERY_END_DATETIME == '') $QUERY_END_DATETIME = "2037-12-31 23:59:59";
	
	$strSQL = " DATE_FORMAT(".$DB_NETUSERULE_DATETIME.",'%Y-%m-%d %T') between '".$QUERY_START_DATETIME."' and '".$QUERY_END_DATETIME."'";

	if ($QUERY_IP != '') $strSQL=$strSQL." and ".$DB_NETUSERULE_IP." = '".$QUERY_IP."'";
	if ($QUERY_MODE != '') $strSQL=$strSQL." and ".$DB_NETUSERULE_MODE." = '".$QUERY_MODE."'";
	if ($QUERY_INFORM != '') $strSQL=$strSQL." and ".$DB_NETUSERULE_INFORM." = '".$QUERY_INFORM."'";
	if ($QUERY_FORWARD != '') $strSQL=$strSQL." and ".$DB_NETUSERULE_FORWARD." = '".$QUERY_FORWARD."'";
	
	return $strSQL;
}
?>