        
        <style>
    .required{
        color: #bf5050;
       }
    
</style>
        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
                <div class="title_left">
                </div>
            </div>
            <div class="clearfix"></div>

            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>Edit Video Lecture</h2>
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
                    </ul>
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
<?php if ($this->session->flashdata('success')): ?>
<div class="alert alert-success">
<?php echo $this->session->flashdata('success'); ?>
</div>
<?php endif ?>
<?php if ($this->session->flashdata('error')): ?>
<div class="alert alert-danger">
<?php echo $this->session->flashdata('error'); ?>
</div>
<?php endif ?>
                    <form class="form-horizontal form-label-left" id="routePermit" action="<?php echo base_url();?>Syllabus/update_lecture" enctype="multipart/form-data" method="post">
                      <input type="hidden" name="edit_id" value="<?php echo $records['id'];?>">
                      
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="class">Class<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select id="class" class="form-control col-md-7 col-xs-12" name="class" required="required">
                            <option value=''>Select Class</option>
                            <?php
                            if(!empty($classes))
                            {
                                foreach($classes as $class){?>
                                     <option value='<?php echo $class['class_id'];?>' <?php if($class['class_id']==$records['class']){ echo "selected";}?>><?php echo $class['class_name'];?></option> 
                            <?php    }
                            }?>
                          </select>
                        </div>
                      </div>
                      
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="subject">Subject<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select id="subject" class="form-control col-md-7 col-xs-12" name="subject" required="required">
                            <option value=''>Select Subject</option>
                             <?php
                            if(!empty($subject))
                            {
                                foreach($subject as $sub){?>
                                    <option value='<?php echo $sub['id'];?>' <?php if($sub['id']==$records['subject']){ echo "selected";}?>><?php echo $sub['name'];?></option> 
                            <?php    }
                            }?>
                          </select>
                        </div>
                      </div>
                      
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="subject">Title<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="text" value="<?php echo $records['title'];?>" name="title" required class="form-control">
                        </div>
                      </div>
                      
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="subject">Url<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="text" name="link" value="<?php echo $records['link'];?>" required class="form-control">
                        </div>
                      </div>
                      
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="subject">Time (In minutes)<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="number" name="time" value="<?php echo $records['time'];?>" required class="form-control">
                        </div>
                      </div>
                      
                      <!--<div class="item form-group">-->
                      <!--  <label class="control-label col-md-3 col-sm-3 col-xs-12" for="subject">New File<span class="required"></span>-->
                      <!--  </label>-->
                      <!--  <div class="col-md-6 col-sm-6 col-xs-12">-->
                      <!--    <input type="file" id="pic" name="pic" class="form-control">-->
                      <!--  </div>-->
                      <!--</div>-->
                      
                       <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="subject">Date<span class="required"></span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="date" name="description" value="<?php echo $records['description'];?>" class="form-control">
                        </div>
                      </div>
                      
                      
                      <div class="ln_solid"></div>
                      <div class="form-group">
                        <div class="col-md-6 col-md-offset-3">
                          <button id="send" type="submit" class="btn btn-success pull-right">Submit</button>
                        </div>
                      </div>
                    </form>
                  </div>
                </div>
              </div>
          </div>
        </div>
        </div>
        <!-- /page content -->
   
        <div id='ajaxload' style='position:fixed;top:0;left:0;bottom:0; width:100%;height:100%;z-index:1000;background:rgba(2,132,130,0.5);display:none;'>
            <i class='fa fa-spinner fa-spin fa-4x' style='position: relative;top: 50%;left: 60%;margin-top: -50px;margin-left: -40px;'></i>
        </div>
        
    <!-- jQuery -->
    <script src="<?php echo base_url(); ?>assets/vendors/jquery/dist/jquery.min.js"></script>

    <!-- Custom JS -->
    <script src="<?php echo base_url(); ?>assets/js/main.js"></script>
    <!-- Bootstrap -->
    <script src="<?php echo base_url(); ?>assets/vendors/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="<?php echo base_url(); ?>assets/vendors/fastclick/lib/fastclick.js"></script>
    <!-- NProgress -->
    <script src="<?php echo base_url(); ?>assets/vendors/nprogress/nprogress.js"></script>
    <!-- Chart.js -->
    <script src="<?php echo base_url(); ?>assets/vendors/Chart.js/dist/Chart.min.js"></script>
    <!-- gauge.js -->
    <script src="<?php echo base_url(); ?>assets/vendors/gauge.js/dist/gauge.min.js"></script>
    <!-- bootstrap-progressbar -->
    <script src="<?php echo base_url(); ?>assets/vendors/bootstrap-progressbar/bootstrap-progressbar.min.js"></script>
    <!-- iCheck -->
    <script src="<?php echo base_url(); ?>assets/vendors/iCheck/icheck.min.js"></script>
    <!-- Skycons -->
    <script src="<?php echo base_url(); ?>assets/vendors/skycons/skycons.js"></script>
    <!-- Flot -->
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.pie.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.time.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.stack.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.resize.js"></script>
    <!-- Flot plugins -->
    <script src="<?php echo base_url(); ?>assets/js/flot/jquery.flot.orderBars.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/flot/date.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/flot/jquery.flot.spline.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/flot/curvedLines.js"></script>
    <!-- jVectorMap -->
    <script src="<?php echo base_url(); ?>assets/js/maps/jquery-jvectormap-2.0.3.min.js"></script>
    <!-- bootstrap-daterangepicker -->
    <script src="<?php echo base_url(); ?>assets/js/moment/moment.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/datepicker/daterangepicker.js"></script>
    
 <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/bootstrapValidator.js"></script>
