-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
64 lines (56 loc) · 1.58 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
<?php
session_start();
include_once "application/config/main.php";
include_once "vendor/autoload.php";
include_once "core/helpers/Format.php";
include "core/Model.php";
include "core/Controller.php";
include "core/View.php";
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
//Config
Model::setParams($params);
Controller::setParams($params);
include "application/models/LawsModel.php";
include "application/models/RegModel.php";
include "application/models/CategoryModel.php";
include "application/models/galleryModel.php";
include "application/models/AdminModal.php";
include "application/models/MessageModel.php";
include "application/models/CommentModel.php";
include "application/controllers/SiteController.php";
include "application/controllers/StudentController.php";
include "application/controllers/AdminController.php";
$route = isset($_GET['c']) ? $_GET['c']:'';
$method = isset($_GET['m']) ? $_GET['m']: '';
$site = new SiteController('site');
$admin = new AdminController("admin");
$student = new StudentController('student');
$events = new StudentController('events');
if ($route === '') {
$site->index();
}
else if ($route === 'admin' && $method == '') {
$admin->admin();
}
else if($route === "logout"){
$admin->logout();
}
else if ($route == 'site' && $method == 'pdf') {
$site->pdf();
}
else {
if ($method !== '') {
if (method_exists($$route, $method)) {
$$route->$method();
}
else {
echo "metod yo'q";
exit;
}
}
else {
$site->index();
}
}