<div class="col-sm-10">
    <div class="row ">
        <div class="col-sm-12 ">
            <div class="col-sm-12 gray_ttc">
                <div class="col-sm-12 ">
                    <div class="col-sm-12">
                        <h3>Edit Schedule Class</h3>
                        <hr><br>
                        <nav class="text-justify">
                            <center>
                                <div class="col-sm-12" style="padding: 0">
                                    <span class="clo-sm-6" title="Course Details" style="padding: 0">
                                        <span style="cursor:default;">
                                            <span class="number badge" style="background-color: green">1</span>
                                            <span class="text-left label" style="color: #000;font-size: 16px;font-weight: normal">Schedule Class</span>
                                            <span class="nav-arrow" id="cborder" style="margin-right: 4px"><img src="<?php echo base_url()?>image/border.jpg"></span>
                                        </span>
                                    </span>

                                    <span class="clo-sm-6" title="Review And Publish" style="padding: 0">
                                        <span style="cursor:default;">
                                            <span class="number badge" style="background-color: gray">3</span>
                                            <span class="text-left label" style="color: #000;font-size: 16px;font-weight: normal">Review and Publish</span>
                                        </span>
                                    </span>
                                </div>
                            </center>
                        </nav>
                        <div class="col-sm-12"><br></div>
                    </div>

                    <div class="col-sm-12"><br></div>
                    <div class="col-sm-12">
                        <?php
