-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
31 lines (27 loc) · 1.06 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
<?php
require_once "config.php";
function __autoload($file)
{
if (file_exists('controller/' . $file . '.php')) {
require_once 'controller/' . $file . '.php';
} elseif (file_exists('model/' . $file . '.php')) {
require_once 'model/' . $file . '.php';
} elseif (file_exists('API/' . $file . '.php')) {
require_once 'API/' . $file . '.php';
} elseif (file_exists('model/BookRepository/' . $file . '.php')) {
require_once 'model/BookRepository/' . $file . '.php';
} elseif (file_exists('model/AuthorRepository/' . $file . '.php')) {
require_once 'model/AuthorRepository/' . $file . '.php';
} elseif (file_exists('model/CategoryRepository/' . $file . '.php')) {
require_once 'model/CategoryRepository/' . $file . '.php';
}
}
if (isset($_GET['book'])) {
$init = new BookById();
} elseif (isset($_GET['authors']) && (!empty($_GET['authors'])) ||
(isset($_GET['categories']) && (!empty($_GET['categories'])))) {
$init = new Filter();
} else {
$init = new Index();
}
echo $init->execute();