<?php
$quiz_running = 'no_quiz_start';
$session_quiz_id = NULL;

$gradients = array();
$gradients[] = 'mask gradient-vue';
$gradients[] = 'mask gradient-angular';
$gradients[] = 'mask gradient-react';
$gradients[] = 'mask gradient-material';
$gradients[] = 'mask gradient-html';
$gradients[] = 'mask gradient-laravel';
$gradients[] = 'mask gradient-react-native';
$gradients[] = 'mask gradient-nuxtjs';



if($latest_session) 
{ ?>
        <div class="col-xs-6 col-sm-6 col-md-4 col-lg-3"> 
            <div class="card card-bundle" data-turbolinks="false"> 
                <div class="thumbnail"> 
                    <span class="maskk gradient-defaultt mask gradient-react-native"> </span> 
                    <a href="javascript:void(0)" data-toggle="modal" data-target="#session_video"   class="thumb-cover"  data-toggle="tooltip" title="" data-original-title="Start Video"> </a>

                    <div class="details card-dark-shadow"> 
                        <div class="quiz_icons">
                           

                            </div>
                            <div class="framework-logo"> 
                                <p class="quiz_title"> <?php echo $latest_session['name']; ?> </p> 
                            
                            </div> 
                        </div> 

                        <div class="actions"> 
                            <a href="javascript:void(0)" data-toggle="modal" data-target="#session_video"  class="title_quiz"><?php echo $latest_session['name']; ?></a>
                            <a href="javascript:void(0)" data-toggle="modal" data-target="#session_video"   class="btn btn-neutral btn-fill"  data-toggle="tooltip" title="" data-original-title="Start Video">
                                <i class="far fa-play-circle"></i>                    
                            </a> 
                                                            
                            </div> 
                        </div> 
                    </div>
                    <div class="mobile-view">
                        <a href="javascript:void(0)" data-toggle="modal" data-target="#session_video" class="thumb-cover    float-left btn btn-primary btn-sm"><i class="far fa-play-circle"></i>Start Video </a>   
                    </div> 
                </div>

            <?php   }else{
                ?>
                <div class="col-12 text-center text-danger"> <?php echo lang('no_quiz_found'); ?></div>
                <?php } ?> 

                <div id="session_video" class="modal fade"  role="dialog">
                    <div class="modal-dialog modal-lg">
                        <div class="modal-content">
                            <div class="modal-header">
                                <h5 class="modal-title" id="exampleModalCenterTitle">Session Video</h5>
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span class="d-none" aria-hidden="true">×</span>
                                </button>
                            </div>
                            <div class="modal-body">
                                <div class="center_content text-center">
                                    <!--  <iframe width="700" height="345" src="<?php echo $latest_session['video_link']; ?>"  allowfullscreen></iframe>-->

                                   <video controls width="700">
                                    <source src="<?php echo $latest_session['video_link']; ?>"
                                            type="video/webm">
                                    <source src="<?php echo $latest_session['video_link']; ?>"
                                            type="video/mp4">

                                    Sorry, your browser doesn't support embedded videos.
                                </video> 
                                        
                                </div>
                                <div class="modal-footer">
                                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div> 