<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <script src="<?php echo base_url(); ?>js/countries.js" type="text/javascript"></script>
    <div class="col-sm-9 col-md-9">
        <div class="">
            <a href="#">Add Folder</a>->>
            <span>Add Folder For Video Management </span>
        </div>

        <h1 class="page-header">Add Folder For Video Management </h1>
        <p>
            <?php
            $message = $this->session->userdata('message');
            if ($message) {
                echo $message;
            }
            $this->session->unset_userdata('message');
            ?>
        </p>
        <div class="table-responsive col-sm-12">
            <?php echo validation_errors(); ?>
            <form id="video" action="<?php echo base_url(); ?>super_admin_video/add_folder" method="post" name="add_work_details" enctype="multipart/form-data" >
                <div class="form-group col-sm-12">
                    <div class="form-group col-sm-8">
                        <label class="control-label" for="typeahead">Course Category </label><span class="required" style="color: red"> * </span>
                        <div class="controls">
                            <select  
                                data-errormessage-value-missing="Course Category is required!" 
                                class="form-control validate[required] text-input"
                                id="group_type" name="group_type" onchange="addGroupType(this.value);" style="float:left; " >
                                <option value="">Select Type</option>
                                <?php foreach ($course_categories as $v_type) { ?>
                                    <option value="<?php echo $v_type->course_category_id; ?>"> <?php echo $v_type->course_category_name; ?></option>
                                <?php } ?>
                                <option value="other">Other</option>
                            </select>
                        </div>
                        <div class="form-group col-sm-8" style="color: red"><?php echo form_error('group_type'); ?>  </div>
                        <div class="form-group col-sm-8" id="other_type">
                            <script>
                                function addGroupType(groupType) {
                                    if (groupType === 'other') {
                                        document.getElementById('other_type').innerHTML = "<br><input style='float:left;' data-errormessage-value-missing='Video Work files is required!' class='form-control validate[required] text-input' type='text' id='group_other_type' name='group_other_type' value='' placeholder='Type New Category' onblur='checkGroupType(this.value);' >";
                                        document.getElementById('message1').innerHTML = "<br><p style='color:red;'>Course Category Is required</p>";
                                    } else {
                                        document.getElementById('other_type').innerHTML = "";
                                        document.getElementById('message1').innerHTML = "";
                                    }
                                }

                                function checkGroupType(groupOtherType)
                                {
                                    if (groupOtherType !== '') {
                                        document.getElementById('message1').innerHTML = '<p style="color:red;"></p>';
                                    } else if (groupOtherType == '') {
                                        document.getElementById('message1').innerHTML = '<p style="color:red;">Please Enter Group type</p>';
                                    }
                                }
                            </script>
                        </div>
                        <div id="other_type" class="col-sm-4"></div>
                        <div class="col-sm-4" id="message1"></div>
                        <div class="col-sm-4" id="message2"></div>
                    </div>


                    <div class="form-group col-sm-8">
                        <label for="folder_name">Folder  Name</label><span class="required" style="color: red"> * </span>
                        <input type="text"   
                               data-errormessage-value-missing="Folder  Name is required!" 
                               class="form-control validate[required] text-input"
                               class="form-control" id="video_folder_name" name="video_folder_name" value="<?php echo set_value('video_folder_name'); ?>" placeholder="Enter folder name">
                    </div>
                    <div class="form-group col-sm-8" style="color: red"><?php echo form_error('video_folder_name'); ?>  </div>


                    <div class="form-group col-sm-8">
                        <label for="video_title">Video Title</label><span class="required" style="color: red"> * </span>
                        <input type="text"    
                               data-errormessage-value-missing="Folder  Name is required!" 
                               class="form-control validate[required] text-input"
                               id="video_title" name="video_title" value="<?php echo set_value('video_title'); ?>" placeholder="Enter video title" >
                    </div>
                    <div class="form-group col-sm-8" style="color: red"><?php echo form_error('video_title'); ?>  </div>


                    <div class="form-group col-sm-8">
                        <label for="video_url">Video URL</label><span class="required" style="color: red"> * </span>
                        <input type="text"    
                               data-errormessage-value-missing="Video URL is required!" 
                               class="form-control validate[required] text-input"
                               id="video_url" name="video_url" value="<?php echo set_value('video_url'); ?>" placeholder="Enter video URL" >
                    </div>
                    <div class="form-group col-sm-8" style="color: red"><?php echo form_error('video_url'); ?>  </div>

                    <div class="form-group col-sm-8">
                        <label for="video_price">Video Price</label><span class="required" style="color: red"> * </span>
                        <input type="text"     
                               data-errormessage-value-missing="Video Price is required!" 
                               class="form-control validate[required] text-input"
                               id="video_price" name="video_price" value="<?php echo set_value('video_price'); ?>" placeholder="Type Video Price" >
                    </div>
                    <div class="form-group col-sm-8" style="color: red"><?php echo form_error('video_price'); ?>  </div>

                    <div class="form-group col-sm-8">
                        <label for="video_work_files">Video Work files</label><span class="required" style="color: red"> * </span><br>
                        <input type="radio"      
                               data-errormessage-value-missing="Video Work files is required!" 
                               class="validate[required] text-input"
                               name="video_work_files" id="status" value="1"  />Yes
                        <input type="radio"       
                               data-errormessage-value-missing="Video Work files is required!" 
                               class="validate[required] text-input"
                               name="video_work_files" id="status" value="0" />No
                    </div>
                    <div class="form-group col-sm-8" style="color: red"><?php echo form_error('video_work_files'); ?>  </div>

                    <div class="form-group col-sm-8">
                        <label for="video_training_objectives">Video Training Objective</label><span class="required" style="color: red"> * </span>
                        <textarea name="video_training_objectives" class="texteditor"  id="textarea2" rows="3"><?php echo set_value('video_training_objectives') ?></textarea>
                    </div>
                    <div class="form-group col-sm-8" style="color: red"><?php echo form_error('video_training_objective'); ?>  </div>

                    <div class="form-group col-sm-8">
                        <label for="video_training_prerequisites">Video Training Prerequisites </label><span class="required" style="color: red"> * </span>
                        <textarea name="video_training_prerequisites" class="texteditor"  id="textarea2" rows="3"><?php echo set_value('video_training_prerequisites') ?></textarea>
                    </div>
                    <div class="form-group col-sm-8" style="color: red"><?php echo form_error('video_training_prerequisites'); ?>  </div>

                    <div class="form-group col-sm-8">
                        <label for="video_training_materials">Video Training Materials</label><span class="required" style="color: red"> * </span>
                        <textarea name="video_training_materials" class="texteditor"  id="textarea2" rows="3"><?php echo set_value('video_training_materials') ?></textarea>
                    </div>
                    <div class="form-group col-sm-8" style="color: red"><?php echo form_error('video_training_materials'); ?>  </div>

                    <div class="form-group col-sm-8">
                        <label for="video_training_outline">Video Training Outline </label><span class="required" style="color: red"> * </span>
                        <textarea name="video_training_outline" class="texteditor"  id="textarea2" rows="3"><?php echo set_value('video_training_outline') ?></textarea>
                    </div>
                    <div class="form-group col-sm-8" style="color: red"><?php echo form_error('video_training_outline'); ?>  </div>

                    <div class="form-group col-sm-8">
                        <label for="video_management_meta_description">Video Management Meta Description</label><span class="required" style="color: red"> * </span>
                        <textarea name="video_management_meta_description" class="texteditor"  id="textarea2" rows="3"><?php echo set_value('video_management_meta_description') ?></textarea>
                    </div>
                    <div class="form-group col-sm-8" style="color: red"><?php echo form_error('video_management_meta_description'); ?>  </div>

                    <div class="form-group col-sm-8">
                        <label for="video_management_meta_keywords">Video Management Meta Keyword</label><span class="required" style="color: red"> * </span>
                        <textarea name="video_management_meta_keywords" class="texteditor"  id="textarea2" rows="3"><?php echo set_value('video_management_meta_keywords') ?></textarea>
                    </div>
                    <div class="form-group col-sm-8" style="color: red"><?php echo form_error('video_management_meta_keyword'); ?>  </div>

                    <div class="form-group col-sm-8">
                        <label for="video_management_author">Video Management Author</label><span class="required" style="color: red"> * </span>
                        <input type="text" class="form-control" id="video_management_author" name="video_management_author" value="<?php echo set_value('video_management_author'); ?>" placeholder="Type video_management_author" >
                    </div>
                    <div class="form-group col-sm-8" style="color: red"><?php echo form_error('video_management_author'); ?>  </div>

                    <div class="form-group col-sm-8">
                        <label for="video_status">Video Status</label><span class="required" style="color: red"> * </span><br>
                        <input type="radio"       
                               data-errormessage-value-missing="Video Status is required!" 
                               class="validate[required] text-input"
                               name="video_status" id="status" value="1"  />Published
                        <input type="radio"       
                               data-errormessage-value-missing="Video Status is required!" 
                               class="validate[required] text-input"
                               name="video_status" id="status" value="0" />UnPublished
                    </div>
                    <div class="form-group col-sm-8" style="color: red"><?php echo form_error('video_status'); ?>  </div>

                    <div class="form-group col-sm-8">
                        <label for="video_access_level">Video Access Level</label><span class="required" style="color: red"> * </span>
                        <select      
                            data-errormessage-value-missing="Video Access Level is required!" 
                            class="validate[required] text-input"
                            id="video_access_level"  name="video_access_level" >
                            <option value="">--Select User--</option>
                            <option value="1">Public</option>
                            <option value="2">Link</option>
                            <option value="3">Only Me</option> 
                        </select>
                    </div>
                    <div class="form-group col-sm-8" style="color: red"><?php echo form_error('video_access_level'); ?>  </div>

                    <div class="form-group col-sm-8">
                        <label for="video_permissions">Video Permission</label><span class="required" style="color: red"> * </span><br>
                        <input type="radio"       
                               data-errormessage-value-missing="Video Permission is required!" 
                               class="validate[required] text-input"
                               name="video_permissions" id="status" value="1"  />Yes
                        <input type="radio" name="video_permissions" id="status" value="0" />No
                    </div>
                    <div class="form-group col-sm-8" style="color: red"><?php echo form_error('video_permissions'); ?>  </div>


                    <div class="form-group col-sm-8">
                        <label for="video_language">Video Language</label><span class="required" style="color: red"> * </span>
                        <select data-errormessage-value-missing="Video Language is required!" 
                                class="form-control validate[required] text-input"
                                id="video_language"  name="video_language" >
                            <option value="">--Select Video Language--</option>
                            <option value="Bangla">Bangla</option>
                            <option value="English">English</option>
                        </select>
                    </div>

                    <div class="form-group col-sm-8" style="color: red"><?php echo form_error('video_language'); ?>  </div>


                    <div class="checkbox col-sm-6" >
                        <button type="submit" id="submit" class="btn btn-default">Submit</button>
                        <button type="reset" class="btn btn-default">Reset</button>
                    </div>
                </div>

            </form>
        </div>
    </div>
</div>

<script type="text/javascript">
    document.forms['video'].elements['video_language'].value = '<?php echo set_value('video_language'); ?>';
    document.forms['video'].elements['video_access_level'].value = '<?php echo set_value('video_access_level'); ?>';
    document.forms['video'].elements['group_type'].value = '<?php echo set_value('group_type'); ?>';
    document.forms['video'].elements['video_status'].value = '<?php echo set_value('video_status'); ?>';
    document.forms['video'].elements['video_permissions'].value = '<?php echo set_value('video_permissions'); ?>';
    document.forms['video'].elements['video_work_files'].value = '<?php echo set_value('video_work_files'); ?>';
</script>