<div class="col-sm-12 gray  form-group">
    <div id="organization_course_view" style="margin-left: 9px;">            
        <?php
        //$this->cf->dd($organization);
        $i = 0;
        foreach ($organization['video_course_detail'] as $course_value) {
            ++$i;
            ?>
            <div class="<?php
            echo ($i % 2 == 0) ? 'row white' : 'row gray';
            ?>">
                <div class="col-sm-3 form-group organisation_course" style="text-align: left !important">
                    <a href="<?php echo base_url() . $course_value->url; ?>" id="courseNameView<?php echo $course_value->url ?>" target="_blank" class="red organisation_course">
                        <?php
                        if (strlen($course_value->video_course_title) < 16) {
                            echo $course_value->video_course_title;
                        } else {
                            echo character_limiter($course_value->video_course_title, 15);
                        }
                        echo '</a>';
                        if (strlen($course_value->video_course_title) >= 16) {
                            ?>
                            <span id="moreCourseName<?php echo $course_value->url ?>" style="cursor: pointer">more</span>
                            <?php
                        }
                        ?>
                        <input type="hidden" id="hiddenCourseName<?php echo $course_value->url ?>" value="<?php echo $course_value->video_course_title ?>">
                        <br>

                        By- 

                        <span class="green">
                            <?php
                            if($course_value->person_role == '1' || $course_value->person_role == '6'){
                                echo 'Talha Training';
                            }
                            else{
                                if(strlen($course_value->person_first_name) && strlen($course_value->person_last_name) < 20){
                                    echo $course_value->person_first_name . ' ' . $course_value->person_last_name; 
                                }
                                else{
                                    echo substr($course_value->person_first_name, 0, 30).' '.substr($course_value->person_last_name, 0, 20).'.'.' '.'.'.' '.'.';
                                }
                            }
                            //echo $course_value->person_first_name . ' ' . $course_value->person_last_name;
                            ?>
                        </span>

                </div>

                <div class="col-sm-2 form-group text-left" style="padding-left:0;">
                    <?php
                    if ($course_value->video_course_type == 1) {
                        if ($course_value->video_course_price_currency == 1) {
                            //echo 'BDT ' . $course_value->video_course_price . ' / USD ' . round($this->tt_currency->set($course_value->video_course_price, 'BDT', 'USD')->convert_currency()->get());
                            echo 'BDT ' . $course_value->video_course_price;
                        } else if ($course_value->video_course_price_currency == 2) {
                            //echo 'BDT ' . round($this->tt_currency->set($course_value->video_course_price, 'USD', 'BDT')->convert_currency()->get()) . ' / USD ' . $course_value->video_course_price;
                            echo ' USD ' . $course_value->video_course_price;
                        }
                    } else {
                        echo 'Free';
                    }
                    ?>
                </div>

                <div class="col-sm-1 padding-zero form-group" style="text-align: left !important">
                    <?php
                    switch ($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;
                    }
                    ?>
                </div>

                <?php
                if ($person_detail->person_id) {
                    if (in_array($person_detail->person_role, Array(3, 4, 5))) {
                        ?>
                        <div class="col-sm-2 form-group" style="text-align: left !important;padding: 5px">
                            <div id="ratingValue<?php echo $course_value->url ?>" class="rating-star">
                                <div class="rating-star-value" id="ratingDiv<?php echo $course_value->url ?>" style="width: <?php echo round(($course_value->video_management_rating * 100) / 5) ?>%"></div>
                                <div class="rating-star-bg"></div>
                            </div>
                        </div>
                    <?php } else {
                        ?>
                        <div class="col-sm-2 form-group" style="text-align: left !important;padding: 5px">
                            <div  class="rating-star">
                                <div class="rating-star-value" style="width: <?php echo round(($course_value->video_management_rating * 100) / 5) ?>%"></div>
                                <div class="rating-star-bg"></div>
                            </div>
                        </div>
                        <?php
                    }
                } else {
                    ?>
                    <div class="col-sm-2 form-group" style="text-align: left !important;padding: 5px">
                        <div  class="rating-star">
                            <div class="rating-star-value" style="width: <?php echo round(($course_value->video_management_rating * 100) / 5) ?>%"></div>
                            <div class="rating-star-bg"></div>
                        </div>
                    </div>
                <?php }
                ?>
            </div>
            <input type="hidden" id="courseRating<?php echo $course_value->url ?>" value="<?php echo round(($course_value->video_management_rating * 100) / 5) ?>">
            <input type="hidden" id="org_id" value="<?php echo $person_detail->person_id; ?>">
            <?php
        }
        ?>

        <?php
        if (empty($organization)) {
            echo 'There is no course';
        }
        
        echo $organization_video_course_pagination;
        ?> 
    </div>
</div>
