 <?php
 /*
 Template Name: lekcja 3
 */
 get_header();
 ?>

 <!-- type: kurs1 -->
<?php
 block_unlg();
$wp_query = new WP_Query(array( 'post_type' => 'lekcja_3',
    'post_status'    => 'publish',
    'posts_per_page' => -1,
));
global $wpdb;
    $l3_title = $wpdb->get_var("SELECT meta_value FROM wp_postmeta WHERE meta_key LIKE 'lekcja_3_tytul' ");
     $l3_title2 = $wpdb->get_var("SELECT meta_value FROM wp_postmeta WHERE meta_key LIKE 'lekcja_3_tytul2' ");
      $l3_title3 = $wpdb->get_var("SELECT meta_value FROM wp_postmeta WHERE meta_key LIKE 'lekcja_3_tytul3' ");
      $l3_czas = $wpdb->get_var("SELECT meta_value FROM wp_postmeta WHERE meta_key LIKE 'lekcja_3_czas' ");
      $l3_zawartosc = $wpdb->get_var("SELECT meta_value FROM wp_postmeta WHERE meta_key LIKE 'lekcja_3_zawartosc' ");
      $l3_kategoria = $wpdb->get_var("SELECT meta_value FROM wp_postmeta WHERE meta_key LIKE 'lekcja_3_kategoria' ");
      $l3_trudnosc = $wpdb->get_var("SELECT meta_value FROM wp_postmeta WHERE meta_key LIKE 'lekcja_3_trudnosc' ");
      $l3_utrwal1 = $wpdb->get_var("SELECT meta_value FROM wp_postmeta WHERE meta_key LIKE 'lekcja_3_utrwal1' ");
       $l3_utrwal2 = $wpdb->get_var("SELECT meta_value FROM wp_postmeta WHERE meta_key LIKE 'lekcja_3_utrwal2' ");
       $l3_utrwal3 = $wpdb->get_var("SELECT meta_value FROM wp_postmeta WHERE meta_key LIKE 'lekcja_3_utrwal3' ");




?>
 <!-- type: kurs1 -->
<div  class="container-fluid lesson-block">
	<div class="container">
		<div class="row single-les-title">
			<div class="col-xs-12 col-sm-8 col-md-8">
				 	<?php echo   $l3_title;?>
			</div>
		</div>
		<div class="row single-les-subtitle">
			<div class="col-xs-12 col-sm-8 col-md-8">
			
			</div>
		</div>
		<div class="row single-les-subtitle2">
			<div class="col-xs-12 col-sm-8 col-md-8">
				<?php echo   $l3_title2;?>
			</div>
		</div>
		<div class="row single-les-cel">
			<div class="col-xs-12 col-sm-8 col-md-8">
			
			</div>
		</div>
		<div class="row">
			<div class="col-xs-12 col-sm-8 col-md-8">
				<!--<button  class="single-1-button ">Rozpocznij</button>-->
			</div>
		</div>
	</div>
</div>
<!--sekcja 2 -->
<div class="container-fluid sing-bg">
	<div class="container">
		<div class="row">
			<div class="col-xs-12 col-sm-11 col-md-8">
				<div class="row lesson-tit">
					<?php echo   $l3_title3;?>
				</div>
				<!-- -->
				<?php
 
							while ( $wp_query->have_posts() ) :
   	 						$wp_query->the_post();
							?>
				<div class="row lesson-name">
					<div class="col-xs-2 col-sm-1 col-md-1 ">
						<?php if((quiz_done_num() ===  post_quiz_num()) && (post_quiz_num() != 0 ) ){ ?>
						<div class="l-circle2"><i class="fa fa-check l-circle-check" aria-hidden="true"></i></div>
						<?php } else { ?>
						<div class="l-circle"></div>
						<?php } ?>
					</div>
					<div class="col-xs-10 col-sm-11 col-md-11">
						<a href="<?php the_permalink();?>"><?php the_title(); ?></a>
					</div>
				</div>
				<?php endwhile; ?>
				<!-- -->
				<div class="row">
					<!--<button  class="single-1-button ">Rozpocznij</button>-->
				</div>
			</div>
			<!-- sec col -->
			<div class="col-xs-12 col-sm-6 col-md-4 less-block ">
				<div class="row">
					<div class="col-md-12 box-sh">
						<div class="row less-block-img">

						</div>
						  
						<div class="row less-block-title">
							<div class="col-md-11">
									<?php echo   $l3_title;?>
							</div>
						</div>
						<div class="row">
							<div class="col-sm-8 col-md-4">
								<div class="row less-block-subtitle">
									<?php echo   $l3_czas;?>
								</div>
								<div class="row less-block-subtitle2">
									czas kursu
								</div>
								<div class="row stars-4">
									<?php if($l3_trudnosc === "1" || $l3_trudnosc === "0" ){ ?>
									<i class="fa fa-star" aria-hidden="true"></i>
									<i class="fa fa-star stars-grey" aria-hidden="true"></i>
									<i class="fa fa-star stars-grey" aria-hidden="true"></i>
								<?php } else if ($l3_trudnosc === "2") { ?>
									<i class="fa fa-star" aria-hidden="true"></i>
									<i class="fa fa-star" aria-hidden="true"></i>
									<i class="fa fa-star stars-grey" aria-hidden="true"></i>
									<?php } else{ ?>
									<i class="fa fa-star" aria-hidden="true"></i>
									<i class="fa fa-star" aria-hidden="true"></i>
									<i class="fa fa-star" aria-hidden="true"></i>
									<?php }?>
								</div>
								<div class="row less-block-subtitle2">
									poziom trudności
								</div>
							</div>
							<div class="col-sm-8 col-md-8">
								<div class="row less-block-subtitle">
									<?php echo     $l3_zawartosc;?>
								</div>
								<div class="row less-block-subtitle2">
									zawartość
								</div>
								<div class="row less-block-subtitle">
									<?php echo     $l3_kategoria;?>
								</div>
								<div class="row less-block-subtitle2">
									Kategoria
								</div>
							</div>
						</div>
				</div>
		</div>
		<!-- drugi panel --> 
		<div class="row">
			<div class="col-md-12 less-block2 box-sh">
				<div class="row less-block2-title">
					 Utrwal swoją wiedzę
				</div>
				<div class="row less-block2-subtitle">
					<div class="col-sm-2 col-md-2 less-check">
						<i class="fa fa-check" aria-hidden="true"></i>
					</div> 
					<div class="col-sm-10 col-md-10">
						<?php echo    $l3_utrwal1;?>
					</div>
				</div>
				<div class="row less-block2-subtitle">
					<div class="col-sm-2 col-md-2 less-check">
						<i class="fa fa-check" aria-hidden="true"></i>
					</div> 
					<div class="col-sm-10 col-md-10">
						<?php echo    $l3_utrwal2;?>
					</div>
				</div>
				<div class="row less-block2-subtitle">
					<div class="col-sm-2 col-md-2 less-check">
						<i class="fa fa-check" aria-hidden="true"></i>
					</div> 
					<div class="col-sm-10 col-md-10">
						<?php echo    $l3_utrwal3;?>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
		
</div>
</div>







               

 

<?php get_footer(); ?>
      