1
1
mirror of https://github.com/neosubhamoy/neosubhamoy-portfolio.git synced 2025-12-20 01:09:35 +05:30

(feat): added pages and quick actions as search results

This commit is contained in:
2023-11-18 20:49:22 +05:30
parent 96ce43b1fe
commit 9d01ef753c
4 changed files with 83 additions and 5 deletions

View File

@@ -5,11 +5,15 @@ require 'query_functions.php';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (isset($_POST['keyword'])) {
$keyword = $_POST['keyword'];
$results_projects = fetch_search_results_projects($conn, $keyword);
$results_socials = fetch_search_results_socials($conn, $keyword);
$results_array = [
$results_projects = fetch_search_results_projects($conn, $keyword),
$results_socials = fetch_search_results_socials($conn, $keyword),
$results_pages = fetch_search_results_pages($conn, $keyword),
$results_quickactions = fetch_search_results_quickactions($conn, $keyword)
];
$results = [];
foreach ([$results_projects, $results_socials] as $array) {
foreach ($results_array as $array) {
if (!empty($array)) {
$results = array_merge($results, $array);
}