/
index.php
37 lines (34 loc) · 1.29 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Shopping</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
</head>
<body>
<?php
include_once './functions/dbconnect.php';
include_once './functions/utils-function.php';
include_once './functions/category-functions.php';
include './functions/products-functions.php';
require_once './includes/store/session-start.req-inc.php';
$categories = getAllCategories();
if(isPostRequest()){
$_SESSION['cart'][] = filter_input(INPUT_POST, 'product_id');
$id = filter_input(INPUT_GET, 'category_id');
$results = searchProduct($id);
}
if (isGetRequest()) {
$id = filter_input(INPUT_GET, 'category_id');
$results = searchProduct($id);
}else{
$id = ' ';
}
?>
<?php include './includes/store/header.php'; ?>
<?php include './includes/store/storeTable.php'; ?>
</body>
</html>