<?php
$i = 0;
foreach ($video_courses as $video_course_value) {
    ++$i;
    ?>
    <div class="<?php
    if ($i % 2 == 0) {
        echo 'row gray';
    } else {
        echo 'row white';
    }
    ?>">
        <div class="col-sm-7 form-group" style="text-align: left !important">
            <a href="<?php echo base_url() . $video_course_value->url; ?>" target="_blank" class="red">
                <?php echo $video_course_value->video_course_title; ?>
            </a><br>
            By- 
            <?php
            if ($video_course_value->person_role == 6 || $video_course_value->person_role == 1) {
                echo '<span class="green">Talha Training</span>';
            } else if ($video_course_value->person_role == 3) {
                ?>
                <a href="<?php echo base_url() . $individual_teacher_value[$video_course_value->person_id]->url . '/profile' ?>" target="_blank">
                    <?php
                    echo $individual_teacher_value[$video_course_value->person_id]->person_first_name . ' ' . $individual_teacher_value[$video_course_value->person_id]->person_last_name;
                    ?>
                </a>
                <?php
            } else if ($video_course_value->person_role == 4) {
                ?>
                <a href="<?php echo base_url() . $organization_value[$video_course_value->person_id]->url . '/profile' ?>" target="_blank">
                    <?php
                    echo $organization_value[$video_course_value->person_id]->organization_name;
                    ?>
                </a>
                <?php
            }
            ?>

        </div>
        <!--<div class="col-sm-2 form-group"><div class="rating"></div></div>-->
        <div class="col-sm-2 form-group" style="text-align: left !important">
            <span class="red">
                <?php
                switch ($video_course_value->video_management_level) {
                    case 0:
                        ?>
                        <span title="Any">
                            <img src="<?php echo base_url() . 'image/gray-box.jpg'; ?>" >
                            <img src="<?php echo base_url() . 'image/gray-box.jpg'; ?>" >
                            <img src="<?php echo base_url() . 'image/gray-box.jpg'; ?>" >
                        </span>
                        <?php
                        break;
                    case 1:
                        ?>
                        <span title="Basic">
                            <img src="<?php echo base_url() . 'image/gray-box.jpg'; ?>" >
                            <img src="<?php echo base_url() . 'image/gray-box.jpg'; ?>" >
                            <img src="<?php echo base_url() . 'image/green-box.jpg'; ?>" >
                        </span>
                        <?php
                        break;
                    case 2:
                        ?>
                        <span title="Intermediate">
                            <img src="<?php echo base_url() . 'image/gray-box.jpg'; ?>" >
                            <img src="<?php echo base_url() . 'image/green-box.jpg'; ?>" >
                            <img src="<?php echo base_url() . 'image/green-box.jpg'; ?>" >
                        </span>
                        <?php
                        break;
                    case 3:
                        ?>
                        <span title="Advanced">
                            <img src="<?php echo base_url() . 'image/green-box.jpg'; ?>" >
                            <img src="<?php echo base_url() . 'image/green-box.jpg'; ?>" >
                            <img src="<?php echo base_url() . 'image/green-box.jpg'; ?>" >
                        </span>
                        <?php
                        break;
                }
                ?>
            </span>
        </div>
        <div class="col-sm-3 form-group" style="text-align: left !important">
            <span style="margin-left: 20px">
                <?php
                if ($video_course_value->video_course_type == 1) {
                    echo 'BDT 15,500';
                } elseif ($video_course_value->video_course_type == 2) {
                    echo 'Free';
                }
                ?>
            </span>
        </div>        
    </div>
    <?php
}
?>


<?php
$total_page = ceil($total_video_course->total_video_course / 10);
if ($total_page > 1) {
    ?>
    <nav class="course-pagination">
        <ul class="pagination">
            <?php
            if ($page > 2) {
                ?>
                <li>
                    <a href="<?php echo base_url() . 'course'; ?>" aria-label="Previous">
                        <span aria-hidden="true" title="First Page">&laquo;&laquo;</span>
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url() . 'course/' . ($page - 1); ?>" aria-label="Previous">
                        <span aria-hidden="true" title="Previous Page">&laquo;</span>
                    </a>
                </li>
            <?php } elseif ($page > 1) { ?>
                <li>
                    <a href="<?php echo base_url() . 'course/' . ($page - 1); ?>" aria-label="Previous">
                        <span aria-hidden="true" title="Previous Page">&laquo;</span>
                    </a>
                </li>
                <?php
            }
            for ($i = 0; $total_page > $i; $i++) {
                echo '<li><a href="' . base_url() . 'course/' . ($i + 1) . '">' . ($i + 1) . '</a></li>';
            }
            if ($total_page != $page) {
                ?>
                <li>
                    <a href="<?php echo base_url() . 'course/' . ($page + 1); ?>" aria-label="Next">
                        <span aria-hidden="true" title="Next Page">&raquo;</span>
                    </a>
                </li>
                <li>
                    <a href="<?php echo base_url() . 'course/' . $total_page; ?>" aria-label="Next">
                        <span aria-hidden="true" title="Last Page">&raquo;&raquo;</span>
                    </a>
                </li>
            <?php } ?>
        </ul>
    </nav>
<?php }