-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.php
45 lines (41 loc) · 1.46 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
<?php
session_start();
require_once "database/recipesDB.php";
require_once "database/checkDB.php";
require_once "database/numbersDB.php";
require_once "service/search.php";
require_once "models/user.php";
require_once "models/recipe.php";
$recipes = array();
if (isset($_GET['action']) && $_GET['action'] === 'filter')
$recipes = getFilteredRecipes();
else if (isset($_GET['action']) && $_GET['action'] === 'order')
$recipes = getAllRecipesInOrder($_GET['column'], $_GET['order']);
else
$recipes = getTheNewestRecipes();
$user = null;
if (isset($_SESSION['logged']))
$user = unserialize($_SESSION['user']);
?>
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>BeChef</title>
<meta name="description" content="BeChef">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="view/styles/style.css">
<link rel="stylesheet" href="https://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css">
<script src="view/script/jquery-3-5-1.min.js"></script>
<script src="view/script/jquery-ui-1-12-1.min.js"></script>
</head>
<body>
<?php include 'view/components/nav.php' ?>
<?php include 'view/components/searchBar.php' ?>
<main id="recipe-cards" style="margin-top: 5em;">
<?php foreach ($recipes as $rec) : ?>
<?php include 'view/components/card.php' ?>
<?php endforeach ?>
</main>
</body>
</html>