<!-- Form Validator-->
  <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/bootstrapValidator.css"/>
  
  
  
 <script type="text/javascript">
    $(document).ready(function() {
        $('#routePermit')
            .on('init.form.bv', function(e, data) {
                //console.log(data);
            })
            .bootstrapValidator({
                message: 'This value is not valid',
                feedbackIcons: {
                    valid: 'glyphicon glyphicon-ok',
                    invalid: 'glyphicon glyphicon-remove',
                    validating: 'glyphicon glyphicon-refresh'
                },
                fields: {
                    password: {
                validators: {
                    identical: {
                        field: 'confirmPassword',
                        message: 'The password and its confirm are not the same'
                    }
                }
            },
            confirmPassword: {
                validators: {
                    identical: {
                        field: 'password',
                        message: 'The password and its confirm are not the same'
                    }
                }
            },
            lname: {
                        trigger:'change keyup',
                        validators: {
                             regexp: {
                                 regexp: /^[a-z\s]+$/i,
                                     message: 'The last name can consist of alphabetical characters and spaces only'
                              }
                        }
                    },
            username: {
                        trigger:'change keyup',
                        validators: {
                             regexp: {
                                 regexp: /^[a-z\s]+$/i,
                                     message: 'The full name can consist of alphabetical characters and spaces only'
                              }
                        }
                    },        
            fname: {
                        trigger:'change keyup',
                        validators: {
                            regexp: {
                                 regexp: /^[a-z\s]+$/i,
                                     message: 'The full name can consist of alphabetical characters and spaces only'
                              }
                        }
                    },
                    
            contact: {
                        validators: {
                            notEmpty: {
                                        message: 'The contact is required and cannot be empty'
                                },
                                        
                                    }
                                },

                    'phone[]': {
                      
                    trigger:'blur',
                validators: {
                    
                         stringLength: {
                            min: 13,
                            max: 13,
                            message: 'The phone numbe   r must be mobile number'
                        }
                }
            },
                
                   
                }
            });
    });
    
$("#zzz").click(function(){
   $('#routePermit').bootstrapValidator("resetForm",true);    
});

</script>
  
   <script src="<?php echo base_url()?>assets/select/js/select2.min.js"></script> 
    <script>
 
     $('#branch').select2({
    allowClear:true
    });
    </script>
   <script>
 
     $('#class').select2({
    allowClear:true
    });
    </script>
    
     <script>
 
     $('#subject').select2({
    allowClear:true
    });
    </script>
     
   
   
      
    <script>
        $(document).ready(function(){
            
            $(document).on("change","#class",function(){
                 var value = $(this).val();
                $.get("<?php echo base_url(); ?>load/fetch_subjets_list/"+value,{},function(d){
                    var pre = '<option value="">Select Subject</opiton>';
                    $("#subject").html(pre+d);  
                });
                
            });
            
        });
    </script>
          <script>
window.setTimeout(function() {
$(".alert").fadeTo(500, 0).slideUp(500, function(){
    $(this).remove(); 
});
}, 3000);
        </script>
  </body>
</html>