-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.php
71 lines (38 loc) · 1.23 KB
/
search.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php include_once __DIR__ . "/assets/php/app.php" ?>
<?php
chechkSiteVisibilityStatusAndRedirect($dbConn);
chechkNumberOfProductsANdCategoriesAndDisplayMessage( $dbConn );
if ( chechkIfLoggedIn() )
{
$userDetails = getUserDetailsUsingUsername($dbConn, $_SESSION["SSID-USERNAME"] );
}
$total_number_of_products = count(getAllProducts($dbConn));
$total_number_of_categories = count(getAllCategories($dbConn));
?>
<?php
if( $_SERVER["REQUEST_METHOD"] === "GET" )
{
if ( isset( $_GET["q"] ) && !empty( $_GET["q"] ) )
{
$query = $_GET["q"];
$searchTerm = $query;
}
else
{
load404Page();
exit;
}
}
?>
<?php require_once 'assets/pages/head.php' ?>
<title> Search Results on ' <?php echo $searchTerm; ?> ' - <?php echo $site_titile ?></title>
</head>
<body>
<div class="container-fluid">
<?php require_once 'assets/pages/navigation.php' ?>
<div class="contents container-fluid">
<?php require_once 'assets/pages/sidebar.php' ?>
<?php require_once 'assets/pages/search.php' ?>
</div>
</div>
<?php require_once 'assets/pages/footer.php' ?>