<?php
  $change_style = "  font-size: 13px;
                            color: #17a2b8;
                            padding: 4px;";
?>

<aside class="main-sidebar sidebar-dark-primary elevation-4">
    <!-- Brand Logo -->
    <a href="<?php echo $conn->base_url().'index'; ?>" class="brand-link">
        <img src="<?php echo $conn->base_url(); ?>upload/<?php echo $logo; ?> " alt="<?php echo $logo; ?> Logo" class="img-circles elevation-4" style="opacity: .8">
        <span class="brand-text font-weight-light" style="visibility: hidden;"><?php echo "APP"; ?> </span>
    </a>

    <!-- Sidebar -->
    <div class="sidebar">
        <!-- Sidebar user panel (optional) -->
        <!-- Sidebar Menu -->
        <nav class="mt-2" style="margin-bottom: 40px;">
            <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
                <!-- Add icons to the links using the .nav-icon class
                     with font-awesome or any other icon font library -->
                <li class="nav-item" style="margin-top: 20px;">
                    <a href="<?php echo $conn->base_url().'index'; ?>" <?php
                    if(basename($_SERVER['SCRIPT_NAME']) == 'index.php'){
                        echo 'class = "nav-link active"';
                    }else{
                        echo 'class = "nav-link"';
                    }
                    ?>>
                        <i class="nav-icon fas fa-tachometer-alt"></i>
                        <p>
                            Dashboard
                        </p>
                    </a>
                </li>

                  <li class="nav-item">
                    <a href="<?php echo $conn->base_url().'student'; ?>" <?php
                    if(basename($_SERVER['SCRIPT_NAME']) == 'student.php'
                        || basename($_SERVER['SCRIPT_NAME']) == 'add-student.php'
                        || basename($_SERVER['SCRIPT_NAME']) == 'view-student.php'
                        || basename($_SERVER['SCRIPT_NAME']) == 'edit-student.php'){
                        echo 'class = "nav-link active"';
                    }else{
                        echo 'class = "nav-link"';
                    }
                    ?>>
                        <i class="nav-icon fas fa-graduation-cap"></i>
                        <p>
                            Student
                        </p>
                    </a>
                </li>

                  <li class="nav-item">
                    <a href="<?php echo $conn->base_url().'teacher'; ?>" <?php
                    if(basename($_SERVER['SCRIPT_NAME']) == 'teacher.php' ||
                        basename($_SERVER['SCRIPT_NAME']) == 'add-teacher.php'
                       || basename($_SERVER['SCRIPT_NAME']) == 'view-teacher.php'
                       || basename($_SERVER['SCRIPT_NAME']) == 'edit-teacher.php'){
                        echo 'class = "nav-link active"';
                    }else{
                        echo 'class = "nav-link"';
                    }
                    ?>>
                        <i class="nav-icon fas fa-user-circle"></i>
                        <p>
                            Teacher
                        </p>
                    </a>
                </li>

                <li <?php
                    if(basename($_SERVER['SCRIPT_NAME']) == 'class.php'
                         || basename($_SERVER['SCRIPT_NAME']) == 'section.php'
                         || basename($_SERVER['SCRIPT_NAME']) == 'subject.php'
                         || basename($_SERVER['SCRIPT_NAME']) == 'add-class.php'
                         || basename($_SERVER['SCRIPT_NAME']) == 'edit-class.php'
                         || basename($_SERVER['SCRIPT_NAME']) == 'add-section.php'
                         || basename($_SERVER['SCRIPT_NAME']) == 'edit-section.php'
                         || basename($_SERVER['SCRIPT_NAME']) == 'add-subject.php'
                         || basename($_SERVER['SCRIPT_NAME']) == 'promotion.php'
                         || basename($_SERVER['SCRIPT_NAME']) == 'edit-subject.php') {
                            echo 'class = "nav-item menu-open"';
                    }else{
                        echo 'class = "nav-item"';
                    }
                ?>>
                    <a href="#page3" class="nav-link">
                        <i class="nav-icon fas fa-university"></i>
                        <p>
                           Academic
                            <i class="fas fa-angle-left right"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'class'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'class.php'
                               || basename($_SERVER['SCRIPT_NAME']) == 'add-class.php'
                               || basename($_SERVER['SCRIPT_NAME']) == 'edit-class.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-sitemap nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Class</p>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'section'; ?>"<?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'section.php'
                               || basename($_SERVER['SCRIPT_NAME']) == 'add-section.php'
                               || basename($_SERVER['SCRIPT_NAME']) == 'edit-section.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-star nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Section</p>
                            </a>
                        </li>
                         <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'subject'; ?>"<?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'subject.php'
                              || basename($_SERVER['SCRIPT_NAME']) == 'add-subject.php'
                              || basename($_SERVER['SCRIPT_NAME']) == 'edit-subject.php'
                              ){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-book nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Subject</p>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'promotion'; ?>"<?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'promotion.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-graduation-cap nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Promotion</p>
                            </a>
                        </li>
                    </ul>
                </li>

                <li <?php
                if(basename($_SERVER['SCRIPT_NAME']) == 'schoolyear.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'academicyear.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'resetpassword.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'add-year.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'systemadmin.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'admin-privileges.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'edit-year.php') {
                    echo 'class = "nav-item menu-open"';
                }else{
                    echo 'class = "nav-item"';
                }
                ?>>
                    <a href="#page2" class="nav-link">
                        <i class="nav-icon fa fa-user"></i>
                        <p>
                            Administrator
                            <i class="fas fa-angle-left right"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">


                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'resetpassword'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'resetpassword.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-lock nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Reset Password </p>
                            </a>
                        </li>

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'systemadmin'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'systemadmin.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-user nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>System Admin </p>
                            </a>
                        </li>

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'admin-privileges'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'admin-privileges.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-user-lock nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Admin Privileges</p>
                            </a>
                        </li>

                    </ul>
                </li>

<!--                Exam start -->

                <li <?php
                if(basename($_SERVER['SCRIPT_NAME']) == 'term.php'
                   || basename($_SERVER['SCRIPT_NAME']) == 'add-grade.php'
                   || basename($_SERVER['SCRIPT_NAME']) == 'edit-grade.php'
                   || basename($_SERVER['SCRIPT_NAME']) == 'grade.php'
                   || basename($_SERVER['SCRIPT_NAME']) == 'mark-setting.php'
                   || basename($_SERVER['SCRIPT_NAME']) == 'add-mark-setting.php'
                   || basename($_SERVER['SCRIPT_NAME']) == 'edit-mark-setting.php') {
                    echo 'class = "nav-item menu-open"';
                }else{
                    echo 'class = "nav-item"';
                }
                ?>>
                    <a href="#page" class="nav-link">
                        <i class="nav-icon fa fa-user-edit"></i>
                        <p>
                           Exam
                            <i class="fas fa-angle-left right"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'term'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'term.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-university nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Term</p>
                            </a>
                        </li>

                          <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'grade'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'grade.php'
                              || basename($_SERVER['SCRIPT_NAME']) == 'add-grade.php'
                              || basename($_SERVER['SCRIPT_NAME']) == 'edit-grade.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-signal nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Grade</p>
                            </a>
                        </li>

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'mark-setting'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'mark-setting.php'
                              || basename($_SERVER['SCRIPT_NAME']) == 'add-mark-setting.php'
                              || basename($_SERVER['SCRIPT_NAME']) == 'edit-mark-setting.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-marker nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Mark Setting</p>
                            </a>
                        </li>

                    </ul>
                </li>

<!--                Exam end -->


<!--                Mark start -->

                <li <?php
                if(basename($_SERVER['SCRIPT_NAME']) == 'mark.php'
                   || basename($_SERVER['SCRIPT_NAME']) == 'mark.php'
                   || basename($_SERVER['SCRIPT_NAME']) == 'view-mark.php'
                   || basename($_SERVER['SCRIPT_NAME']) == 'markpercentage.php'
                   || basename($_SERVER['SCRIPT_NAME']) == 'add-markpercentage.php'
                   || basename($_SERVER['SCRIPT_NAME']) == 'edit-markpercentage.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'add-mark.php') {
                    echo 'class = "nav-item menu-open"';
                }else{
                    echo 'class = "nav-item"';
                }
                ?>>
                    <a href="#page" class="nav-link">
                        <i class="nav-icon fa fa-bookmark"></i>
                        <p>
                           Mark <span class="badge badge-success">New</span>
                            <i class="fas fa-angle-left right"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'mark'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'mark.php'
                              || basename($_SERVER['SCRIPT_NAME']) == 'mark.php'
                                || basename($_SERVER['SCRIPT_NAME']) == 'add-mark.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-flask nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Mark</p>
                            </a>
                        </li>

                         <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'view-mark'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'view-mark.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-check nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>View or Update Marks </p>
                            </a>
                        </li>
                    </ul>
                </li>

<!--                Mark end -->

                <!-- Generate Broadsheet  -->

                <li class="nav-item">
                    <a href="<?php echo $conn->base_url().'view-broadsheet'; ?>" <?php
                    if(basename($_SERVER['SCRIPT_NAME']) == 'view-broadsheet.php'){
                        echo 'class = "nav-link active"';
                    }else{
                        echo 'class = "nav-link"';
                    }
                    ?>>
                        <i class="nav-icon fas fa-chart-bar"></i>
                        <p>Generate Broadsheet <span class="badge badge-success">New</span></p>
                    </a>
                </li>

                <!--  End Generate Broadsheet -->



                <!--  CBT start -->

                <li <?php
                if(basename($_SERVER['SCRIPT_NAME']) == 'exam_form.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'exam_list.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'add_question.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'manage_questions.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'edit_question.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'view_exam_results.php'

                ) {

                    echo 'class = "nav-item menu-open"';
                }else{
                    echo 'class = "nav-item"';
                }
                ?>>
                    <a href="#page" class="nav-link">
                        <i class="nav-icon fa fa-laptop"></i>
                        <p>
                            CBT
                            <i class="fas fa-angle-left right"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'exam_form'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'exam_form.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-qrcode nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Create Exam</p>
                            </a>
                        </li>

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'exam_list'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'exam_list.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-globe nav-icon" style="<?php echo $change_style;?>"></i>
                                <p> Manage Online Exam </p>
                            </a>
                        </li>

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'add_question'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'add_question.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-plus-circle nav-icon" style="<?php echo $change_style;?>"></i>
                                <p> Add Question </p>
                            </a>
                        </li>

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'manage_questions'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'manage_questions.php'
                                || basename($_SERVER['SCRIPT_NAME']) == 'edit_question.php'

                            ){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-question-circle nav-icon" style="<?php echo $change_style;?>"></i>
                                <p> Manage Questions </p>
                            </a>
                        </li>

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'view_exam_results'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'view_exam_results.php'
                            ){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-eye nav-icon" style="<?php echo $change_style;?> background:none !important;"></i>
                                <p> View Exam Results </p>
                            </a>
                        </li>

                    </ul>
                </li>

                <!-- CBT end -->

                <!-- start homepage settings -->
                <li <?php
                if(basename($_SERVER['SCRIPT_NAME']) == 'settings.php'
                   || basename($_SERVER['SCRIPT_NAME']) == 'show-position.php'
                   || basename($_SERVER['SCRIPT_NAME']) == 'migration.php'
                ){
                    echo 'class = "nav-item menu-open"';
                }else{
                    echo 'class = "nav-item"';
                }
                ?>>
                    <a href="#page" class="nav-link">
                        <i class="nav-icon fa fa-cog"></i>
                        <p>
                            Settings
                            <i class="fas fa-angle-left right"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'settings'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'settings.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-hammer nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>General Setting</p>
                            </a>
                        </li>

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'show-position'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'show-position.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-chalkboard-teacher nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Positions Setting</p>
                            </a>
                        </li>

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'migration'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'migration.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-recycle nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Old Results Migration</p>
                            </a>
                        </li>

                    </ul>
                </li>

<!--                Start pin management Section-->
                <?php
                    ?>
                    <li <?php
                    if(basename($_SERVER['SCRIPT_NAME']) == 'view-pin-requests.php'
                        || basename($_SERVER['SCRIPT_NAME']) == 'generate-pins.php'
                        || basename($_SERVER['SCRIPT_NAME']) == 'set-card-usage-limit.php'
                        || basename($_SERVER['SCRIPT_NAME']) == 'set-card-expire-date.php') {
                        echo 'class = "nav-item menu-open"';
                    }else{
                        echo 'class = "nav-item"';
                    }
                    ?>>
                        <a href="#page" class="nav-link">
                            <i class="nav-icon fa fa-map-marker"></i>
                            <p>
                                Pin Management
                                <i class="fas fa-angle-left right"></i>
                            </p>
                        </a>
                        <ul class="nav nav-treeview">
                            <li class="nav-item">
                                <a href="<?php echo $conn->base_url().'generate-pins'; ?>"  <?php
                                if(basename($_SERVER['SCRIPT_NAME']) == 'generate-pins.php'){
                                    echo 'class = "nav-link active"';
                                }else{
                                    echo 'class = "nav-link"';
                                }
                                ?>>
                                    <i class="fas fa-map-pin nav-icon" style="<?php echo $change_style;?>"></i>
                                    <p>Generate Pins</p>
                                </a>
                            </li>

                            <li class="nav-item">
                                <a href="<?php echo $conn->base_url().'view-pin-requests'; ?>"  <?php
                                if(basename($_SERVER['SCRIPT_NAME']) == 'view-pin-requests.php'){
                                    echo 'class = "nav-link active"';
                                }else{
                                    echo 'class = "nav-link"';
                                }
                                ?>>
                                    <i class="fas fa-search nav-icon" style="<?php echo $change_style;?>"></i>
                                    <p>View Pins Requests</p>
                                </a>
                            </li>

                            <li class="nav-item">
                                <a href="<?php echo $conn->base_url().'set-card-usage-limit'; ?>"  <?php
                                if(basename($_SERVER['SCRIPT_NAME']) == 'set-card-usage-limit.php'){
                                    echo 'class = "nav-link active"';
                                }else{
                                    echo 'class = "nav-link"';
                                }
                                ?>>
                                    <i class="fas fa-id-card nav-icon" style="<?php echo $change_style;?>"></i>
                                    <p>Set Card Usage Limit</p>
                                </a>
                            </li>

                            <li class="nav-item">
                                <a href="<?php echo $conn->base_url().'set-card-expire-date'; ?>"  <?php
                                if(basename($_SERVER['SCRIPT_NAME']) == 'set-card-expire-date.php'){
                                    echo 'class = "nav-link active"';
                                }else{
                                    echo 'class = "nav-link"';
                                }
                                ?>>
                                    <i class="fas fa-calendar-alt nav-icon" style="<?php echo $change_style;?>"></i>
                                    <p>Set Card Expire Date</p>
                                </a>
                            </li>
                        </ul>
                    </li>
                    <?php


                ?>

<!--                End pin management section-->

<!--                Reports-->
                <li <?php
                if(basename($_SERVER['SCRIPT_NAME']) == 'terminal-report.php') {
                    echo 'class = "nav-item menu-open"';
                }else{
                    echo 'class = "nav-item"';
                }
                ?>>
                    <a href="#page" class="nav-link">
                        <i class="nav-icon fa fa-bullhorn"></i>
                        <p>
                         Reports
                            <i class="fas fa-angle-left right"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'terminal-report'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'terminal-report.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-spell-check nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Terminal Report</p>
                            </a>
                        </li>
                    </ul>
                </li>

                <!--                Reports-->

                <!--                Psychomotor -->
                <li <?php
                if(basename($_SERVER['SCRIPT_NAME']) == 'manage-psychomotor.php'
                   || basename($_SERVER['SCRIPT_NAME']) == 'student-psychomotor.php'
                   || basename($_SERVER['SCRIPT_NAME']) == 'add-psychomotor.php') {
                    echo 'class = "nav-item menu-open"';
                }else{
                    echo 'class = "nav-item"';
                }
                ?>>
                    <a href="#page" class="nav-link">
                        <i class="nav-icon fa fa-car"></i>
                        <p>
                        Psychomotor
                            <i class="fas fa-angle-left right"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                          <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'manage-psychomotor'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'manage-psychomotor.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-motorcycle nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Manage Psychomotor</p>
                            </a>
                        </li>

                          <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'add-psychomotor'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'add-psychomotor.php'
                               || basename($_SERVER['SCRIPT_NAME']) == 'add-psychomotor.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-user nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Students' Psychomotor</p>
                            </a>
                        </li>
                    </ul>
                </li>

<!--                End Psychomotor-->

                <!--                Cognitive Area -->
                <li <?php
                if(basename($_SERVER['SCRIPT_NAME']) == 'manage-cognitive.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'add-cognitive.php') {
                    echo 'class = "nav-item menu-open"';
                }else{
                    echo 'class = "nav-item"';
                }
                ?>>
                    <a href="#page" class="nav-link">
                        <i class="nav-icon fa fa-brain"></i>
                        <p>
                           Cognitive Area
                            <i class="fas fa-angle-left right"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'manage-cognitive'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'manage-cognitive.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-code-branch nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Manage Cognitive Area</p>
                            </a>
                        </li>

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'add-cognitive'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'add-cognitive.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa fa-brain nav-icon" style="<?php echo $change_style;?>"></i>
                                <p> Students' Cognitive Area </p>
                            </a>
                        </li>
                    </ul>
                </li>

                <!--                End Cognitive-->



                <!-- Elearning Area -->
                <li <?php
                if(basename($_SERVER['SCRIPT_NAME']) == 'learning-materials.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'add-learning-material.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'view-material.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'edit-material.php') {
                    echo 'class = "nav-item menu-open"';
                }else{
                    echo 'class = "nav-item"';
                }
                ?>>
                    <a href="#page" class="nav-link">
                        <i class="nav-icon fa fa-book-reader"></i>
                        <p>
                            Elearning <span class="badge badge-success">New</span>
                            <i class="fas fa-angle-left right"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'learning-materials'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'learning-materials.php'
                               ||basename($_SERVER['SCRIPT_NAME']) == 'view-material.php'
                               ||basename($_SERVER['SCRIPT_NAME']) == 'edit-material.php'
                            ){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-list nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>All Materials</p>
                            </a>
                        </li>

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'add-learning-material'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'add-learning-material.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-plus-circle nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Add Learning Material</p>
                            </a>
                        </li>
                    </ul>
                </li>

                <!--                End Elearning -->


                <!-- Assignments Section Start -->
                <li <?php
                if(basename($_SERVER['SCRIPT_NAME']) == 'assignments.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'add-assignment.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'view-assignment.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'edit-assignment.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'submissions.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'grade-submission.php') {
                    echo 'class = "nav-item menu-open"';
                }else{
                    echo 'class = "nav-item"';
                }
                ?>>
                    <a href="#page" class="nav-link">
                        <i class="nav-icon fa fa-tasks"></i>
                        <p>
                            Assignments <span class="badge badge-success">New</span>
                            <i class="fas fa-angle-left right"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'assignments'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'assignments.php'
                               || basename($_SERVER['SCRIPT_NAME']) == 'view-assignment.php'
                               || basename($_SERVER['SCRIPT_NAME']) == 'edit-assignment.php'
                               || basename($_SERVER['SCRIPT_NAME']) == 'grade-submission.php'
                               || basename($_SERVER['SCRIPT_NAME']) == 'submissions.php'
                            ){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-list nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>All Assignments</p>
                            </a>
                        </li>

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'add-assignment'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'add-assignment.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-plus-circle nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Create Assignment</p>
                            </a>
                        </li>
                    </ul>
                </li>

                <!-- Assignments Section End -->



                <!-- Daily Attendance Section Start -->
                <li <?php
                if(basename($_SERVER['SCRIPT_NAME']) == 'mark-attendance.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'student-attendance-history.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'view-attendance-history.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'attendance-dashboard.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'attendance-report.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'leave-requests.php') {
                    echo 'class = "nav-item menu-open"';
                }else{
                    echo 'class = "nav-item"';
                }
                ?>>
                    <a href="#page" class="nav-link">
                        <i class="nav-icon fa fa-calendar"></i>
                        <p>
                            Daily Attendance <span class="badge badge-success">New</span>
                            <i class="fas fa-angle-left right"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'attendance-dashboard'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'attendance-dashboard.php'
                            ){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-tachometer-alt nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Attendance Dashboard</p>
                            </a>
                        </li>

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'mark-attendance'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'mark-attendance.php'
                            ){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-calendar nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Mark Attendance</p>
                            </a>
                        </li>

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'attendance-report'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'attendance-report.php'
                            ){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-chart-bar nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Attendance Reports</p>
                            </a>
                        </li>

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'student-attendance-history'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'student-attendance-history.php'
                                || basename($_SERVER['SCRIPT_NAME']) == 'view-attendance-history.php'
                            ){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-calendar-week nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Stu. Attendance History</p>
                            </a>
                        </li>

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'leave-requests'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'leave-requests.php'
                            ){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-sign-out-alt nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Leave Requests</p>
                            </a>
                        </li>
                    </ul>
                </li>

                <!-- Daily Attendance Section End -->


                <!-- Timetable Section -->
                <li <?php
                if(basename($_SERVER['SCRIPT_NAME']) == 'manage-timetable.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'view-teacher-timetable.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'print-timetable.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'manage-periods.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'bulk-add-timetable.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'manage-templates.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'view-template.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'edit-template.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'view-timetable-conflicts.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'timetable-settings.php') {
                    echo 'class = "nav-item menu-open"';
                }else{
                    echo 'class = "nav-item"';
                }
                ?>>
                    <a href="#page" class="nav-link">
                        <i class="nav-icon fa fa-calendar-week"></i>
                        <p>
                            Timetable <span class="badge badge-success">New</span> <span class="badge badge-warning">Hot</span>
                            <i class="fas fa-angle-left right"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'manage-timetable'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'manage-timetable.php'
                                || basename($_SERVER['SCRIPT_NAME']) == 'print-timetable.php'
                            ){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-calendar-alt nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Manage Timetable</p>
                            </a>
                        </li>

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'view-teacher-timetable'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'view-teacher-timetable.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-chalkboard-teacher nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Teacher Timetable</p>
                            </a>
                        </li>

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'manage-periods'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'manage-periods.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-clock nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Manage Periods</p>
                            </a>
                        </li>

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'bulk-add-timetable'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'bulk-add-timetable.php'){
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-calendar-plus nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Bulk Add Timetable</p>
                            </a>
                        </li>

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'manage-templates'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'manage-templates.php'
                                ||  basename($_SERVER['SCRIPT_NAME']) == 'view-template.php'
                                ||  basename($_SERVER['SCRIPT_NAME']) == 'edit-template.php')
                            {
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-copy nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>Manage Templates</p>
                            </a>
                        </li>

                        <li class="nav-item">
                            <a href="<?php echo $conn->base_url().'view-timetable-conflicts'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'view-timetable-conflicts.php') {
                                echo 'class = "nav-link active"';
                            }else{
                                echo 'class = "nav-link"';
                            }
                            ?>>
                                <i class="fas fa-calendar-times nav-icon" style="<?php echo $change_style;?>"></i>
                                <p>View Timetable Conflicts</p>
                            </a>
                        </li>


                    </ul>
                </li>

                <!-- End Timetable section -->



                <!--  Comments  -->

                <li class="nav-item">
                    <a href="<?php echo $conn->base_url().'report-comments'; ?>" <?php
                    if(basename($_SERVER['SCRIPT_NAME']) == 'report-comments.php'
                      || basename($_SERVER['SCRIPT_NAME']) == 'add-comment.php'){
                        echo 'class = "nav-link active"';
                    }else{
                        echo 'class = "nav-link"';
                    }
                    ?>>
                        <i class="nav-icon fas fa-comment"></i>
                        <p>Report Card Comments</p>
                    </a>
                </li>

<!--                End Comments -->

                <li class="nav-item">
                    <a href="<?php echo $conn->base_url().'attendance'; ?>" <?php
                    if(basename($_SERVER['SCRIPT_NAME']) == 'attendance.php'
                        || basename($_SERVER['SCRIPT_NAME']) == 'add-attendance.php'){
                        echo 'class = "nav-link active"';
                    }else{
                        echo 'class = "nav-link"';
                    }
                    ?>>
                        <i class="nav-icon fas fa-calendar"></i>
                        <p>Exam Attendance</p>
                    </a>
                </li>

                <li class="nav-item">
                    <a href="<?php echo $conn->base_url().'logout'; ?>" <?php
                    if(basename($_SERVER['SCRIPT_NAME']) == 'logout.php'){
                        echo 'class = "nav-link active"';
                    }else{
                        echo 'class = "nav-link"';
                    }
                    ?>>
                        <i class="nav-icon fas fa-lock"></i>
                        <p>Logout</p>
                    </a>
                </li>


            </ul>
        </nav>
        <!-- /.sidebar-menu -->
    </div>
    <!-- /.sidebar -->
</aside>
