-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
51 lines (42 loc) · 1.15 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
<?php
require "init.php";
global $helper;
date_default_timezone_set("Europe/Istanbul");
setlocale(LC_TIME,"tr_TR");
$page = $_GET['page'] ?? "home";
$type = $_GET['type'] ?? null;
if($page){
$filePath = "src/inc/pages/{$page}.page.php";
if (file_exists($filePath)) {
if($settings["error"]){
$helper::setTitle("HATA!");
}else{
$helper::setTitle(ucfirst($page));
}
} else {
$helper::setTitle("Sayfa Bulunamadı.");
}
}
require "src/assets/php/header.php";
switch ($page) {
default:
if ($page) {
$filePath = "src/inc/pages/{$page}.page.php";
if($settings["bakim"]){
$filePath = "src/inc/pages/bakimdayiz.page.php";
}
if (file_exists($filePath)) {
if($settings["error"]){
$helper::setTitle("Bir Hata Meydana Geldi!");
}else{
require_once $filePath;
}
} else {
http_response_code(404);
}
} else {
header("Location: /home");
}
break;
}
require "src/assets/php/footer.php";