HEX
Server: LiteSpeed
System: Linux server137.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: bibuzptr (1123)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/bibuzptr/elearning.bibu-edu.us/current/student/index.php
<?php
ob_start();
session_start();
include_once('../includes/db_connect.php'); 
$today = date('Y-m-d'); 
$now = date('Y-m-d H:i:s'); 
$year = date("Y");
if(isset($_SESSION["OpenUniS^###DHSG"])){
    $email = $_SESSION["OpenUniS^###DHSG"];
    $chkuser = mysqli_query($con,"SELECT * FROM students WHERE email='$email'");
    while($row = mysqli_fetch_assoc($chkuser)){
      $studentid = $row["id"];
      $name = $row["name"];
      $admno = $row["admno"];
      $icon = $row["icon"];
    }
}
else{
    header("Location:../login.php");
}
?>
<!doctype html>
<html class="no-js" lang="zxx">
<meta http-equiv="content-type" content="text/html;charset=utf-8" />

<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>Student Dashboard | Breakthrough Open University</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="shortcut icon" type="image/x-icon" href="../assets/img/logo.png">
    <!-- Place favicon.ico in the root directory -->

    <!-- CSS here -->
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/animate.min.css">
    <link rel="stylesheet" href="css/aos.min.css">
    <link rel="stylesheet" href="css/magnific-popup.css">
    <link rel="stylesheet" href="css/icofont.min.css">
    <link rel="stylesheet" href="css/slick.css">
    <link rel="stylesheet" href="css/swiper-bundle.min.css">
    <link rel="stylesheet" href="css/style.css">


    <script>
        // On page load or when changing themes, best to add inline in `head` to avoid FOUC
        if (localStorage.getItem("theme-color") === "dark" || (!("theme-color" in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches)) {
            document.documentElement.classList.add("is_dark");
        }
        if (localStorage.getItem("theme-color") === "light") {
            document.documentElement.classList.remove("is_dark");
        }
    </script>

</head>

<body class="body__wrapper">
    <!-- pre loader area start -->
    <div id="back__preloader">
        <div id="back__circle_loader"></div>
        <div class="back__loader_logo">
            <img loading="lazy" src="../assets/img/logo.png" alt="Preload">
        </div>
    </div>
    <!-- pre loader area end -->

    <main class="main_wrapper overflow-hidden">


        <?php include_once("includes/header.php") ?>


        <!-- theme fixed shadow -->
        <div>
            <div class="theme__shadow__circle"></div>
            <div class="theme__shadow__circle shadow__right"></div>
        </div>
        <!-- theme fixed shadow -->
        <!-- breadcrumbarea__section__start -->



        <!-- dashboardarea__area__start  -->
        <div class="dashboardarea sp_bottom_100">
            <div class="container-fluid full__width__padding">
                <div class="row">
                    <div class="col-xl-12">
                        <div class="dashboardarea__wraper">
                            <div class="dashboardarea__img">
                                <div class="dashboardarea__inner student__dashboard__inner">
                                    <div class="dashboardarea__left">
                                        <div class="dashboardarea__left__img">
                                            <img loading="lazy" src="../student-images/<?php echo $icon ?>" alt="">
                                        </div>
                                        <div class="dashboardarea__left__content">
                                            <h4><?php echo $name ?></h4>
                                            <p><?php echo $admno ?></p>
                                            <ul>
                                                <li> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-book-open">
                                                        <path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path>
                                                        <path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path>
                                                    </svg>
                                                    <?php echo mysqli_num_rows(mysqli_query($con,"SELECT * FROM mycourses WHERE studentid='$studentid' AND status='0'")) ?>
                                                    Courses Enrolled
                                                </li>
                                               
                                            </ul>

                                        </div>
                                    </div>
                                    <div class="dashboardarea__right">
                                        <div class="dashboardarea__right__button">
                                            <a class="default__button" href="ongoing-courses">View ongoing courses
                                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right">
                                                    <line x1="5" y1="12" x2="19" y2="12"></line>
                                                    <polyline points="12 5 19 12 12 19"></polyline>
                                                </svg></a>
                                        </div>
                                    </div>

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

            <div class="dashboard">
                <div class="container-fluid full__width__padding">
                    <div class="row">
                        <div class="col-xl-3 col-lg-3 col-md-12">
                            <?php include_once("includes/aside.php") ?>
                        </div>
                        <div class="col-xl-9 col-lg-9 col-md-12">
                            <div class="dashboard__content__wraper">
                                <div class="dashboard__section__title">
                                    <h4>Summary</h4>
                                </div>
                                <div class="row">
                                    <div class="col-xl-4 col-lg-4 col-md-12 col-12">
                                        <div class="dashboard__single__counter">
                                            <div class="counterarea__text__wraper">
                                                <div class="counter__img">
                                                    <img loading="lazy" src="img/counter/counter__1.png" alt="counter">
                                                </div>
                                                <div class="counter__content__wraper">
                                                    <div class="counter__number">
                                                        <span class="counter"><?php echo mysqli_num_rows(mysqli_query($con,"SELECT * FROM mycourses WHERE studentid='$studentid' AND status='0'")) ?></span>+

                                                    </div>
                                                    <p>Enrolled Courses</p>

                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-xl-4 col-lg-6 col-md-6 col-6">
                                        <div class="dashboard__single__counter">
                                            <div class="counterarea__text__wraper">
                                                <div class="counter__img">
                                                    <img loading="lazy" src="img/counter/counter__2.png" alt="counter">
                                                </div>
                                                <div class="counter__content__wraper">
                                                    <div class="counter__number">
                                                        <span class="counter"><?php echo mysqli_num_rows(mysqli_query($con,"SELECT * FROM mycourses WHERE studentid='$studentid' AND status='0'")) ?></span>

                                                    </div>
                                                    <p>Active Courses</p>

                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-xl-4 col-lg-6 col-md-6 col-6">
                                        <div class="dashboard__single__counter">
                                            <div class="counterarea__text__wraper">
                                                <div class="counter__img">
                                                    <img loading="lazy" src="img/counter/counter__3.png" alt="counter">
                                                </div>
                                                <div class="counter__content__wraper">
                                                    <div class="counter__number">
                                                        <span class="counter"><?php echo mysqli_num_rows(mysqli_query($con,"SELECT * FROM mycourses WHERE studentid='$studentid' AND status='1'")) ?></span>

                                                    </div>
                                                    <p>Complete Courses</p>

                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="dashboard__content__wraper">
                                <div class="dashboard__section__title">
                                    <h4>Ongoing Courses</h4>
                                    <a href="ongoing-courses">See More...</a>
                                </div>
                                <div class="row">
                                    <div class="col-xl-12">
                                        <div class="dashboard__table table-responsive">
                                            <table class="table table-striped">
                                                <thead>
                                                    <tr>  
                                                        <th>Course Name</th>
                                                        <th>Period</th>
                                                        <th>Start Date</th>
                                                        <th>% Progress</th>
                                                        <th></th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                <?php 
                                                $mycourses=mysqli_query($con,"SELECT * FROM mycourses WHERE studentid='$studentid' AND status='0' ORDER BY id DESC");
                                                while($mc=mysqli_fetch_assoc($mycourses)){
                                                    $courseid=$mc["courseid"];
                                                    $coursedet=mysqli_fetch_assoc(mysqli_query($con,"SELECT * FROM courses WHERE id='$courseid'"));
                                                ?>
                                            <tr>
                                            <td><a target="_blank" href="../course-details/<?php echo $coursedet["url"];?>"><?php echo $coursedet["title"];?></a></td>
                                            <td><?php echo $coursedet["hours"];?></td>
                                            <td><?php echo date("d/m/Y",strtotime($mc["enrolldate"]));?></td>
                                            <td>
                                               <?php
                                                   $lessonsdone=mysqli_fetch_assoc(mysqli_query($con,"SELECT COUNT(learningprogress.id) as theprogress FROM learningprogress,units WHERE learningprogress.studentid='$studentid' AND units.courseid='$courseid' AND learningprogress.unitid=units.id"))["theprogress"];
                                                    $listlessons=mysqli_query($con,"SELECT lessons.* FROM lessons,units WHERE lessons.unitid=units.id AND units.courseid='$courseid'");
                                                    $nooflessons=mysqli_num_rows($listlessons);
                                                    $percentdone=number_format($lessonsdone/$nooflessons*100,2);
                                                ?>
                                                <div class="progress">
                                                    <div class="progress-bar" role="progressbar" aria-valuenow="<?php echo $percentdone ?>" aria-valuemin="0" aria-valuemax="100" style="width:<?php echo $percentdone ?>%">
                                                        <?php echo $percentdone ?>% Complete
                                                    </div>
                                                </div>
                                            </td>
                                            <th>
                                                 <a href="ongoing-course/<?php echo $coursedet["url"] ?>" class="btn btn-sm btn-primary w-10">Continue Learning</a> | 
                                                 <a href="grades/<?php echo $coursedet["url"] ?>" class="btn btn-sm btn-success w-10">Grades</a>
                                            </th>
                                            </tr>
                                            <?php } ?>
                                            </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>


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

        </div>
        <!-- dashboardarea__area__end   -->


        <!-- footer__section__start -->
        <?php include_once("includes/footer.php") ?>
        <!-- footer__section__end -->



    </main>


    <!-- JS here -->
    <script src="js/vendor/modernizr-3.5.0.min.js"></script>
    <script src="js/vendor/jquery-3.6.0.min.js"></script>
    <script src="js/popper.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/isotope.pkgd.min.js"></script>
    <script src="js/slick.min.js"></script>
    <script src="js/jquery.meanmenu.min.js"></script>
    <script src="js/ajax-form.js"></script>
    <script src="js/wow.min.js"></script>
    <script src="js/jquery.scrollUp.min.js"></script>
    <script src="js/imagesloaded.pkgd.min.js"></script>
    <script src="js/jquery.magnific-popup.min.js"></script>
    <script src="js/waypoints.min.js"></script>
    <script src="js/jquery.counterup.min.js"></script>
    <script src="js/plugins.js"></script>
    <script src="js/swiper-bundle.min.js"></script>
    <script src="js/main.js"></script>

    <script>
        // On page load or when changing themes, best to add inline in `head` to avoid FOUC
        if (localStorage.getItem("theme-color") === "dark" || (!("theme-color" in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches)) {
            document.getElementById("light--to-dark-button")?.classList.add("dark--mode");
        }
        if (localStorage.getItem("theme-color") === "light") {
            document.getElementById("light--to-dark-button")?.classList.remove("dark--mode");
        }
    </script>


</body>

</html>