<!-- 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>Create Datesheet</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 action="<?php echo base_url(); ?>Exam/saveGrading" id="routePermit" class="form-horizontal form-bordered" method="post">
                      
                                           <?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" for="name">Branch <span class="required">*</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">
                            <option value=''>Select Branch</option>
                      <?php
                            foreach ($branch as $value) {
                      ?>
                            <option value="<?php echo $value['id']; ?>"><?php echo $value['name']?></option>

                      <?php } ?>
                          </select>
                        </div>
                      </div>
                      <?php  }else{$branch=$this->user_model->getbranch();?>
                          <input id="branch" name="branch" type="hidden" value="<?= $branch ?>">
                      <?php  } ?>
                                          
               
                    

                    <div class="form-group" id="newOne">
                        <hr>
                    </div>

                    <div class="row">
                        <button class="btn btn-success col-lg-offset-8 pull-right " type="button" id="add" name="+">ADD</button>
                    </div> 
                       
                    <div class="row">
                        <button class="btn btn-success col-lg-offset-8 pull-right" type="submit" name="submit">Submit</button>
                    </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>

 <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>

    <!-- Custom Theme Scripts -->
    <script src="<?php echo base_url(); ?>assets/build/js/custom.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>
    <!-- Jquery UI-daterangepicker -->
    <script src="<?php echo base_url(); ?>assets/vendors/datepicker/jquery-ui.min.js"></script>
    
    
    
 
 <script src="<?php echo base_url()?>assets/select/js/select2.min.js"></script>
   <script>
    $('#branch').select2({
     //selectOnClose: true,
    placeholder: "Select a Branch",
    allowClear:true
    });
    </script>
<script src="<?php echo base_url(); ?>assets/js/timepicki/timepicki.js"></script>
 <script src="<?php echo base_url(); ?>assets/js/timepicki/timepicki.js~"></script>
 <script src="<?php echo base_url(); ?>assets/js/timepicki/bootstrap.min.js"></script>

<script>
$(document).ready(function(e) {
  
  var values = [];
  var n=0;
  var x = 1;
  var max_fields      = 8;
  var newDiv  = $("#newOne");
  
  $("#add").click(function(e){

    var dataComp='';
    e.preventDefault();
       //text box increment 
       if(x < max_fields){ //max input box allowed
            x++;
             
            
                
                $(newDiv).append('<div class="form-group"><label class="col-md-2 control-label" for="inputSuccess">Minimum :</label><div class="col-md-2"><input class="form-control" type="number" id="min[]" name="min[]" required></div><label class="col-md-1 control-label" for="inputSuccess">Maximum :</label><div class="col-md-2"><input class="form-control col-md-4 col-xs-12 " type="number"  name="max[]" value="" required></div><label class="col-md-1 control-label" for="inputSuccess">Grade :</label><div class="col-md-2"><input id="" class="form-control" type="text"  name="grade[]" required/ ></div><input  type="button" class="remove_field btn btn-primary pull-right" style="margin-top:10;" id="btn/'+n+'"  value="X"></div>'); 
          }
          ++n;
      }); 
     
    $(newDiv).on("click",".remove_field", function(e){ //user click on remove text
       var id =$(this).attr('id');
     
     //var last = str.substring(str.lastIndexOf("/") + 1, str.length);
     var last = id.substring(id.lastIndexOf("/") + 1, id.length);
     e.preventDefault(); $(this).parent('div').remove(); x--;
    });


    $("#exam").change(function(e){
        $( "#add" ).removeClass("hide");
    });

  
});
    </script>

<script src="<?php echo base_url(); ?>assets/js/timepicki/timepicki.js"></script>
<script src="<?php echo base_url(); ?>assets/js/timepicki/timepicki.js~"></script>
<script src="<?php echo base_url(); ?>assets/js/timepicki/bootstrap.min.js"></script>



<script type='text/javascript' > 

 /* $('body').on('focus',".timepicker1", function(){
    $(this).timepicki();
});
  $('body').on('focus',".timepicker", function(){
    $(this).timepicki();
});

  $('body').on('focus',".datepicker", function(){
    $(this).datepicker({ dateFormat: 'dd-mm-yy' });
});
/*
  $('body').on('click',"#add", function(){
    $(".subject").select2();
});*/


/*

  $('#timepicker').timepicki();  
        $('#timepicker1').timepicki();  */ 
</script>






  </body>
</html>