/var/www/hkosl.com/b2b2c/webadmin/_menu.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<?php
    
function navi_menu($menu$title)
    {
        
$s '';
        foreach (
$menu as $section) {
            
$s .= navi_submenu($section);
        }

        if (
$s) {
            return 
"<li class='header'>{$title}</li>" $s PHP_EOL;
        }
    }

    function 
navi_submenu($section)
    {
        
$s '';
        foreach (
$section['items'] as $item) {
            
$s .= navi_subsubmenu($item);
        }

        if (
$s) {
            return 
"<li class='treeview active'>
            <a href='#'><i class='
{$section['class']}'></i> <span>{$section['title']}</span>
                <i class='fa fa-angle-left pull-right'></i></a><ul class='treeview-menu'>
{$s}</ul></li>";
        }
    }

    function 
navi_subsubmenu($item)
    {
        
$s '';
        if (empty(
$item[0]) || grantMenu($item[0])) {
            
$s .= "<li><a href='{$item[1]}'>{$item[2]}</a></li>";
        }
        return 
$s;
    }

    
//if($_SESSION["cmsrole"] == "super_admin" || $_SESSION["cmsrole"] == "admin"){
    
if(true){
        
$navi = array(
            
"tutorial" => array(
                array( 
                    
"title" => _lang("Tutorial"),
                    
"class" => "fa fa-fw fa-gift",
                    
"items" => array(
                        array(
'Tea'"teacher_index.php?status=2"_lang("Personal Information")),
                        array(
'TS1'"teacher_index.php?status=1"_lang("Not Complete Registration")),
                        array(
'TS1'"teacher_index.php?status=3"_lang("Not Complete Email Verification")),
                        array(
'Tpj'"teacher_postjob_index.php"_lang("Music Class")),
                        array(
'Sci'"student_search_index.php"_lang("Job Search / List")),
                        array(
'Tea'"chat_index.php?type=1"_lang("Chat Room")),
                        array(
'Co1'"calendar_index.php"_lang("Calendar")),
                        
/*array('Co1', "course_index.php", _lang("Tutorial History")),*/
                    
),
                ),
            ),

            
"student" => array(
                array(
                    
"title" => _lang("Student"),
                    
"class" => "fa fa-fw fa-gift",
                    
"items" => array(
                        array(
'Stu'"student_index.php?status=2"_lang("Personal Information")),
                        array(
'St1'"student_index.php?status=1"_lang("Not Complete Registration")),
                        array(
'St1'"student_index.php?status=3"_lang("Not Complete Email Verification")),
                        array(
'Spj'"student_postjob_index.php"_lang("Post Job")),
                        array(
'Stu'"tutor_search_index.php"_lang("Tutor Search")),
                        
//array('Stu', "course_search_index.php", _lang("Course Search")),
                        
array('Stu'"chat_index.php?type=2"_lang("Chat Room")),
                        array(
'Co2'"calendar_index.php"_lang("Calendar")),
                    ),
                ),
            ),

            
"order" => array(
                array(
                    
"title" => _lang("Lesson Management"),
                    
"class" => "fa fa-fw fa-cog",
                    
"items" => array(
                        array(
'Ord'"order_index.php"_lang("Lesson Record")),
                        array(
'Ord'"course_index.php"_lang("Lesson Detail")),
                        array(
'Co1'"tutorial_record_index.php"_lang("Tutorial Time Record")),
                    ),
                ),
            ),

            
"cms" => array(
                array(
                    
"title" => _lang("Approval List"),
                    
"class" => "fa fa-fw fa-list-ul",
                    
"items" => array(
                        array(
'App'"approval_index.php"_lang("Approval List")),
                    ),
                ),

                array(
                    
"title" => _lang("Music Channel"),
                    
"class" => "fa fa-fw fa-music",
                    
"items" => array(
                        array(
'App'"music_channel_index.php"_lang("Music Channel")),
                    ),
                ),

                array(
                    
"title" => _lang("Musical Instrument Link"),
                    
"class" => "fa fa-fw fa-link",
                    
"items" => array(
                        array(
'App'"musical_instrument_link_index.php"_lang("Musical Instrument Link")),
                    ),
                ),

                array(
                    
"title" => _lang("SMS"),
                    
"class" => "fa fa-fw fa-comments-o",
                    
"items" => array(
                        array(
'App'"sms_log_index.php"_lang("SMS")),
                    ),
                ),
                
                array(
                    
"title" => _lang("Message"),
                    
"class" => "fa fa-fw fa-comments-o",
                    
"items" => array(
                        array(
'App'"admin_msg_index.php"_lang("Message")),
                        array(
'App'"app_notification_index.php"_lang("App Notification")),
                    ),
                ),

                array(
                    
"title" => _lang("System Setting"),
                    
"class" => "fa fa-fw fa-cog",
                    
"items" => array(
                        array(
'Sit'"site_info_modifyform.php"_lang("Site info")),
                        array(
'Sub'"subscribe_index.php"_lang("Subscription")),
                        array(
'App'"public_holiday_index.php"_lang("Public Holiday")),
                        array(
'App'"export_tutor_list.php"_lang("Export Tutor List")),
                        array(
'Sys'"sys_cms_user_index.php"_lang("Admin Management")),
                    ),
                ),

            ),
        );
    }
