<?php 
include_once('header.php');
$courses=get_view_courses($_SESSION['login_id']);
?>


<!-- START SECTION TOP -->
	<section class="section-top">
		<div class="container">
			<div class="col-lg-10 offset-lg-1 text-center">
				<div class="section-top-title wow fadeInRight" data-wow-duration="1s" data-wow-delay="0.3s" data-wow-offset="0">
					<h1>Available Courses</h1>
					<ul>
						<li><a href="index.php">Home</a></li>
						<li> / My Courses</li>
					</ul>
				</div><!-- //.HERO-TEXT -->
			</div><!--- END COL -->
		</div><!--- END CONTAINER -->
	</section>	
	<!-- END SECTION TOP -->

	<!--START COURSE -->
	<div class="bc_bg_two section-padding">
		<div class="container">
			<div class="section-title">
			  <h2>My Courses</h2>
			</div>				
			<div class="row">	
               <?php
				  for($i=0;$i<count($courses);$i++)
					  {
						if($courses[$i]['status']==0)
						$clr="primary";
						else
						$clr="success";
				?>
				<div class="col-lg-6 col-sm-12 col-xs-12 wow fadeInUp" data-wow-duration="1s" data-wow-delay="0.1s" data-wow-offset="0">
					<div class="course-slide2">
						<div class="course-img2">
							<?php if(!empty($courses[$i]['course_img'])){ ?>
								<img src="../instructor/courses_upload/<?php echo $courses[$i]['course_img']; ?>" width="370px" height="248px" alt="">
							<?php } else{ ?>
                           		 <img src="assets/images/banner/course-bg-p2.png" alt="">
                            <?php } ?>
							<div class="course-date2">
								<span class="month2">$<?php echo $courses[$i]['course_price']; ?></span>
							</div>
						</div>
						<div class="course-content2"><a class="c_btn2"><?php echo $courses[$i]['course_type']; ?></a>
							<h3><a >
                             <?php 
                                        $text = $courses[$i]['course_title'];
                                        $words = explode(" ", $text);
                            
                                        echo $words[0];
                                        if (isset($words[1])) {
                                            echo " " . $words[1];
                                        }
                                    ?>
                            </a></h3>
							<div class="co_list">
								<span><i class="fa fa-calendar"></i><?php echo $courses[$i]['no_of_class']; ?> Classes</span>
								<span><i class="fa fa-clock-o"></i><?php echo $courses[$i]['duration']; ?> Days Course Duration</span>
                                <?php /*?><span><a href="modules.php?course_id=<?php echo $courses[$i]['id']; ?>" class="btn_one">Start Learning</a></span><?php */?>
                                <span><a href="view_course.php?course_id=<?php echo $courses[$i]['id']; ?>" class="btn_one">Start Learning</a></span>
							</div>
						</div>
					</div><!--END COURSE SLIDE -->	
				</div><!--END COL -->			
                 <?php } if(count($courses)==0){ ?>
                        <div> <center> <strong class="text-danger"> No Courses Available </strong></center></div>
                        <div class="col-lg-12 text-center">
                            <div class="cc_btn">
                                <a class="btn_one" href="course.php">Enrol Now</a>
                            </div>
                        </div>
                    <?php } ?>
						
			</div><!--END ROW -->		
		</div><!--END CONTAINER -->
	</div>
	<!--END COURSE -->	

<?php include_once('footer.php'); ?>