diff --git a/admin/adminAppQueue.php b/admin/adminAppQueue.php
index d0b6b97..9f33a92 100644
--- a/admin/adminAppQueue.php
+++ b/admin/adminAppQueue.php
@@ -99,8 +99,7 @@ if ($_REQUEST['sub'])
} else // application
{
echo html_frame_start("Potential duplicate applications in the database","90%","",0);
- $hResult = searchForApplication($oApp->sName);
- outputSearchTableForhResult($oApp->sName, $hResult);
+ perform_search_and_output_results($oApp->sName);
echo html_frame_end(" ");
//help
diff --git a/include/util.php b/include/util.php
index 8d31794..a26231e 100644
--- a/include/util.php
+++ b/include/util.php
@@ -585,4 +585,16 @@ function process_app_version_changes($isVersion)
}
}
+function perform_search_and_output_results($search_words)
+{
+ echo "
Like matches";
+ $hResult = searchForApplication($search_words);
+ outputSearchTableForhResult($search_words, $hResult);
+
+ $minMatchingPercent = 60;
+ echo "Fuzzy matches - minimum ".$minMatchingPercent."% match";
+ $hResult = searchForApplicationFuzzy($search_words, $minMatchingPercent);
+ outputSearchTableForhResult($search_words, $hResult);
+}
+
?>
\ No newline at end of file
diff --git a/search.php b/search.php
index 7546cd1..4031aee 100644
--- a/search.php
+++ b/search.php
@@ -12,15 +12,6 @@ require(BASE."include/application.php");
apidb_header("Search Results");
-
-echo "Like matches";
-$hResult = searchForApplication($_REQUEST['q']);
-outputSearchTableForhResult($_REQUEST['q'], $hResult);
-
-$minMatchingPercent = 60;
-echo "Fuzzy matches - minimum ".$minMatchingPercent."% match";
-$hResult = searchForApplicationFuzzy($_REQUEST['q'], $minMatchingPercent);
-outputSearchTableForhResult($_REQUEST['q'], $hResult);
-
+perform_search_and_output_results($_REQUEST['q']);
apidb_footer();
?>