<div class="row" id="view_section_order">
    <?php
        echo form_open('add-section-video-order/' . $section_id.'/'. $manage_video_id);
    ?>
    <div class="col-sm-8">
        <div class="gray_ttc padding-zero">
            <!--<div class="col-sm-12 form-group text-left"><h3>Video Section Name : Video Name</h3></div>-->
            <div class="form-group col-sm-6">
                
                <select id="video_order" name="video_order" class="form-control">
                    <option value="">Select Video Order</option>
                    <option value="1">Top</option>
                    <option value="2">After</option>
                    <option value="3">Bottom</option>
                </select>
<!--                <span id="order_error" style="color: red;display: none;"></span>-->
                
            </div>
            <div class="form-group col-sm-6" id="video_name_view" style="display: none;">
                <select name="selected_video_ordering" 
                        id="selected_video_ordering" class="form-control">
                </select>
<!--                <span id="selected_file_error" style="color: red;display: none;"></span>-->
            </div>
            
            <div class="col-sm-12"><br></div>
            <div class="form-group col-sm-12">
                <div class="col-sm-1"></div>
                <div class="form-group col-sm-2">
                    <button id="add_video_to_section" type="submit" class="green-btn btn btn-default">Add</button>
                </div>
                <div class="form-group col-sm-2">
                    <button id="CancelBtn" type="button" class="green-btn btn btn-default">Cancel</button>
                </div>
            </div>
        </div>
    </div>
    <?php
        echo form_close();
    ?>
</div>

<div class="col-sm-12" ><br>  <hr></div>
<div class="col-sm-12" id="view_course">
    <div class="col-sm-12 gray_ttc" style="border-bottom: 2px solid #8CC73F;padding-top: 10px;padding-bottom: 10px;font-weight: bold">
        <div class="col-sm-1">Serial</div>
        <div class="col-sm-3">Video Name</div>
        <div class="col-sm-4">Resolution</div>
        <div class="col-sm-3">Workfile Name</div>          
        <div class="col-sm-1">Action</div>
    </div>
    <div class="col-sm-12"><br></div>


    <div class="col-sm-12 padding-zero" id="view_manage_admin_video">
        <?php
        foreach ($assign_admin_video_info['manage_video'] as $manage_video_info) {
            $serial++;
            ?>
            <div class="col-sm-12 gray_ttc " style="padding-top: 10px;padding-bottom: 10px;">

                <div class="col-sm-1">
                    <?php echo $serial; ?>
                </div>

                <div class="col-sm-3">
                    <?php
                    $encrypt_manage_video_id = $this->encryption->encrypt($manage_video_info->manage_video_id);
                    $encrypt_manage_video_id = str_replace("/", "%F2", $encrypt_manage_video_id);
                    ?>
                    <a href="<?php echo base_url() . 'view-single-video/' . $encrypt_manage_video_id ?>" target="_blank">
                        <?php echo $manage_video_info->manage_video_title; ?>
                    </a>
                </div>

                <div class="col-sm-4">
                    <?php
                    foreach ($assign_admin_video_info[$manage_video_info->manage_video_id] as $manage_video_location) {
                        $manage_video_location_id_data = $manage_video_location->manage_video_id . ',' . $manage_video_location->manage_video_location_id;
                        $encrypt_manage_video_location_id = $this->encryption->encrypt($manage_video_location_id_data);
                        $encrypt_data = str_replace("/", "%F2", $encrypt_manage_video_location_id);
                        ?>
                        <a href="<?php echo base_url() . 'view-single-video/' . $encrypt_data ?>" target="_blank">
                            <?php echo $manage_video_location->manage_video_location_resolution; ?>
                        </a>
                        <a href="javascript:void(0)" onclick="deleteSingleResolutionVideo('<?php echo base_url() . 'delete-single-resolution-video' ?>', '<?php echo $manage_video_location->manage_video_location_id ?>')">
                            <i class="fa fa-times-circle"></i>
                        </a>

                        <?php
                        echo " | ";
                    }
                    ?>
                </div>

                <div class="col-sm-3">
                    <?php 
                    if(isset($assign_admin_video_info['work_files'][$manage_video_info->manage_video_id])){
                    ?>
                    <a href="javascript:void(0)" target="_blank" onclick="downloadWorkFile('<?php echo base_url() . 'download-manage-admin-video-workfile/' ?>', '<?php echo $assign_admin_video_info['work_files'][$manage_video_info->manage_video_id]->work_file_id; ?>')">
                         <i class="fa fa-download"></i>
                     <?php
                             echo $assign_admin_video_info['work_files'][$manage_video_info->manage_video_id]->work_file_name;

                     ?>
                    </a>
                    <a href="javascript:void(0)" onclick="deleteVideoWorkfile('<?php echo base_url().'delete-admin-video-workfile' ?>','<?php echo $assign_admin_video_info['work_files'][$manage_video_info->manage_video_id]->work_file_type_id ?>')">
                        <i class="fa fa-times-circle"></i>
                    </a>
                    <?php
                        }
                    ?>

                </div>
                <input type="hidden" id="order_video_by_section_id" value="<?php echo $section_id;?>"> 
                <div class="col-sm-1">
                    <?php
                    
                        $encrypt_data = $encrypt_manage_video_id;
                        $decrypt_data = str_replace("%F2", "/", $encrypt_data);
                        $manage_video_id = $this->encryption->decrypt($decrypt_data);
                        ?>
<!--                        <a href="<?php //echo base_url(); ?>add-video-to-section/<?php //echo $video_course_id; ?>/<?php //echo $section_id; ?>/<?php //echo $manage_video_id; ?>">
                            <i class="fa fa-plus" title="Assign This video to section"></i>
                        </a>-->
                    <a href="javascript:void(0)" onclick="add_video_to_section('<?php echo base_url() . 'add-video-to-section' ?>','<?php echo $video_course_id; ?>','<?php echo $section_id; ?>','<?php echo $manage_video_id;?>')">
                        <i class="fa fa-plus" title="Assign This video to section"></i>
                    </a>
                    
                </div>
            </div>
<?php } ?>
    </div>
</div>
