        <!-- 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>Update student leave information</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">

                    <form class="form-horizontal form-label-left" action="<?php echo $base_url;?>certificate/Update_leave_info" method="post">
                    <!--branch check-->
                         
                            <?php if($this->user_model->is_super()){ ?>
                              <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12 text-right" for="name">Branch <span class="text-danger">*</span>
                                </label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                  <select id="branch" class="form-control col-md-7 col-xs-12" name="branch" required="required" style="width:100%;">
                                    <option value=''>Select branch</option>
                                      <?php
                                            $branc = $this->db->select("name,id")->from("branch")->get()->result();
                                            foreach ($branc as $value) {
                                      ?>
                                    <option value="<?php echo $value->id; ?>"><?php echo $value->name?></option>
        
                                        <?php } ?>
                                  </select>
                                </div>
                              </div>
                              <?php  } ?>
                              <?php if(!$this->user_model->is_super()){ 
                                           $branch=$this->user_model->getbranch(); ?>
        	                                <input type="hidden" class="form-control" name="branch" id="branch" value="<?= $branch ?>">
                                        <?php } ?>
               
                         <!--branch-->


                    <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Student <span class="text-danger">*</span>
                        
                        <?php      $query=$query=$this->db->query("select * from student where id = $leave_info->std_id ");
             $student = $query->row();	 ?>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="text"   value="<?php echo $student->student_name?>" class="form-control" readonly  >
                          <input type="hidden" name="std_id" id="std_id" value="<?php echo $leave_info->std_id?>" class="form-control" readonly  >
                          <input type="hidden" name="id" id="id" value="<?php echo $leave_info->id?>" class="form-control" readonly  >
                           <input type="hidden" name="branch" id="id" value="<?php echo $leave_info->branch ?>" class="form-control" readonly  >
                        </div>
                      </div>

                   


                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Conduct <span class="text-danger">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select id="conduct" name="conduct" class="form-control" required>
                              <option value="">Select Conduct</option>
                            <option value="Excellent" <?php if ($leave_info->conduct=='Excellent') echo 'selected'; ?> >Excellent</option>
                            <option value="Good" <?php if ($leave_info->conduct=='Good') echo 'selected'; ?>> Good</option>
                            <option value="VeryGood" <?php if ($leave_info->conduct=='VeryGood') echo 'selected'; ?>>Very Good</option>
                            <option value="Bad" <?php if ($leave_info->conduct=='Bad') echo 'selected'; ?>>Bad</option>
                            <option value="VeryBad" <?php if ($leave_info->conduct=='VeryBad') echo 'selected'; ?>>Very Bad</option>
                            <option value="Poor" <?php if ($leave_info->conduct=='Poor') echo 'selected'; ?>>Poor</option>
                             
                          </select>
                        </div>
                      </div>

                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Progress <span class="text-danger">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select id="progress" name="progress" class="form-control" required>
                              <option value="">Select Progress</option>
                            <option value="Excellent" <?php if ($leave_info->progress=='Excellent') echo 'selected'; ?>>Excellent</option>
                            <option value="Good" <?php if ($leave_info->progress=='Good') echo 'selected'; ?>>Good</option>
                            <option value="VeryGood" <?php if ($leave_info->progress=='VeryGood') echo 'selected'; ?>>Very Good</option>
                            <option value="Bad" <?php if ($leave_info->progress=='Bad') echo 'selected'; ?>>Bad</option>
                            <option value="VeryBad" <?php if ($leave_info->progress=='VeryBad') echo 'selected'; ?>>Very Bad</option>
                            <option value="Poor" <?php if ($leave_info->progress=='Poor') echo 'selected'; ?>>Poor</option>
                             
                          </select>
                        </div>
                      </div>
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Class In Which Left <span class="text-danger">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                         
                             <select class="form-control" name="class_in_which_left" id="class_in_which_left" required>
                                 <option  value="">Select Leaving class</option>
                                    <?php foreach ($classes as $key=> $val) { ?>
                                        <option value="<?php echo $val['class_id']; ?>" <?php if($val['class_id'] == $leave_info->class_in_which_left) echo 'selected'; ?>><?php echo $val['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="name">Date of Leaving <span class="text-danger">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="date" name="dol" id="dol" value="<?php echo $leave_info->dol?>" class="form-control" required>
                        </div>
                      </div>

                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Reason of Leaving <span class="text-danger">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="text" name="rol" id="rol"  value="<?php echo $leave_info->rol?>"    class="form-control" required>
                        </div>
                      </div>


                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Remarks <span class="required"></span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <textarea name="remarks" id="remarks" class="form-control"><?php echo $leave_info->remarks?>          </textarea>
                        </div>
                      </div>
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Total Days <span class="text-danger">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="number" name="total_days" id="total_days" value="<?php echo $leave_info->total_days ?>"  class="form-control" required>
                        </div>
                      </div>
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Attended Days <span class="text-danger">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="number" name="remain_days" id="remain_days"    value="<?php echo $leave_info->remain_days ?>"       class="form-control" required>
                        </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 -->

        <!-- footer content -->
        <footer>
          <div class="pull-right">
            EduSolutions
          </div>
          <div class="clearfix"></div>
        </footer>
        <!-- /footer content -->
      </div>
    </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>

    <!-- Custom Theme Scripts -->
    <script src="<?php echo base_url(); ?>assets/build/js/custom.min.js"></script>
    <script src="<?php echo base_url()?>assets/select/js/select2.min.js"></script>
<script>
 <?php if($this->user_model->is_super()){ ?>
    $('#branch').select2();
    <?php } ?>
    $('#class').select2();
    $('#section').select2();
    $('#student').select2();
    $('#conduct').select2();
    $('#progress').select2();
    $('#class_in_which_left').select2();
</script>
    <script>
        $(document).ready(function(){
            //  <?php if(!$this->user_model->is_super()){ ?>
            // var value = $("#branch").val();
            //     $.get("<?php echo base_url(); ?>load/classs/role/"+value,{},function(d){
            //         var pre = '<option value="">Select Class</opiton>';
            //         $("#class").html(pre+d);
            //         $("#class_in_which_left").html(pre+d);
                    
            //     });
            //     <?php } ?>
              <?php if($this->user_model->is_super()){ ?>   
            $(document).on("change","#branch",function(){
                var value = $(this).val();
                $.get("<?php echo base_url(); ?>load/classs/role/"+value,{},function(d){
                    var pre = '<option value="">Select Class</opiton>';
                    $("#class").html(pre+d);
                    $("#class_in_which_left").html(pre+d);
                });
            });
            <?php } ?>
            
        });
    </script>

    <script>
        $(document).ready(function(){
            $(document).on("change","#class",function(){
                var value = $(this).val();
                $.get("<?php echo base_url(); ?>load/section/role/"+value,{},function(d){
                    var pre = '<option value="">Select Section</opiton>';
                    $("#section").html(pre+d);
                });
            });
            
        });
    </script>

    <script>
        
            $('#section').change(function(){
                  
                var se= $(this).val();
                var cl=$('#class').val();
                $.get("<?php echo base_url(); ?>load/student/"+cl+"/"+se,{},function(d){
                    var pre = '<option value="">Select Student</opiton>';
                    $("#student").html(pre+d);
                });
            });
            
       
    </script>
    <script>
    
    // Select your input element.

var number = document.getElementById('total_days');

// Listen for input event on numInput.
number.onkeydown = function(e) {
    if(!((e.keyCode > 95 && e.keyCode < 106)
      || (e.keyCode > 47 && e.keyCode < 58) 
      || e.keyCode == 8)) {
        return false;
    }
}

    </script>
     <script>
    
    // Select your input element.

var number = document.getElementById('remain_days');

// Listen for input event on numInput.
number.onkeydown = function(e) {
    if(!((e.keyCode > 95 && e.keyCode < 106)
      || (e.keyCode > 47 && e.keyCode < 58) 
      || e.keyCode == 8)) {
        return false;
    }
}

    </script>
    <script>
$(document).ready(function() {

  
  $('#remain_days').on('keyup change', function() {
    if (parseInt($('#total_days').val()) >= parseInt($('#remain_days').val())) {
      $('#send').prop('disabled',false);
    } else {
      $('#send').prop('disabled',true);
    }
  });
});


    </script>
<script>
         $(document).on("change","#conduct",function(){
            if($(this).val() == '')
            $('#send').prop('disabled', true);
            else{
                    var section = $("#section").val();
                    var classs = $("#class").val();
                    var student = $("#student").val();
                    var conduct = $(this).val();
                    var progress = $("#progress").val();
                    var class_in_which_left = $("#class_in_which_left").val();
                    var dol = $("#dol").val();
                    var rol = $("#rol").val();
                    var total_days = $("#total_days").val();
                    var remain_days = $("#remain_days").val();
                    if(conduct != '' && progress != '' && class_in_which_left != '' && dol != '' && rol != '' && total_days != '' && remain_days != '' ) {
                   $('#send').prop('disabled', false);
                }
            }
        });
         $(document).on("change","#progress",function(){
            if($(this).val() == '')
            $('#send').prop('disabled', true);
            else{
                    var section = $("#section").val();
                    var classs = $("#class").val();
                    var student = $("#student").val();
                    var conduct = $("#conduct").val();
                    var progress = $(this).val();
                    var class_in_which_left = $("#class_in_which_left").val();
                    var dol = $("#dol").val();
                    var rol = $("#rol").val();
                    var total_days = $("#total_days").val();
                    var remain_days = $("#remain_days").val();
                    if(conduct != '' && progress != '' && class_in_which_left != '' && dol != '' && rol != '' && total_days != '' && remain_days != '' ) {
                   $('#send').prop('disabled', false);
                }
            }
        });
         $(document).on("change","#class_in_which_left",function(){
            if($(this).val() == '')
            $('#send').prop('disabled', true);
            else{
                    var section = $("#section").val();
                    var classs = $("#class").val();
                    var student = $("#student").val();
                    var conduct = $("#conduct").val();
                    var progress = $("#progress").val();
                    var class_in_which_left = $(this).val();
                    var dol = $("#dol").val();
                    var rol = $("#rol").val();
                    var total_days = $("#total_days").val();
                    var remain_days = $("#remain_days").val();
                    if(conduct != '' && progress != '' && class_in_which_left != '' && dol != '' && rol != '' && total_days != '' && remain_days != '' ) {
                   $('#send').prop('disabled', false);
                }
            }
        });
        $("#dol").keyup(function(){
            if($(this).val() == '')
            $('#send').prop('disabled', true);
            else{
                    var section = $("#section").val();
                    var classs = $("#class").val();
                    var student = $("#student").val();
                    var conduct = $("#conduct").val();
                    var progress = $("#progress").val();
                    var class_in_which_left = $("#class_in_which_left").val();
                    var dol = $(this).val();
                    var rol = $("#rol").val();
                    var total_days = $("#total_days").val();
                    var remain_days = $("#remain_days").val();
                    if(conduct != '' && progress != '' && class_in_which_left != '' && dol != '' && rol != '' && total_days != '' && remain_days != '' ) {
                   $('#send').prop('disabled', false);
                }
            }
        });
        $("#rol").keyup(function(){
            if($(this).val() == '')
            $('#send').prop('disabled', true);
            else{
                    var section = $("#section").val();
                    var classs = $("#class").val();
                    var student = $("#student").val();
                    var conduct = $("#conduct").val();
                    var progress = $("#progress").val();
                    var class_in_which_left = $("#class_in_which_left").val();
                    var dol = $("#dol").val();
                    var rol = $(this).val();
                    var total_days = $("#total_days").val();
                    var remain_days = $("#remain_days").val();
                    if(conduct != '' && progress != '' && class_in_which_left != '' && dol != '' && rol != '' && total_days != '' && remain_days != '' ) {
                   $('#send').prop('disabled', false);
                }
            }
        });
        $("#total_days").keyup(function(){
            if($(this).val() == '')
            $('#send').prop('disabled', true);
            else{
                    var section = $("#section").val();
                    var classs = $("#class").val();
                    var student = $("#student").val();
                    var conduct = $("#conduct").val();
                    var progress = $("#progress").val();
                    var class_in_which_left = $("#class_in_which_left").val();
                    var dol = $("#dol").val();
                    var rol = $("#rol").val();
                    var total_days = $(this).val();
                    var remain_days = $("#remain_days").val();
                    if(conduct != '' && progress != '' && class_in_which_left != '' && dol != '' && rol != '' && total_days != '' && remain_days != '' ) {
                   $('#send').prop('disabled', false);
                }
            }
        });
        $("#remain_days").keyup(function(){
            if($(this).val() == '')
            $('#send').prop('disabled', true);
            else{
                    var section = $("#section").val();
                    var classs = $("#class").val();
                    var student = $("#student").val();
                    var conduct = $("#conduct").val();
                    var progress = $("#progress").val();
                    var class_in_which_left = $("#class_in_which_left").val();
                    var dol = $("#dol").val();
                    var rol = $("#rol").val();
                    var total_days = $("#total_days").val();
                    var remain_days = $(this).val();
                    if(conduct != '' && progress != '' && class_in_which_left != '' && dol != '' && rol != '' && total_days != '' && remain_days != '' ) {
                   $('#send').prop('disabled', false);
                }
            }
        });
    </script>

  </body>
</html>