<?php  
include_once "../includes/init.php";
function ActiveClass($requestUri)
{
    $current_file_name = basename($_SERVER['REQUEST_URI'], ".php");

    if ($current_file_name == $requestUri)
        echo 'class="active"';
}
        
        //check already index
        if (!isset($_SESSION['user_email'])) {
            header ('Location:../login.php');
            exit;
        }

        // Logout
        if (isset($_GET['action'])) {
            $action = $_GET['action'];
            if ($action == 'logout') {
                session_destroy();
                header('Location:login.php');
            }
        }

     if (isset($_GET['page']) && $_GET['page'] == 'dashboad') {
            $page = 'dashboad';
        } else if (isset($_GET['page']) && $_GET['page'] == 'user') {
            $page = "user"; 
        }else if (isset($_GET['page']) && $_GET['page'] == 'user_dashboad') {
            $page = "user_dashboad";
        } 
        else if (isset($_GET['page']) && $_GET['page'] == 'facilitator') {
            $page = "facilitator";
        } 
        else if (isset($_GET['page']) && $_GET['page'] == 'Sponsor') {
            $page = "Sponsor";
        } 
        else if (isset($_GET['page']) && $_GET['page'] == 'trainer') {
            $page = "trainer";
        } 
        else if (isset($_GET['page']) && $_GET['page'] == 'class') {
            $page = "class";
        } 
        else if (isset($_GET['page']) && $_GET['page'] == 'course') {
            $page = "course";
        } 
        else if (isset($_GET['page']) && $_GET['page'] == 'assign_course') {
            $page = "assign_course";
        } 
        else if (isset($_GET['page']) && $_GET['page'] == 'booking_tr') {
            $page = "booking_tr";
        } 
        else if (isset($_GET['page']) && $_GET['page'] == 'quiz') {
            $page = "quiz";
        }
        else if (isset($_GET['page']) && $_GET['page'] == 'enroll') {
            $page = "enroll";
        }
        else if (isset($_GET['page']) && $_GET['page'] == 'assign_training') {
            $page = "assign_training";
        }  
        else if (isset($_GET['page']) && $_GET['page'] == 'certificate') {
            $page = "certificate";
        } 
        else if (isset($_GET['page']) && $_GET['page'] == 'invoice') {
            $page = "invoice";
        } 
        else if (isset($_GET['page']) && $_GET['page'] == 'exam') {
            $page = "exam";
        } 
        else if (isset($_GET['page']) && $_GET['page'] == 'exam_course') {
            $page = "exam_course";
        } 
        else if (isset($_GET['page']) && $_GET['page'] == 'student_result') {
            $page = "student_result";
        } 
        else if (isset($_GET['page']) && $_GET['page'] == 'question') {
            $page = "question";
        }
        else if (isset($_GET['page']) && $_GET['page'] == 'update_training') {
            $page = "update_training";
        }
         else if (isset($_GET['page']) && $_GET['page'] == 'update_user') {
            $page = "update_user";
        }
        else if (isset($_GET['page']) && $_GET['page'] == 'update_couse') {
            $page = "update_couse";
        }
        else if (isset($_GET['page']) && $_GET['page'] == 'update_quiz') {
            $page = "update_quiz";
        }
        else if (isset($_GET['page']) && $_GET['page'] == 'view_exam_result') {
            $page = "view_exam_result";
        }
        else if (isset($_GET['page']) && $_GET['page'] == 'update_module') {
            $page = "update_module";
        }
        else {
            $page = 'dashboad';
        }
 
include('includes/head.php');   
$msgBox ="";

if (file_exists('orbital_001/'.$page.'.php')) {
            // Load the Page
            include('orbital_001/'.$page.'.php');
        } else {
            // Else Display an Error
          
            echo '
                    <div class="wrapper">
                        <h3>Err</h3>
                        <div class="alertMsg default">
                            <i class="icon-warning-sign"></i> The page "'.$page.'" could not be found.
                        </div>
                    </div>
                ';
        }
    ?>
      </div>
    <?php include('includes/footer.php');?>

  <!-- Control Sidebar -->
  <aside class="control-sidebar control-sidebar-dark">
    <!-- Control sidebar content goes here -->
  </aside>
  <!-- /.control-sidebar -->
</div>
 