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/backup/courses.php
<?php
session_start();
error_reporting(E_ALL); error_reporting(-1); ini_set('error_reporting', E_ALL);
include_once('includes/db_connect.php'); 
 //check student logged in
 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)){
      $id = $row["id"];
      $name = $row["name"];
    }
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
<title>Courses | Breakthrough International Bible College & University</title>

<link rel="shortcut icon" type="image/x-icon" href="assets/img/logo.png">

<link rel="stylesheet" href="assets/css/bootstrap.min.css">

<link rel="stylesheet" href="assets/plugins/fontawesome/css/fontawesome.min.css">
<link rel="stylesheet" href="assets/plugins/fontawesome/css/all.min.css">

<link rel="stylesheet" href="assets/css/owl.carousel.min.css">
<link rel="stylesheet" href="assets/css/owl.theme.default.min.css">

<link rel="stylesheet" href="assets/plugins/slick/slick.css">
<link rel="stylesheet" href="assets/plugins/slick/slick-theme.css">

<link rel="stylesheet" href="assets/plugins/select2/css/select2.min.css">

<link rel="stylesheet" href="assets/plugins/aos/aos.css">

<link rel="stylesheet" href="assets/css/style.css">
</head>
<body>

<div class="main-wrapper">

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


<section style="margin-top:2%" class="section new-course">
<div class="container">
<div class="section-header aos" data-aos="fade-up">
<div class="section-sub-head">
<h2>Top Courses</h2>
</div>
<div class="all-btn all-category d-flex align-items-center">
</div>
</div>
<div class="section-text aos" data-aos="fade-up">
<p class="mb-0">Explore undergraduate and postgraduate degree programs in fields such as theology, arts, business, science, and technology</p>
</div>
    <div class="course-feature">
    <div class="row">
        <?php
            $listcat=mysqli_query($con,"SELECT * FROM courses ORDER BY id DESC");
            while($lc=mysqli_fetch_assoc($listcat)){
                $courseid=$lc["id"];
            ?>
            <div class="col-lg-4 col-md-6 d-flex">
            <div class="course-box d-flex aos" data-aos="fade-up">
            <div class="product">
            <div class="product-img">
                <div style="height:150px">
                    <a href="course-details/<?php echo $lc['url'] ?>">
                    <img class="img-fluid1" alt="<?php echo $lc['title'] ?>" src="course-images/<?php echo $lc['courseimage'] ?>">
                    </a>
                </div>
            <div style="display:none" class="price">
                <?php 
                if($lc['price']=="0"){ ?>
                  <h3>Free</h3>  
               <?php }else{
                ?>
            <h3>Ksh. <?php echo number_format($lc["price"]) ?></h3>
            <?php } ?>
            </div>
            </div>
            <div class="product-content">
                <div style="height:60px">
                    <h3 class="title instructor-text"><a href="course-details/<?php echo $lc['url'] ?>"><?php echo $lc['title'] ?></a></h3>
                </div>
                <div style="height:150px">
                     <p class="title instructor-text"><?php echo substr($lc['shortdescription'],0,200) ?>...</p>
                 </div>
            <div class="course-info d-flex align-items-center">
            <div class="rating-img d-flex align-items-center">
            <img src="assets/img/icon/icon-01.svg" alt>
            <p><?php echo mysqli_num_rows(mysqli_query($con,"SELECT * FROM units WHERE courseid='$courseid'")) ?> Units</p>
            </div>
            <div class="course-view d-flex align-items-center">
            <img src="assets/img/icon/icon-02.svg" alt>
            <p><?php echo $lc['hours'] ?></p>
            </div>
            </div>
            
            <div class="all-btn all-category d-flex align-items-center">
            <?php if($id!=""){
               if(mysqli_num_rows(mysqli_query($con,"SELECT * FROM mycourses WHERE courseid='$courseid' AND studentid='$id'"))>0){ ?>
                   <a href="dashboard/course-lesson/<?php echo $url ?>" class="btn btn-enroll w-100">Continue Learning</a>
             <?php  }else{ ?>
                 <!--<a href="enroll.php" class="btn btn-enroll w-100">Enroll Now</a>-->
                 <a href="course-details/<?php echo $lc['url'] ?>" class="btn btn-enroll w-100">View Details</a>
             <?php } 
            }else{
            ?>
            <a href="course-details/<?php echo $lc['url'] ?>" class="btn btn-enroll w-100">View Details</a>
            <?php } ?>
            </div>
            </div>
            </div>
            </div>
            </div>
          <?php } ?>
    </div>
    </div>
</div>
</section>






<?php include_once('includes/footer.php') ?>
</body>
</html>