-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
index.php
40 lines (32 loc) · 860 Bytes
/
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
<?php
/**
* Developed by: TanHongIT
* Website: https://tanhongit.com - https://tanhongit.net
* Github: https://github.com/TanHongIT
*/
use Dotenv\Dotenv;
require __DIR__ . '/vendor/autoload.php';
$dotenv = Dotenv::createImmutable(__DIR__);
$dotenv->load();
session_start();
require_once('lib/model.php');
require_once('lib/functions.php');
require_once('content/models/cart.php');
require "lib/statistics.php";
require "lib/counter.php";
if (isset($_GET['controller']) && '' != $_GET['controller']) {
$controller = $_GET['controller'];
} else {
$controller = 'home';
}
if (isset($_GET['action']) && '' != $_GET['action']) {
$action = $_GET['action'];
} else {
$action = 'index';
}
$file = 'content/controllers/' . $controller . '/' . $action . '.php';
if (file_exists($file)) {
require($file);
} else {
show404NotFound();
}