<script src="<?php echo base_url(); ?>back_end_resource/manage_video_section/manage_video_section.js" type="text/javascript"></script>
<div class="col-sm-10">
    <div class="row ">
        <div class="col-sm-12 ">
            <div class="col-sm-6 col-sm-offset-3">
                <div class="input-group">
                    <input type="text" 
                           class="form-control" 
                           id="manage_section_video_search"
                           oninput="manage_section_video_search(this.value,'<?php echo base_url() . 'search-section-video' ?>')"
                           placeholder="Search here..." 
                           aria-describedby="basic-addon1">
                    <span class="input-group-addon" id="basic-addon1"><i class="fa fa-search"></i></span>
                </div>
            </div>
            <div class="col-sm-3">
                <select class="form-control"
                        id="manage_section_video_status"
                        onchange="manage_section_video_status(this.value, '<?php echo base_url("search-section-video"); ?>')">
                    <option value=''>All</option>
                    <option value='1'>Active</option>
                    <option value='2'>Draft</option>
                </select>
            </div>
            <input type="hidden" id="baseUrl" value="<?php echo base_url();?>">
            <input type="hidden" id="order_video_by_section_id" value="<?php echo $section_id;?>">
            
        </div>
        <div class="col-sm-12 "><br></div>
        <div class="row" id="view_section_order" style="display: none;">
            <?php
                
                echo form_open('section-video-move/'.$section_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>
                    <input type="hidden" id="move_video_by_manage_video_id" name="move_video_by_manage_video_id">
                    <div class="form-group col-sm-12">
                        <div class="col-sm-1"></div>
                        <div class="form-group col-sm-2">
                            <button id="move_video_of_a_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></div>
        <div class="col-sm-12 ">
            <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
                    if(isset($indivisual_section_video_info)){
                    foreach ($indivisual_section_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 ($indivisual_section_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="deleteSectionSingleResolutionVideo('<?php echo base_url() . 'delete-section-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($indivisual_section_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 $indivisual_section_video_info['work_files'][$manage_video_info->manage_video_id]->work_file_id; ?>')">
                                     <i class="fa fa-download"></i>
                                 <?php
                                         echo $indivisual_section_video_info['work_files'][$manage_video_info->manage_video_id]->work_file_name;

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

                            </div>
                            <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="javascript:void(0)" onclick="show_div_for_moving_video('<?php echo $manage_video_id?>')">
                                <i class="fa fa-exchange" title="Move Video"></i>
                                
                                </a>
                                <a href="<?php echo base_url() . 'edit-admin-video/'.$encrypt_manage_video_id.'/'.$section_id ?>" target="_blank">
                                <i class="fa fa-edit" title="Edit"></i>
                                </a>
                                <a href="javascript:void(0)" onclick="delete_single_section_video('<?php echo base_url().'delete-single-section-video'?>','<?php echo $section_id?>','<?php echo $manage_video_id?>')">
                                    <i class="fa fa-trash" title="Delete"></i>
                                </a>
                                
                            </div>
                            
                        </div>
                    
                    <?php 
                        }
                    }
                    echo $manage_section_video_pagination;
                    ?>
                  </div>

            </div>
        </div>
    </div>
    <div class="col-sm-12 "><br></div>   
</div>
<script type="text/javascript" src="<?php echo base_url(); ?>back_end_resource/manage_admin_video/add_admin_video.js"></script>




