<div class="col-sm-8">
    <div class="row gray">
        <div class="col-sm-12 ">
            <div class="col-sm-12">
                <nav class="text-justify">
                    <div class="col-sm-12" style="padding: 0">
                        <span class="clo-sm-3" title="Add work Files" style="padding: 0">
                            <h3 style="text-align: center !important">View Work Files</h3>
                            <input type="hidden" id="baseUrl" value="<?php echo base_url(); ?>">
                        </span><br>
                    </div>
                </nav>
            </div>
            <?php
//            echo validation_errors();
            ?>
            <div class="row" id="viewFileOrder" style="display: none">
                <?php
                echo form_open('admin/course/update-file-order/' . $course_info->url);
                ?>
                <div class="col-sm-12">
                    <div class="col-sm-12 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="order" name="file_order"
                                    class="form-control">
                            </select>
                            <span id="order_error" style="color: red;display: none;"></span>
                        </div>
                        <div class="form-group col-sm-6" id="fileNameView" style="display: none;">
                            <select name="selected_file" 
                                    id="selected_file" class="form-control">
                            </select>
                            <span id="selected_file_error" style="color: red;display: none;"></span>
                        </div>
                        <input type="hidden" id="random_number" name="random_number" value="">
                        <div class="col-sm-12"><br></div>
                        <div class="form-group col-sm-12">
                            <div class="form-group col-sm-3">
                                <button id="updateWorkFile" type="submit" class="green-btn btn btn-default">Update</button>
                            </div>
                            <div class="form-group col-sm-3">
                                <button id="CancelBtn" type="button" class="green-btn btn btn-default">Cancel</button>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12"><br></div>
                </div>
                <?php
                echo form_close();
                ?>
            </div>
            <div class="col-sm-12 ">
                <div class="col-sm-12 gray_ttc padding-zero" style="font-size: 14px;font-weight: bold;border-bottom: 2px solid #80C12C">
                    <div class="col-sm-12 form-group"></div>
                    <div class="form-group col-sm-3">
                        Folder Name
                    </div>
                    <div class="form-group col-sm-4">
                        File Name
                    </div>
                    <div class="form-group col-sm-3">
                        File Size
                    </div>
                    <div class="form-group col-sm-2">
                        Action
                    </div>
                </div>
                <div class="col-sm-12 form-group"></div>

                <div id="viewWOrkFile">
                    <?php
                    if ($work_file_info) {
                        $i = 0;
                        foreach ($work_file_info as $file_value) {
                            ++$i;
                            ?>
                            <div id="singleWorkFile" class="col-sm-12 padding-zero <?php echo ($i % 2 == 0) ? 'gray' : 'white'; ?>" >
                                <div class="col-sm-12"><br></div>
                                <div class="form-group col-sm-3">
                                    <?php
                                    echo $folder_name[$file_value->work_file_id];
                                    ?>
                                </div>

                                <div class="form-group col-sm-4">
                                    <?php echo $file_value->work_file_name ?>
                                </div>
                                <div class="form-group col-sm-3">
                                    <?php
                                    echo $this->tt_storage->set_size($file_value->work_file_size)->calculate_disk_storage()->get_unit_size();
                                    ?>
                                </div>
                                <div class="form-group col-sm-2">
                                    <input type="hidden" id="incValue<?php
                                        if(isset($random_number[$file_value->work_file_id])){
                                        echo $random_number[$file_value->work_file_id]; }
                                        ?>" value="<?php echo $i ?>">
                                        <a href="javascript:void(0)" id="btnMove<?php
                                            if(isset($random_number[$file_value->work_file_id])){
                                            echo $random_number[$file_value->work_file_id];}
                                        ?>"><i class="fa fa-exchange" title="Move Video"></i></a>
                                    <span>&nbsp;&nbsp;</span>
                                        <a href="javascript:void(0)" id="btnDelete<?php
                                            if(isset($random_number[$file_value->work_file_id])){
                                            echo $random_number[$file_value->work_file_id];}
                                        ?>"><i class="fa fa-trash" title="Delete"></i></a>
                                </div>
                            </div>
                            <div class="modal fade" style="" id="viewDeleteWorkFile<?php
                                if(isset($random_number[$file_value->work_file_id])){
                                echo $random_number[$file_value->work_file_id]; }
                            ?>" tabindex="-1" role="dialog" aria-labelledby="changeRole" aria-hidden="true">
                                <?php
                                $message2 = '<span style="text-align:center">Are you sure you want to delete course work file?</span>';
                                $this->cf->view_modal($random_number[$file_value->work_file_id], $message2);
                                ?>
                            </div>
                            <?php
                        }
                    }
                    ?>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="<?php echo base_url() ?>back_end_resource/course/view_course_work_file.js"></script>