?>

<!-- Left side column. contains the logo and sidebar -->
<aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">

        <!-- Sidebar user panel (optional) -->
        <div class="user-panel">
            <div class="pull-left image">
                <?php
                    
if($_SESSION["is_tutor"]){
                        
$tutor_info get_tutor($_SESSION["member_login"]);
                        if(!empty(
$tutor_info["profilephoto_path"]) && is_file("../file/teacher/".$tutor_info["profilephoto_path"])){
                            
$img_path "../file/teacher/".$tutor_info["profilephoto_path"];
                        }
                        
$headerUserName $tutor_info['nickname'];
                    }else if(
$_SESSION["is_student"]){
                        
$student_info get_student($_SESSION["student_login"]);
                        
$img_path "dist/img/user2-160x160.jpg";
                        
$headerUserName $student_info['contactname'];
                    }else{
                        
$img_path "dist/img/user2-160x160.jpg";
                        
$headerUserName $_SESSION["cmsusername"];
                    }
                
?>

                <!-- img-circle-->
                <img src="<?=$img_path?>" class="img-circle" alt="User Image" style="height:45px;max-height: 45px;">
            </div>
            <div class="pull-left info">
                <p><?= _lang("Login as") . ": <b>" $headerUserName "</b>" ?></p>

                <!-- <i class="fa fa-fw fa-circle text-success"></i>  -->
                <?php
                    
if ($_SESSION["role"] == "user" && $_SESSION["is_tutor"])
                        echo 
_lang("Role: Tutor");
                    else if (
$_SESSION["role"] == "user" && $_SESSION["is_student"])
                        echo 
_lang("Role: Student");
                    else if (
$_SESSION["role"] == "admin")
                        echo 
_lang("Role: Admin");
                    else if (
$_SESSION["role"] == "super_admin")
                        echo 
_lang("Role: Super Admin");
                
?>

            </div>
        </div>

        <!-- search form (Optional) -->
        <!-- <form action="#" method="get" class="sidebar-form">
            <div class="input-group">
                <input type="text" name="q" class="form-control" placeholder="Search..."> <span class="input-group-btn">
                    <button type="submit" name="search" id="search-btn" class="btn btn-flat">
                        <i class="fa fa-fw fa-search"></i></button>
                </span>
            </div>
        </form> -->
        <!-- /.search form -->

        <!-- Sidebar Menu -->
        <ul class="sidebar-menu">

            <?= navi_menu($navi['tutorial'], _lang("Tutorial")) ?>
            <?= navi_menu($navi['student'], _lang("Student")) ?>
            <?= navi_menu($navi['order'], _lang("Lesson Management")) ?>
            <?= navi_menu($navi['cms'], _lang("CMS")) ?>

        </ul><!-- /.sidebar-menu -->
    </section>
    <!-- /.sidebar -->
</aside>