-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.php
76 lines (61 loc) · 1.24 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
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
72
73
74
75
76
<?php
if(isset($_GET['p']))
{
$p = $_GET['p'];
}else{
$p = 'home';
}
//Get all possible pages:
$pages = array(
array()
);
/*How to store them:
name:
table:
parent?:
//Check request to see if it matches one of them
*/
//Load that page.
//Determine correct page
switch($p)
{
case 'Clothing':
$title = 'Discount Clothing';
break;
case 'view-product':
$title = 'View Products';
break;
case 'view-basket':
$title = 'View Basket';
break;
default: //If no match, load homepage
$title = 'Welcome';
break;
}//End page switch
//Load config file
require_once('includes/config.incl.php');
//Open database connection
require(DB);
//Load global functions
require_once('includes/global-functions.incl.php');
//Load correct page
//Begin session
session_start();
/*Iniciate cart
if(!isset($_SESSION['cart']))
{
echo 'hereeeee';
$_SESSION['cart'] = 0;
}
*
*/
//Load frontend functions
require_once('includes/functions.incl.php');
//Initialise template
require TEMPLATE_INIT;
//Load header
require_once('includes/header.incl.php');
//Load page
require_once("modules/$p/$p.handler.incl.php"); //Each modules has its own directory & page handler
//Load footer
require_once('includes/footer.incl.php');