<?php
$_SESSION['upload_dir'] = '/source/' . $this->session->userdata('person_url') . '/';
$_SESSION['current_path'] = '../source/' . $this->session->userdata('person_url') . '/';
$person_id = $this->session->userdata('person_id');
$days = array('Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday');
?>
<div class="col-sm-10">
    <div class="row gray">
        <div class="course-detail-tab margin-zero ">
            <h3 style="padding-left: 10px">Add Course</h3>

            <div id="my-tab-content" class="tab-content">
                <!-- add_course_info tab-->
                <div class="tab-pane active" id="add_course_info">
                    <div class="tab-content panel-body">
                        <div class="col-sm-12  "><br></div>
                        <div class="col-sm-12">
                            <?php
                            //
//                            echo validation_errors();
                            $url = 'admin/add-course';
                            echo form_open_multipart($url, 'class="cmxform" id="formID1" name="add_course_form" onsubmit="return checkAddCourse()" ');
                            ?>
                            <div class="form-group col-sm-12">
                                <div class="form-group col-sm-10">
                                    <div class="input-group">
                                        <input  type="text" 
                                                data-errormessage-value-missing="Course Name is required!"
                                                class="form-control validate[required]" 
                                                id="course_name" 
                                                name="course_name"
                                                placeholder="Please type Course name"  
                                                value="<?php echo set_value('course_name'); ?>">
                                        <span class="input-group-addon" id="basic-addon1" title="Please type Course name "><i class="fa fa-book"></i></span>
                                    </div>
                                    <span style="color: red;" id="course_name_error" ><?php echo form_error('course_name'); ?></span>
                                </div>
                            </div>




                            <div class="form-group col-sm-12">
                                <div class="form-group col-sm-5">
                                    <div class="input-group ">
                                        <select data-errormessage-value-missing="Category is required!"  
                                                class="form-control" 
                                                name="menu_id" 
                                                id="menu_id">
                                            <option value="">Select Menu</option>
                                            <?php
                                            foreach ($all_menu as $menu_value) {
                                                echo '<option value="' . $menu_value->menu_id . '">' . $menu_value->menu_name . '</option>';
                                            }
                                            ?>
                                        </select>
                                        <span class="input-group-addon" id="basic-addon1" title="Please Select Menu"><i class="fa fa-book"></i></span>
                                    </div>
                                    <script>
                                        documentID('menu_id').value = '<?php echo set_value('menu_id'); ?>';
                                    </script>
                                </div>





                                <div class="form-group col-sm-5">
                                    <div class="input-group">
                                        <input  type="text" 
                                                data-errormessage-value-missing="Course URL is required!"
                                                class="form-control validate[required, custom[urlSpecialCaracter], custom[spaceFunction], custom[urlExistence], custom[noCapital], custom[checkUrlHypen], custom[checkUrlHypenLast]]" 
                                                id="course_url" 
                                                name="course_url"
                                                placeholder="Please type Course URL"  
                                                value="<?php echo set_value('course_url'); ?>">
                                        <input type="hidden" name="url_exist" id="url_exist" value="">
                                        <input type="hidden" id="checkCourseUrl" value="<?php echo base_url() . 'super_admin_course/check_course_url' ?>">
                                        <input type="hidden" id="makeNewCourseUrl" value="<?php echo base_url() . 'super_admin_course/make_new_course_url' ?>">
                                        <span class="input-group-addon" id="basic-addon1" title="Please type Course URL "><i class="fa fa-link"></i></span>
                                    </div>
                                    <span id="course_url_error" style="color: red;"><?php echo form_error('course_url'); ?></span>
                                </div>
                            </div>






                            <div class="form-group col-sm-12">
                                <div class="form-group col-sm-5">
                                    <div class="input-group">
                                        <select data-errormessage-value-missing="Parent Topic is required!"  
                                                class="form-control  validate[required]" 
                                                name="parent_topic_id" 
                                                id="parent_topic_id"
                                                onchange="getParentTopic(this.value, '<?php echo base_url() . 'admin/view-child-topic' ?>', '')">
                                            <option value="">Select Parent Topic</option>
                                            <?php
                                            foreach ($parent_topic as $topic_value) {
                                                echo '<option value="' . $topic_value->topic_id . '">' . $topic_value->topic_name . '</option>';
                                            }
                                            ?>
                                        </select>
                                        <span class="input-group-addon" id="basic-addon1" title="Please Select Parent Topic"><i class="fa fa-book"></i></span>
                                    </div>
                                    <span style="color: red;" id="parent_topic_id_error"><?php echo form_error('parent_topic_id'); ?></span>
                                    <script>
                                        documentID('parent_topic_id').value = '<?php echo set_value('parent_topic_id'); ?>';
                                    </script>
                                </div>




                                <div class="form-group col-sm-5">
                                    <div class="input-group">
                                        <select data-errormessage-value-missing="Topic is required!"  
                                                class="form-control  validate[required]" 
                                                name="topic_id" 
                                                id="topic_id">
                                            <option value="">Select Topic</option>

                                        </select>
                                        <span class="input-group-addon" id="basic-addon1" title="Please Select Topic"><i class="fa fa-book"></i></span>
                                    </div>
                                    <span style="color: red;" id="topic_id_error"><?php echo form_error('topic_id'); ?></span>
                                </div>
                            </div>


                            <div class="form-group col-sm-12">
                                <div class="form-group col-sm-5">
                                    <div class="input-group">
                                        <select data-errormessage-value-missing="Resource Person is required!"  
                                                class="form-control validate[required]" 
                                                name="resource_person_id" 
                                                id="resource_person_id">
                                            <option value="">Select resource person</option>
                                            <?php
                                            foreach ($resource_persons as $resource_persons_value) {
                                                echo '<option value="' . $resource_persons_value->resource_person_id . '">' . $resource_persons_value->person_first_name . ' ' . $resource_persons_value->person_last_name . '</option>';
                                            }
                                            ?>
                                        </select>
                                        <span class="input-group-addon" id="basic-addon1" title="Please select resource person"><i class="fa fa-user"></i></span>
                                    </div>
                                    <span id="resource_person_id_error" style="color: red;"><?php echo form_error('resource_person_id'); ?></span>
                                    <script>
                                        documentID('resource_person_id').value = '<?php echo set_value('resource_person_id'); ?>';
                                    </script>
                                </div>


                                <div class="form-group col-sm-5">
                                    <div class="input-group">
                                        <select data-errormessage-value-missing="Course level is required!"  
                                                class="form-control validate[required]" 
                                                name="course_level" 
                                                id="course_level">
                                            <option value="">Select course level</option>
                                            <option value="0">Any</option>
                                            <option value="1">Basic</option>
                                            <option value="2">Intermediate</option>
                                            <option value="3">Advance</option>
                                        </select>
                                        <span class="input-group-addon" id="basic-addon1" title="Please select Course Level "><i class="fa fa-align-center"></i></span>
                                    </div>
                                    <span id="course_level_error" style="color: red;"><?php echo form_error('course_level'); ?></span>
                                    <script>
                                        documentID('course_level').value = '<?php echo set_value('course_level'); ?>';
                                    </script>
                                </div>
                            </div>




                            <div class="form-group col-sm-12">
                                <div class="form-group col-sm-5">
                                    <div class="input-group">
                                        <input type="text" 
                                               class="form-control validate[required, custom[integer], custom[nonZeroValue], custom[numberOfClasses]]"
                                               id="number_of_classes"
                                               name="number_of_classes"
                                               oninput="getTotalClassHour()"
                                               placeholder="Please type Number of Classes"
                                               value="<?php echo set_value('number_of_classes'); ?>"
                                               aria-describedby="basic-addon1">
                                        <span class="input-group-addon" id="basic-addon1" title="Please type Number of Classes"><i class="fa fa-institution"></i></span>
                                    </div>
                                    <span style="color: red;" id="number_of_classes_error"><?php echo form_error('number_of_classes'); ?></span>
                                </div>


                                <div class="form-group col-sm-5">
                                    <div class="input-group">
                                        <input type="text" 
                                               class="form-control validate[required, custom[integer], custom[nonZeroValue], custom[numberOfClassesMinute]]"
                                               id="class_hour_per_day"
                                               name="class_hour_per_day"
                                               oninput="getTotalClassHour()"
                                               value="<?php echo set_value('class_hour_per_day'); ?>"
                                               placeholder="Please type per day class minute"
                                               aria-describedby="basic-addon1">
                                        <span class="input-group-addon" id="basic-addon1" title="Please type per day class hour"><i class="fa fa-clock-o"></i></span>
                                    </div>
                                    <span style="color: red;" id="class_hour_per_day_error"><?php echo form_error('class_hour_per_day'); ?></span>
                                </div>
                            </div>




                            <div class="form-group col-sm-12">
                                <div class="form-group col-sm-5">
                                    <div class="input-group">
                                        <input type="text" 
                                               class="form-control"
                                               id="course_author"
                                               name="course_author"
                                               value="<?php echo set_value('course_author'); ?>"
                                               placeholder="Please Type Course Author" 
                                               aria-describedby="basic-addon1">
                                        <span class="input-group-addon" id="basic-addon1" title="Please Type Course Author"><i class="fa fa-user"></i></span>
                                    </div>
                                    <span style="color: red;"><?php echo form_error('course_author'); ?></span>
                                </div>


                                <div class="form-group col-sm-5">
                                    <span >
                                        Total Class Hour : <span id="total_class_hour"></span>
                                    </span>
                                    <input type="hidden" id="total_class_hour_value" value="">
                                </div>
                            </div>




                            <div class="form-group col-sm-12">
                                <div class="form-group col-sm-5">
                                    <div class='input-group' id='datetimepicker5'>
                                        <input type='text' 
                                               class="form-control validate[custom[mindate], custom[courseFinishedDate]] text-input"
                                               id="course_start_date"
                                               name="course_start_date"
                                               value="<?php echo set_value('course_start_date'); ?>"
                                               placeholder="Course Start date"/>
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-calendar" title="Course Start date"></span><br>
                                        </span>
                                    </div>
                                    <span id="course_start_date_error" style="color: red;"><?php echo form_error('course_start_date'); ?></span>

                                </div>



                                <div class="form-group col-sm-5">
                                    <div class='input-group' id='datetimepicker3'>
                                        <input type='text' 
                                               class="form-control"
                                               id="class_time" 
                                               name="class_time"
                                               value="<?php echo set_value('class_time'); ?>"
                                               placeholder="Class Time" />
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-time" title="Class Time"></span>
                                        </span>
                                    </div>
                                </div>

                                <script type="text/javascript">
                                    $(function () {
                                        $('#datetimepicker3').datetimepicker({
                                            format: 'LT'
                                        });
                                    });
                                </script>
                            </div>


                            <div class="form-group col-sm-12">
                                <div class="form-group col-sm-5">
                                    <div class='input-group' id='datetimepicker6'>
                                        <input type='text' 
                                               class="form-control validate[custom[courseFinishedDate], custom[compareStartRegDate]]"
                                               id="course_finished_date"
                                               name="course_finished_date"
                                               value="<?php echo set_value('course_finished_date'); ?>"
                                               placeholder=" Course Finished Date" />
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-calendar" title="Course Finished Date"></span>
                                        </span>
                                    </div>
                                    <span style="color: red;"><?php echo form_error('course_finished_date'); ?></span>
                                </div>

                                <script type="text/javascript">
                                    $(function () {
                                        $('#datetimepicker6').datetimepicker({
                                            viewMode: 'years',
                                            format: 'DD/MM/YYYY'

                                        });
                                    });
                                </script>

                                <div class="form-group col-sm-5">
                                    <div class='input-group' id='datetimepicker1'>
                                        <input type='text' 
                                               class="form-control validate[custom[mindate], custom[compareStartRegDate]]"
                                               id="last_date_of_registration" 
                                               name="last_date_of_registration"
                                               value="<?php echo set_value('last_date_of_registration'); ?>"
                                               placeholder=" Last Date of Registration" />
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-calendar" title="Last Date of Registration"></span>
                                        </span>
                                    </div>
                                    <span style="color: red;"><?php echo form_error('last_date_of_registration'); ?></span>

                                    <script type="text/javascript">
                                        $(function () {
                                            $('#datetimepicker1').datetimepicker({
                                                viewMode: 'years',
                                                format: 'DD/MM/YYYY'

                                            });
                                        });</script>

                                </div>
                            </div>





                            <?php
                            $course_days = $this->input->post('course_days', TRUE);
                            $course_meta_keywords = $this->input->post('course_meta_keywords', TRUE);
                            ?>

                            <div class="form-group col-sm-12">
                                <div class="form-group col-sm-10">
                                    <input class="col-sm-12"
                                           type="hidden" name="to_address" id="to_address" value="" >
                                    <div class="col-sm-12 padding-zero">
                                        <select name="course_days[]"  
                                                id="course_days"
                                                data-errormessage-value-missing="course_days is is Required!"
                                                class="tokenize-sample validate[]"
                                                title="" 
                                                multiple="multiple" style="margin: 0px; padding: 0px; border: 0px; display: none;">
                                                    <?php
                                                    foreach ($days as $value) {
                                                        ?>
                                                <option value="<?php echo $value; ?>"
                                                <?php
                                                if ($course_days) {
                                                    if (in_array($value, $course_days)) {
                                                        echo 'Selected';
                                                    }
                                                }
                                                ?> ><?php echo $value; ?></option>
                                                        <?php
                                                    }
                                                    ?>
                                        </select>
                                    </div>
                                    <script type="text/javascript">
                                        $('select#course_days').tokenize({placeholder: '<span style="font-size:14px;">Please Type Course Days</span>'});
                                    </script>
                                    <span style="color: red;"><?php echo form_error('course_days'); ?></span>
                                </div>
                            </div>



                            <div class="form-group col-sm-12">
                                <div class="form-group col-sm-10">
                                    <div class="input-group">
                                        <input type="text"
                                               id="course_meta_title"
                                               name="course_meta_title"
                                               class="form-control" 
                                               placeholder="Please Type Course Meta Title"
                                               value="<?php echo set_value('course_meta_title'); ?>"
                                               aria-describedby="basic-addon1">
                                        <span class="input-group-addon" id="basic-addon1" title="Please Type Course Meta Title"><i class="fa fa-book"></i></span>
                                    </div>
                                    <span id="course_meta_title_error" style="color: red;"><?php echo form_error('course_meta_title'); ?></span>
                                </div>
                            </div>





                            <div class="form-group col-sm-12">
                                <div class="form-group col-sm-10">
                                    <input class="col-sm-12"
                                           type="hidden" name="to_address" id="to_address" value="" >
                                    <div class="col-sm-12 padding-zero">
                                        <select name="course_meta_keywords[]"  
                                                id="course_meta_keywords" 
                                                data-errormessage-value-missing="Course Meta Keywords is is Required!"
                                                class="tokenize-sample validate[]"
                                                title="" 
                                                multiple="multiple" style="margin: 0px; padding: 0px; border: 0px; display: none;">
                                                    <?php
                                                    if (isset($course_meta_keywords)) {
                                                        foreach ($course_meta_keywords as $value1) {
                                                            ?>
                                                    <option value="<?php echo $value1; ?>" selected ><?php echo $value1; ?></option>
                                                    <?php
                                                }
                                            }
                                            ?>
                                        </select>
                                    </div>
                                    <script type="text/javascript">
                                        $('select#course_meta_keywords').tokenize({placeholder: "Please Type Course Meta Keywords"});
                                    </script>
                                    <span style="color: red;"><?php echo form_error('course_meta_keywords'); ?></span>
                                </div>
                            </div>





                            <div class="form-group col-sm-12">
                                <div class="form-group col-sm-12">
                                    <div class="form-group col-sm-10">
                                        <div class="input-group text-left">
                                            <label>Course Meta Description </label>
                                            <textarea   class="form-control" 
                                                        name="course_meta_description"
                                                        rows="4" cols="55"><?php echo set_value('course_meta_description'); ?></textarea>
                                        </div>
                                    </div>
                                </div>




                                <div class="form-group col-sm-12">
                                    <div class="form-group col-sm-10">
                                        <div class="input-group text-left">
                                            <label>Course Training Objectives </label>
                                            <textarea   class="form-control  resoulation1280 " 
                                                        name="course_training_objectives"
                                                        rows="4"   ><?php echo set_value('course_training_objectives'); ?></textarea>
                                        </div>
                                    </div>
                                </div>



                                <div class="form-group col-sm-12">
                                    <div class="form-group col-sm-10">
                                        <div class="input-group text-left">
                                            <label>Course Outline</label>
                                            <textarea   class="form-control  resoulation1280 " 
                                                        name="course_training_outline"
                                                        rows="4"   ><?php echo set_value('course_training_outline'); ?></textarea>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-12"><br></div>



                                <div class="form-group col-sm-12">
                                    <div class="form-group col-sm-5">
                                        <div class="input-group">
                                            <select class="form-control validate[required]"
                                                    id="course_language"
                                                    name="course_language" >
                                                <option value=""> -Select Course Language- </option>
                                                <option value="1">English</option>
                                                <option value="2">বাংলা (Bengali)</option>
                                            </select>
                                            <script>
                                                documentID('course_language').value = '<?php echo set_value('course_language'); ?>';</script>
                                            <span class="input-group-addon" id="basic-addon1" title="Please select Course Language"><i class="fa fa-language"></i></span>
                                        </div>
                                        <span id="course_language_error" style="color: red;"><?php echo form_error('course_language'); ?></span>
                                    </div>




                                    <div class="form-group col-sm-5">
                                        <div class="input-group">
                                            <select class="form-control validate[required]"
                                                    onchange="getCourseAccessLevel(this.value)"
                                                    name="course_access_level" 
                                                    id="course_access_level" >
                                                <option value="">Select Access Level</option>
                                                <option value="1">Public</option>
                                                <option value="2">TalhaTraining user</option>
                                            </select>
                                            <span class="input-group-addon" id="basic-addon1" title="Please select  Access Level"><i class="fa fa-user"></i></span>
                                            <script>
                                                documentID('course_access_level').value = '<?php echo set_value('course_access_level'); ?>';</script>
                                        </div>
                                        <span id="course_access_level_error" style="color: red;"><?php echo form_error('course_access_level'); ?></span>
                                    </div>
                                </div>




                                <div class="form-group col-sm-12"><br></div>
                                <div class="form-group col-sm-12">
                                    <div class="form-group col-sm-5">
                                        <div class="input-group">
                                            <input type="text"
                                                   id="course_rating"
                                                   name="course_rating"
                                                   class="form-control validate[custom[checkRating]]" 
                                                   placeholder="Please Type Course Reating"
                                                   value="<?php echo set_value('course_rating'); ?>"
                                                   aria-describedby="basic-addon1">
                                            <span class="input-group-addon" id="basic-addon1" title="Please Type Course Reating"><i class="fa fa-star"></i></span>
                                        </div>
                                        <span id="course_rating_error" style="color: red;"><?php echo form_error('course_rating'); ?></span>
                                    </div>





                                    <div class="form-group col-sm-5">
                                        <label class="col-sm-3 text-left padding-zero" for="course_type"> Course Type : &nbsp;&nbsp;</label>
                                        <div class="radio radio-success col-sm-9 margin-zero " >&nbsp;&nbsp;
                                            <input onclick="CoursePrice(this.value)" 
                                                   type="radio"
                                                   data-errormessage-value-missing="Please Select Course Type" 
                                                   class="validate[required]" 
                                                   name="course_type" 
                                                   id="Course_paid" 
                                                   value="1">
                                            <label for="Paid"> Paid</label>
                                            <span style="margin-right: 30px"></span>
                                            <input onclick="CoursePrice(this.value)" 
                                                   type="radio" 
                                                   data-errormessage-value-missing="Please Select Course Type" 
                                                   class="validate[required]" 
                                                   name="course_type" 
                                                   id="Course_free" value="2">
                                            <label for="Free">Call for Price</label>
                                        </div>
                                        <script>
                                            document.forms['add_course_form'].elements['course_type'].value = '<?php echo set_value('course_type'); ?>';</script>
                                        <span style="color: red;"><?php echo form_error('course_type'); ?></span>
                                    </div>
                                </div>





                                <div class="form-group col-sm-12" id="Course_Price" style="display: none">
                                    <div class="form-group col-sm-5">
                                        <div class="input-group">
                                            <select data-errormessage-value-missing="Please Select Course Price Currency " 
                                                    class="form-control validate[required]" 
                                                    name="course_price_currency" 
                                                    id="course_price_currency" >
                                                <option value="">Select Price Currency</option>
                                                <option value="1">BDT</option>
                                                <option value="2">USD</option>
                                            </select>
                                            <span class="input-group-addon" id="basic-addon1" title="Please select  Access Level"><i class="fa fa-user"></i></span>
                                        </div>
                                        <script>
                                            document.forms['add_course_form'].elements['course_price_currency'].value = '<?php echo set_value('course_price_currency'); ?>';</script>
                                        <span style="color: red;"><?php echo form_error('course_price_currency'); ?></span>
                                    </div>



                                    <div class="form-group col-sm-5" >
                                        <div class="input-group">
                                            <input type="number"
                                                   id="course_price"
                                                   name="course_price"
                                                   class="form-control validate[required, custom[integer], custom[nonZeroValue]]" 
                                                   placeholder="Please Type Course Price"
                                                   value="<?php echo set_value('course_price'); ?>"
                                                   aria-describedby="basic-addon1">
                                            <span class="input-group-addon" id="basic-addon1" title="Please Type Course Price"><i class="fa fa-dollar"></i></span>
                                        </div>
                                        <span style="color: red;"><?php echo form_error('course_price'); ?></span>
                                    </div>
                                </div>



                                <div class="form-group col-sm-10"></div>
                                <div class="form-group col-sm-10">
                                    <div class="form-group col-sm-10">
                                        <label class="col-sm-1 text-left padding-zero" for="course_status"> Status : &nbsp;</label>
                                        <div class="radio radio-success col-sm-11 margin-zero" >
                                            <input type="radio"
                                                   data-errormessage-value-missing="Please Select Course Status" 
                                                   class="validate[required]" 
                                                   name="course_status" 
                                                   id="published" 
                                                   value="1">
                                            <label for="published">Active</label>
                                            <span style="margin-right: 30px"></span>
                                            <input type="radio" 
                                                   data-errormessage-value-missing="Please Select Course Status" 
                                                   class="validate[required]" 
                                                   name="course_status" 
                                                   id="unpublished" 
                                                   value="6">
                                            <label for="unpublishded">Inactive</label>
                                            <span style="margin-right: 30px"></span>
                                            <input type="radio"
                                                   data-errormessage-value-missing="Please Select Course Status" 
                                                   class="validate[required]" 
                                                   name="course_status" 
                                                   id="archived" 
                                                   value="2">
                                            <label for="archived">Archived</label>
                                            <span style="margin-right: 30px"></span>
                                            <input type="radio" 
                                                   data-errormessage-value-missing="Please Select Course Status" 
                                                   class="validate[required]" 
                                                   name="course_status" 
                                                   id="pending" 
                                                   value="3">
                                            <label for="pending">Pending</label>
                                            <span style="margin-right: 30px"></span>
                                            <input type="radio" 
                                                   data-errormessage-value-missing="Please Select Course Status" 
                                                   class="validate[required]" 
                                                   name="course_status" 
                                                   id="approved" 
                                                   value="4">
                                            <label for="approved">Approved</label>
                                            <span style="margin-right: 30px"></span>
                                            <input type="radio" 
                                                   data-errormessage-value-missing="Please Select Course Status" 
                                                   class="validate[required]" 
                                                   name="course_status" 
                                                   id="draft" 
                                                   value="5">
                                            <label for="draft">Draft</label>
                                            <script>
                                                document.forms['add_course_form'].elements['course_status'].value = '<?php echo set_value('course_status'); ?>';</script>
                                            <span style="color: red;"><?php echo form_error('course_status'); ?></span>
                                        </div>
                                    </div>




                                    <div class="col-sm-12">
                                        <div class="form-group col-sm-6 padding-zero">
                                            <div class="checkbox checkbox-success">
                                                <input type="checkbox"
                                                       id="course_resource_person_edit" 
                                                       class="styled"
                                                       name="course_resource_person_edit"
                                                       value="1" >
                                                <label for="course_resource_person_edit">Resource Person Edit Allow?</label>
                                            </div>
                                        </div>


                                        <div class="form-group col-sm-6 padding-zero">
                                            <div class="checkbox checkbox-success">
                                                <input type="checkbox"
                                                       id="course_resource_person_view_invoice" 
                                                       class="styled"
                                                       name="course_resource_person_view_invoice"
                                                       value="1" >
                                                <label for="course_resource_person_view_invoice">Resource Person View Invoice?</label>
                                            </div>
                                        </div>
                                    </div>





                                    <div class="col-sm-12">
                                        <div class="form-group col-sm-6 padding-zero">
                                            <div class="checkbox checkbox-success">
                                                <input type="checkbox"
                                                       id="upcoming_course"
                                                       name="upcoming_course"
                                                       class="styled" 
                                                       value="1" >
                                                <label for="course_up_coming">Course Up-Coming ?</label>

                                            </div>
                                        </div>

                                        <div class="form-group col-sm-6 padding-zero">
                                            <div class="checkbox checkbox-success">
                                                <input type="checkbox"
                                                       id="course_resource_person_pay_invoice" 
                                                       class="styled"
                                                       name="course_resource_person_pay_invoice"
                                                       value="1" >
                                                <label for="course_resource_person_pay_invoice">Resource Person Pay Invoice?</label>
                                            </div>
                                        </div>
                                    </div>





                                    <div class="form-group col-sm-12">
                                        <div id="submit_status"></div>
                                        <div class="checkbox col-sm-12">
                                            <center><button type="submit" id="submit" class="btn btn-default" >Add Course</button></center>
                                        </div>
                                    </div>

                                </div>
                                <?php echo form_close(); ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>



    <br>
    <div class="row gray">
        <div class="col-sm-12 ">
            <label><a href="<?php echo base_url(); ?>super-admin">Dashboard</a> ->> <a href="<?php echo base_url(); ?>admin/manage-course">Manage Course</a>->>Create Course</label>
        </div>
    </div>


