-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
58 lines (36 loc) · 1012 Bytes
/
index.php
File metadata and controls
58 lines (36 loc) · 1012 Bytes
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
<?php
// This is the main controller for the site.
// This is the main controller for the site.
// Get the database connection file
require_once 'library/connections.php';
// Get the PHP Motors model for use as needed
require_once 'model/main-model.php';
require_once 'library/functions.php';
session_start();
// Get the array of classifications
$carclassifications = getClassifications();
// Build a navigation bar using the $classifications array
$navList = navBar($carclassifications);
$action = filter_input(INPUT_POST, 'action');
if ($action == NULL){
$action = filter_input(INPUT_GET, 'action');
}
switch ($action){
case 'template':
include './view/template.php';
break;
case 'login':
include './view/login.php';
break;
case '500':
include './view/500.php';
break;
default:
if (!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] !== true){
session_destroy();
setcookie('firstname', null, -1, '/');
}
include './view/home.php';
break;
}
?>