-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuser.php
43 lines (35 loc) · 1.49 KB
/
user.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
<?php
require_once('runtime.php');
require_once('lib/core/router_old.class.php');
require_once('lib/core/User.class.php');
require_once('lib/core/routersnotassigned.class.php');
require_once('lib/core/Eventlist.class.php');
require_once('lib/core/Service.class.php');
require_once('lib/core/Servicelist.class.php');
//get messages of the message system
$smarty->assign('message', Message::getMessage());
//get some status variables
$smarty->assign('is_logged_in', Permission::isLoggedIn($_SESSION['user_id']));
//get user data
$user = new User((int)$_GET['user_id']);
$user->fetch();
$smarty->assign('user', $user);
$evenlist = new Eventlist();
$routerlist = new Routerlist(false, (int)$_GET['user_id']);
foreach($routerlist->getRouterlist() as $router) {
$tmp_eventlist = new Eventlist();
$tmp_eventlist->init('router', $router->getRouterId(), false, 0, 6, 'event_id', 'desc');
$evenlist->add($tmp_eventlist);
}
$evenlist->sort('create_date', 'desc');
$smarty->assign('eventlist', array_slice($evenlist->getEventlist(), 0, 10));
$smarty->assign('routersnotassigned_list', RoutersNotAssigned::getRouters());
$routerlist = new Routerlist(false, (int)$_GET['user_id']);
$smarty->assign('routerlist', $routerlist->getRouterlist());
$servicelist = new Servicelist((int)$_GET['user_id']);
$smarty->assign('servicelist', $servicelist->getServicelist());
//load the temlate
$smarty->display("header.tpl.html");
$smarty->display("user.tpl.html");
$smarty->display("footer.tpl.html");
?>