</div>

<script>
    '<?php if (set_value('course_resource_person_edit')) { ?>';
        document.forms['add_course_form'].elements['course_resource_person_edit'].checked = true;
        '<?php } ?>';

    '<?php if (set_value('course_resource_person_view_invoice')) { ?>';
        document.forms['add_course_form'].elements['course_resource_person_view_invoice'].checked = true;
        '<?php } ?>';

    '<?php if (set_value('course_resource_person_pay_invoice')) { ?>';
        document.forms['add_course_form'].elements['course_resource_person_pay_invoice'].checked = true;
        '<?php } ?>';

    '<?php if (set_value('upcoming_course')) { ?>';
        document.forms['add_course_form'].elements['upcoming_course'].checked = true;
        '<?php } ?>';
</script>

<!--all JS function in this page-->
<script type="text/javascript" src="<?php echo base_url() ?>back_end_resource/course/course.js">
</script>
<script>
    getTotalClassHour();

    '<?php if (set_value('parent_topic_id') != '') { ?>';
        getParentTopic(<?php echo set_value('parent_topic_id'); ?>, '<?php echo base_url() . 'admin/view-child-topic' ?>', '<?php echo set_value('topic_id'); ?>');
        '<?php } ?>';

    CoursePrice('<?php echo set_value('course_type'); ?>');
</script>

