-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
83 lines (67 loc) · 1.84 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
ob_start();
session_start();
if( empty($_SESSION['group'])):
$session_group = 2;
else:
$session_group = $_SESSION['group'];
endif;
if( empty($_SESSION['pengguna_id'])):
$pengguna_id = 0;
else:
$pengguna_id = $_SESSION['pengguna_id'];
endif;
$page = isset($_GET['page']) ? ((int) $_GET['page']) : 1;
$kategori_id = isset($_GET['kategori_id']) ? ((int) $_GET['kategori_id']) : 0;
require_once "config/PasswordHash.php";
require_once "config/server.conf.php";
require_once "autoload.php";
$obj = new DB();
$tpl = new template();
$anime = new anime($obj);
$pagination = new pagination();
$pengaturan = new pengaturan($obj);
$group = new group($obj);
$link = new link($obj);
$menu = new menu($obj);
$pengguna = new pengguna($obj);
if( isset($_POST['tambah_kategori'])):
$anime->tambah_kategori($_POST);
endif;
if( isset($_POST['tambah_episode'])):
$anime->tambah_episode($_POST);
endif;
if( isset($_POST['tambah_link'])):
$link->tambah_link($_POST);
endif;
if( isset($_POST['tambah_menu'])):
$menu->tambah_menu($_POST);
endif;
if( isset($_POST['tambah_pengguna'])):
$pengguna->tambah_pengguna($_POST);
endif;
if( isset($_POST['valid_pengguna'])):
echo $pengguna->valid_pengguna($_POST);
endif;
echo $tpl->render("tpl/header.tpl");
if( isset($_GET['halaman']) ):
$halaman = $_GET['halaman'];
$halaman = "tpl/{$halaman}.tpl";
$url = "/?halaman=".$_GET['halaman'];
if($menu->menuByurl($session_group,$url) == 1 ):
if(file_exists($halaman)):
echo $tpl->render($halaman);
else:
echo "
<div class=\"alert alert-danger\"> <strong>Warning</strong> <br>File <code>{$halaman}</code> is not axists!</div>
";
endif;
else:
echo "
<div class=\"alert alert-danger\"> Anda tidak diijinkan untuk mengakses halaman ini</div>
";
endif;
else:
echo $tpl->render("tpl/home.tpl");
endif;
echo $tpl->render("tpl/footer.tpl");