//                        echo '<pre>';
//                        print_r($course_category);
//                        echo validation_errors(); //formID2
                        $url = 'edit-classroom-schedule/' . $classroom_info->url;
                        echo form_open($url, 'class="" id="formID2" name="scheduleClassroom" onsubmit="return check_form();"');
                        ?>

                        <div class="col-sm-12">
                            <div class="col-sm-10">
                                <div class="input-group">
                                    <input type="text"
                                           data-errormessage-value-missing="Class Title is Required!"
                                           class="form-control validate[required] text-input"
                                           name="classroom_title" 
                                           id="classroom_title"
                                           placeholder="Type your Class Title.." aria-describedby="basic-addon1"
                                           value="<?php
                                           if (set_value('classroom_title')) {
                                               echo set_value('classroom_title');
                                           } else {
                                               echo $classroom_info->classroom_title;
                                           }
                                           ?>">
                                    <span class="input-group-addon" id="basic-addon1" title="Type your Class Title"><i class="fa fa-institution"></i></span>
                                </div>
                                <span id="classroom_title_message" style="color: red"><?php echo form_error('classroom_title'); ?></span>
                            </div>



                            <div class="col-sm-12"><br><br></div>
                            <div class="col-sm-6" id="add_course_button" style="display: block;">
                                <div class="input-group">
                                    <span class="input-group-addon" id="basic-addon1">
                                        <a href="" data-toggle="modal" data-target="#add_course"><i class="fa fa-plus-circle pull-left" >Add Course</i></a>
                                    </span>
                                </div>
                            </div>

                            <div class="col-sm-12"><br></div>
                            <div class="col-sm-12" id="submitted_course_name">
                                <?php
                                if (set_value('hidden_course_name')) {
                                    echo set_value('hidden_course_name');
                                } else {
                                    echo '<b>Course Name : </b>' . $classroom_info->course_name;
                                }
                                ?>
                            </div>
                            <input type="hidden" id="hidden_course_id" name="hidden_course_id" value="<?php
                            if (set_value('hidden_course_id')) {
                                echo set_value('hidden_course_id');
                            } else {
                                echo $classroom_info->course_id;
                            }
                            ?>">
                            <input type="hidden" id="hidden_course_name" name="hidden_course_name" value="<?php
                            if (set_value('hidden_course_name')) {
                                echo set_value('hidden_course_name');
                            } else {
                                echo $classroom_info->course_name;
                            }
                            ?>">
                            <div class="col-sm-12" id="course_id_error" style="color: red;"><?php echo form_error('hidden_course_id'); ?></div>
                            <div class="col-sm-12"><br></div>



                            <div class="col-sm-6">
                                <div class="form-group">
                                    <div class="input-group " id="datetimepicker1">
                                        <input type="text"
                                               data-errormessage-value-missing="Class start Date is Required!"
                                               class="form-control validate[required,custom[mindate]] text-input"
                                               name="class_start_date" 
                                               id="class_start_date"
                                               aria-describedby="basic-addon1"
                                               value="<?php
                                               if (set_value('class_start_date')) {
                                                   echo set_value('class_start_date');
                                               } else {
                                                   $date = strtotime($classroom_info->class_start_time);
                                                   echo date('Y-m-d', $date);
                                               }
                                               ?>"
                                               placeholder="yyyy-mm-dd"
                                               onblur="checkClassStartDate(this.value, '<?php echo base_url() . 'check-class-start-date' ?>', '<?php echo $classroom_info->classroom_id ?>');">
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-calendar" title="Please Select Class Start Date"></span>
                                        </span>
                                    </div>
                                    <span id="class_start_date_error" style="color: red"><?php echo form_error('class_start_date'); ?></span>
                                </div>
                            </div>

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




                            <div class="col-sm-12"><br></div>
                            <div class="col-sm-12">
                                <div class="col-sm-6" style="padding: 0">
                                    <div class='col-sm-5' style="padding: 0">
                                        <div class="form-group">
                                            <div class='input-group date' id='datetimepicker3'>
                                                <input type='text' data-errormessage-value-missing="Class start Time is Required!"
                                                       class="form-control validate[required, custom[nowandthen2]] text-input"
                                                       name="class_start_time" 
                                                       id="class_start_time"
                                                       onblur="checkClassStartTime(this.value, '<?php echo base_url() . 'check-classroom-start-time' ?>');"
                                                       value="<?php
                                                       if (set_value('class_start_time')) {
                                                           echo set_value('class_start_time');
                                                       } else {
                                                           $date = strtotime($classroom_info->class_start_time);
                                                           echo date('H:i a', $date);
                                                       }
                                                       ?>" />
                                                <span class="input-group-addon">
                                                    <span class="glyphicon glyphicon-time"></span>
                                                </span>
                                            </div>
                                            <label>[Class Start Time]</label>
                                        </div>
                                    </div>





                                    <div class="col-sm-1">&nbsp;&nbsp;</div>
                                    <div class='col-sm-5' style="padding: 0">
                                        <div class="form-group">
                                            <div class='input-group'>
                                                <input type='text' data-errormessage-value-missing="Class Duration is Required!"
                                                       class="form-control validate[required, custom[classDuration]] text-input"
                                                       aria-describedby="basic-addon1"
                                                       name="class_duration" 
                                                       id="class_duration"
                                                       value="<?php
                                                       if (set_value('duration')) {
                                                           echo set_value('duration');
                                                       } else {
                                                           echo $classroom_info->class_duration;
                                                       }
                                                       ?>"
                                                       oninput="checkClassDuration(this.value,'<?php echo base_url() . 'check-classroom-duration' ?>','<?php echo $classroom_info->classroom_id ?>');"
                                                       maxlength="3"
                                                       placeholder="Class Duration"/>
                                            </div>
                                            <label>[in Minute]</label>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-6">
                                    <div class="col-sm-12 text-left" style="padding:0 ">  <label id="view_class_duration">
                                            <?php
                                            $date = strtotime($classroom_info->class_end_time);
                                            echo '<b>Class End Time</b> : ' . date('H:i:s a', $date);
                                            ?>
                                        </label></div>
                                    <div class="col-sm-12 text-left" style="padding:0 ">  <label id="class_start_time_error" style="color: red"><?php echo form_error('class_start_time'); ?></label></div>
                                    <div class="col-sm-12 text-left" style="padding:0 ">  <label id="class_duration_error" style="color: red"><?php echo form_error('class_duration'); ?></label></div>
                                </div>

                            </div>




                            <div class="col-sm-12"><br></div>
                            <div class="col-sm-12">
                                <div class="input-group">
                                    <textarea
                                        data-errormessage-value-missing="Classroom Instruction is Required!"
                                        class="form-control text-input"
                                        name="classroom_instruction" 
                                        id="classroom_instruction"
                                        rows="3"  cols="100" placeholder="Class Instruction" style="max-width:590px;max-height: 100px"><?php
                                            if (set_value('classroom_instruction')) {
                                                echo set_value('classroom_instruction');
                                            } else {
                                                echo $classroom_info->classroom_instruction;
                                            }
                                            ?></textarea>
                                </div>
                                <span id="classroom_instruction_error" style="color: red"><?php echo form_error('classroom_instruction'); ?></span>
                            </div>

                            <div class="col-sm-12"><br></div>
                            <div class="col-sm-4">
                                <div class="col-sm-12 text-left" style="padding-left:0">
                                    <label >Max attendees : <span id="attendees_number"><?php echo $feature_info->virtual_classroom_attendees_number; ?></span></label>
                                </div>
                            </div>
                            <div class="col-sm-6">
                                <div class="col-sm-12 text-left" style="padding-left:0">
                                    <label>Class type : <span id="virtual_classroom_type">
                                            <?php
                                            if ($feature_info->virtual_classroom_type == 1) {
                                                echo 'Live Broadcasting';
                                            } else if ($feature_info->virtual_classroom_type == 2) {
                                                echo 'Live Broadcasting and Recording';
                                            }
                                            ?>
                                        </span></label>
                                </div>
                            </div>


                            <div class="col-sm-12"><br><br></div>
                            <div class="form-group col-sm-4"></div>
                            <div class="form-group col-sm-4">
                                <input type="submit" 
                                       class="green-btn btn btn-default" 
                                       value=" Schedule classroom!">
                            </div>

                            <div class="form-group col-sm-4"></div>
                            <div class="col-sm-12"><br><br></div>
                            <div class="col-sm-12" id="required_message" style="color: red"></div>
                        </div>

                        <?php echo form_close(); ?>

                    </div>

                </div>

            </div>

            <div class="col-sm-12" ><br></div>
            <div class="col-sm-12 gray" >
                <div class="col-sm-12 " >
                    <label><a href="dashboard.html">Dashboard </a> ->> <a href="organization_schedule_class.html"> Add Schedule Class</a></label>
                </div>
            </div>

        </div>

    </div>

</div>


<!--add couse modal-->

<?php include 'modal/add_course.php'; ?>

<script type="text/javascript" src="<?php echo base_url()?>back_end_resource/classroom/classroom.js"></script>
<script>