<?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">
            <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">
                    <a href="<?php echo $conn->student_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->student_url().'check-result'; ?>" <?php
                    if(basename($_SERVER['SCRIPT_NAME']) == 'check-result.php'
                      || basename($_SERVER['SCRIPT_NAME']) == 'view-result.php'){
                        echo 'class = "nav-link active"';
                    }else{
                        echo 'class = "nav-link"';
                    }
                    ?>>
                        <i class="nav-icon fa fa-bookmark"></i>
                        <p>
                            Check Result
                        </p>
                    </a>
                </li>

                <!--  CBT start -->

                <li <?php
                if(basename($_SERVER['SCRIPT_NAME']) == 'online-exams.php'
                    || basename($_SERVER['SCRIPT_NAME']) == 'online_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->student_url().'online-exams'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'online-exams.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>Online Exams</p>
                            </a>
                        </li>

                        <li class="nav-item">
                            <a href="<?php echo $conn->student_url().'online_exam_results'; ?>"  <?php
                            if(basename($_SERVER['SCRIPT_NAME']) == 'online_exam_results.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>Online Exam Results</p>
                            </a>
                        </li>

                    </ul>
                </li>

                <!-- CBT end -->

                  <li class="nav-item">
                    <a href="javascript:void" <?php
                    if(basename($_SERVER['SCRIPT_NAME']) == 'contact.php'){
                        echo 'class = "nav-link active"';
                    }else{
                        echo 'class = "nav-link"';
                    }
                    ?> data-toggle="modal" data-target="#contact-admin">
                        <i class="nav-icon fas fa-phone"></i>
                        <p>
                            Contact Admin
                        </p>
                    </a>
                </li>

             

                <!--  settings -->
                <li <?php
                if(basename($_SERVER['SCRIPT_NAME']) == '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-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->student_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>Change password</p>
                            </a>
                        </li>

                    </ul>
                </li>


                <li class="nav-item">
                    <a href="<?php echo $conn->student_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>

<div id="contact-admin" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title text-warning">We are always ready to help</h5>
                <button type="button" class="close" data-dismiss="modal">&times;</button>
            </div>
            <div class="modal-body">
                <p> Have a query, feedback or just want to say hi?</p>
                <p> Call/Whatsapp School Admin on the phone number below</p>

                <a href="javascript:void" style="color: #0c515c; "> <i class="fab fa-whatsapp"></i> +2347015776873 </a> &nbsp; &nbsp;
                <a href="javascript:void" style="color: #0c515c"> <i class="fa fa-phone"></i>  +234809988543</a>

            </div>
        </div>
    </div>
</div>
