-
Notifications
You must be signed in to change notification settings - Fork 0
/
sidebar.php
114 lines (111 loc) · 4.66 KB
/
sidebar.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<aside class="main-sidebar sidebar-dark-primary elevation-4">
<div class="dropdown">
<a href="javascript:void(0)" class="brand-link dropdown-toggle" data-toggle="dropdown" aria-expanded="true">
<span class="brand-image img-circle elevation-3 d-flex justify-content-center align-items-center bg-primary text-white font-weight-500" style="width: 38px;height:50px"><?php echo strtoupper(substr($_SESSION['login_firstname'], 0,1).substr($_SESSION['login_lastname'], 0,1)) ?></span>
<span class="brand-text font-weight-light"><?php echo ucwords($_SESSION['login_firstname'].' '.$_SESSION['login_lastname']) ?></span>
</a>
<div class="dropdown-menu" style="">
<a class="dropdown-item manage_account" href="javascript:void(0)" data-id="<?php echo $_SESSION['login_id'] ?>">Manage Account</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="ajax.php?action=logout">Logout</a>
</div>
</div>
<div class="sidebar">
<nav class="mt-2">
<ul class="nav nav-pills nav-sidebar flex-column nav-flat" data-widget="treeview" role="menu" data-accordion="false">
<li class="nav-item dropdown">
<a href="./" class="nav-link nav-home">
<i class="nav-icon fas fa-tachometer-alt"></i>
<p>
Dashboard
</p>
</a>
</li>
<?php if($_SESSION['login_type'] == 1): ?>
<li class="nav-item">
<a href="#" class="nav-link nav-edit_user">
<i class="nav-icon fas fa-users"></i>
<p>
Users
<i class="right fas fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="./index.php?page=new_user" class="nav-link nav-new_user tree-item">
<i class="fas fa-angle-right nav-icon"></i>
<p>Add New</p>
</a>
</li>
<li class="nav-item">
<a href="./index.php?page=user_list" class="nav-link nav-user_list tree-item">
<i class="fas fa-angle-right nav-icon"></i>
<p>List</p>
</a>
</li>
</ul>
</li>
<li class="nav-item">
<a href="#" class="nav-link nav-is-tree nav-edit_survey nav-view_survey">
<i class="nav-icon fa fa-poll-h"></i>
<p>
Survey
<i class="right fas fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="./index.php?page=new_survey" class="nav-link nav-new_survey tree-item">
<i class="fas fa-angle-right nav-icon"></i>
<p>Add New</p>
</a>
</li>
<li class="nav-item">
<a href="./index.php?page=survey_list" class="nav-link nav-survey_list tree-item">
<i class="fas fa-angle-right nav-icon"></i>
<p>List</p>
</a>
</li>
</ul>
</li>
<li class="nav-item">
<a href="./index.php?page=survey_report" class="nav-link nav-survey_report">
<i class="nav-icon fas fa-poll"></i>
<p>
Survey Report
</p>
</a>
</li>
<?php else: ?>
<li class="nav-item">
<a href="./index.php?page=survey_widget" class="nav-link nav-survey_widget nav-answer_survey">
<i class="nav-icon fas fa-poll-h"></i>
<p>
Survey List
</p>
</a>
</li>
<?php endif; ?>
</ul>
</nav>
</div>
</aside>
<script>
$(document).ready(function(){
var page = '<?php echo isset($_GET['page']) ? $_GET['page'] : 'home' ?>';
if($('.nav-link.nav-'+page).length > 0){
$('.nav-link.nav-'+page).addClass('active')
console.log($('.nav-link.nav-'+page).hasClass('tree-item'))
if($('.nav-link.nav-'+page).hasClass('tree-item') == true){
$('.nav-link.nav-'+page).closest('.nav-treeview').siblings('a').addClass('active')
$('.nav-link.nav-'+page).closest('.nav-treeview').parent().addClass('menu-open')
}
if($('.nav-link.nav-'+page).hasClass('nav-is-tree') == true){
$('.nav-link.nav-'+page).parent().addClass('menu-open')
}
}
$('.manage_account').click(function(){
uni_modal('Manage Account','manage_user.php?id='+$(this).attr('data-id'))
})
})
</script>