<?php include_once('header.php'); 

if(!empty($_GET['course_id']))
$course_id = $_GET['course_id'];
elseif(!empty($_POST['course_id']))
$course_id = $_POST['course_id'];
else
$course_id = '';

$limit=6;
$latest_news=get_courses_display($course_id,'','',1,$limit);
?>

<!-- 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>Search Sidebar</h1>
					<ul>
						<li><a href="index.php">Home</a></li>
						<li> / Course</li>
					</ul>
				</div><!-- //.HERO-TEXT -->
			</div><!--- END COL -->
		</div><!--- END CONTAINER -->
	</section>	
	<!-- END SECTION TOP -->

	<!--START COURSE -->
	<div class="best-cpurse section-padding">
		<div class="container">			
			<div class="row">					
				<div class="col-lg-8">					
					<div class="row">
                    	<?php
					  for($i=0;$i<count($latest_news);$i++)
					  {
					  
						  $sela=executework("SELECT * FROM  lms_cart_list,lms_cart_course where lms_cart_course.cart_id=lms_cart_list.cart_id and lms_cart_list.purchage_course_id='".$latest_news[$i]['id']."' and lms_cart_course.user_type='Student'");
						$cnta=@mysqli_num_rows($sela);
						$rowa=@mysqli_fetch_array($sela); 
    			?>
                  
               <div class="col-lg-6 col-sm-6 col-xs-12 wow fadeInUp" data-wow-duration="1s" data-wow-delay="0.<?php echo $i; ?>s" data-wow-offset="0">
					<div class="course-slide">
						<div class="course-img">
                        	<?php if(!empty($latest_news[$i]['course_img'])){ ?>
								<img src="../instructor/courses_upload/<?php echo $latest_news[$i]['course_img']; ?>" alt="">
							<?php } else{ ?>
                           		 <img src="assets/images/banner/course-bg-p2.png" alt="">
                            <?php } ?>
                            <div class="course-date"> 
								<span class="month">$<?php echo $latest_news[$i]['course_price']; ?></span>
							</div>
						</div> 
						<div class="course-content"><a class="c_btn" href="view_course.php?course_id=<?php echo $latest_news[$i]['id']; ?>"><?php $result = str_replace("_", " ", $latest_news[$i]['course_type']); echo mb_strtoupper($result); ?></a>
							 <h3>
                                <a href="view_course.php?course_id=<?php echo $latest_news[$i]['id']; ?>">
                                    <?php 
                                        $text = $latest_news[$i]['course_title'];
										$text = trim($text);
										
										if (mb_strlen($text) > 26) {
											echo mb_substr($text, 0, 26) . '...';
										} else {
											echo $text;
										}
                                    ?>
                                </a>
                            </h3>
							<span><i class="fa fa-calendar"></i><?php echo $latest_news[$i]['no_of_class']; ?> Classes</span> <br />
							<span><i class="fa fa-clock-o"></i><?php echo $latest_news[$i]['duration']; ?> Days Course Duration</span> 
						</div>
					</div><!--END COURSE SLIDE -->	
				</div><!--END COL -->
               <?php } 
			    if(count($latest_news)==0)
				{
			   ?> 
              		 <div> <center> <strong style="color:red"> No Data Found </strong> </center> </div>
               <?php }  ?>				
					</div><!--END ROW -->				
				</div><!--END COL -->
				<div class="col-lg-4">	
					<div class="sidebar-post">
						<div class="blog_search">
							<input type="text" class="form-control" placeholder="Type & Press Enter">
						</div>				
					</div><!-- END SINGLE POST -->
					<div class="rs-slider">
						<h4>Price Filter</h4>
						<div class="range-slider">
							<input type="range" value="500" min="0" max="500" range="true">
							<span class="range-value">500</span>
						</div>				
					</div><!-- END SINGLE POST -->
					<div class="sidebar-post">
						<div class="sidebar_title"><h4>Follow us</h4></div>
						<div class="single_social">
							<ul>
								<li><div class="social_item b_facebook"><a href="#" title="facebook"><i class="fa fa-facebook"></i><span class="item-list">150K Likes</span></a></div></li>
								
								<li><div class="social_item b_twitter"><a href="#" title="twitter"><i class="fa fa-twitter"></i><span class="item-list">138K Followers</span></a></div></li>
								
								<li><div class="social_item b_youtube"><a href="#" title="youtube"><i class="fa fa-youtube"></i><span class="item-list">90K Subscribers</span></a></div></li>
								
								<li><div class="social_item b_pinterest"><a href="#" title="pinterest"><i class="fa fa-pinterest"></i><span class="item-list">350K Followers</span></a></div></li>
								
								<li><div class="social_item b_tumblr"><a href="#" title="rss"><i class="fa fa-tumblr"></i><span class="item-list">901 Followers</span></a></div></li>
								
								<li><div class="social_item b_rss"><a href="#" title="rss"><i class="fa fa-rss"></i><span class="item-list">411 Followers</span></a></div></li>
							</ul>
						</div><!-- END SOCIAL MEDIA POST -->
					</div><!-- END SIDEBAR POST -->							
					<div class="sidebar-post">
						<div class="sidebar_title"><h4>CATEGORIES</h4></div>
						<div class="single_category">
							<ul>
                            <?php 
								$cat=get_course_master('');
								 for($i=0;$i<count($cat);$i++)
					  			 {
							?>
								<li> <a href="#" style="text-decoration:none"> <i class="fa fa-arrow-right text-danger"></i> &nbsp;<?php echo $cat[$i]['title']; ?></a></li>
                             <?php } ?>
							</ul>
						</div><!-- END SOCIAL MEDIA POST -->
					</div><!-- END SIDEBAR POST -->						
								
					<div class="sidebar-post">
						<div class="sidebar_title"><h4>Skill Level</h4></div>
						<div class="single_langu">
							<i class="fa fa-arrow-right text-danger"></i>
							<span>All Levels</a></span>
						</div><!-- END SINGLE LANGU -->
						<div class="single_langu">
							<i class="fa fa-arrow-right text-danger"></i>
							<span>Beginner Levels</span>
						</div><!-- END SINGLE LANGU -->
						<div class="single_langu">
							<i class="fa fa-arrow-right text-danger"></i>
							<span>Intermediate Level</span>
						</div><!-- END SINGLE LANGU -->
						<div class="single_langu">
							<i class="fa fa-arrow-right text-danger"></i>
							<span>Expert Level</span>
						</div><!-- END SINGLE LANGU -->
					</div><!-- END SIDEBAR POST -->				
									
				</div><!--END COL -->				
			</div><!--END ROW -->		
		</div><!--END CONTAINER -->
	</div>
	<!--END COURSE -->	

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