<?php

$crud = new crudData;
if (isset($_POST['video'])) {
    $video = $_POST['video'];
} else {
    $video = 'https://www.youtube.com/embed/Jn2_-uVA0nU?si=lTR2irwSBxhjRmH9';
};
?>

<div class="content-wrapper">

    <?php require('./layout/headerpage.php'); ?>

    <div class="container col-12 mb-4 pb-5">
        <div class="row">
            <div class="col-12">
                <div class="col-12">
                    <div class="card  mx-3">
                        <div class="timeline-header bg-primary py-2 pl-2">
                            <b class="text-light judul"><span class="bi bi-film"></span> Video Tutorial <?php echo $video; ?></b>
                        </div>
                        <div class="card-body mb-0">
                            <div class="row mx-3 mt-2" style="background-color:'';">
                                <div class="col-md-10">
                                    <div class="card-body ">
                                        <form action="" method="post">

                                            <div class="row">
                                                <label class="col-lg-2 col-sm-12 col-form-label">Tutorial</label>
                                                <div class="col-lg-7 col-sm-12">
                                                    <select name="video" class="form-control form-control-sm fontInput ">
                                                        <option value=''>--Pilih Video Tutorial--</option>
                                                        <?php
                                                        $tutorial = new tutorial();
                                                        echo $tutorial->listVideo();
                                                        ?>

                                                    </select>

                                                </div>
                                                <button type=" submit" class="btn btn-primary btn-xs float-right col-sm-3 col-lg-1" name="save"><i class="bi bi-person-video3"></i> <b>LIHAT</b></button>


                                            </div>

                                        </form>


                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="card-body ">

                                        <?php $tutorial = new tutorial;
                                        echo $tutorial->view($video);

                                        ?>

                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>


            </div>
        </div>
    </div>
</div>