<!-- page content -->
        <!-- 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 Note</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/add_note" 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">
                        <label class="col-md-3 control-label" for="inputSuccess">Select Class</label>
                        <div class="col-md-6">
                          <div id="class_dropdown">
                            <div class="form-control">
                              Select Class First
                            </div>        
                              </div>
                              
                          
                        </div>
                      </div> -->
         
                 <div class="form-group">
                        <label class="col-md-3 control-label" for="inputSuccess"> Note</label>
                        <div class="col-md-6">
                        <textarea class="form-control" id="note" name="note"></textarea>
                          
                        </div>
                      </div>
                                                 
                       
                  

                       
            <div class="row">
                                        <button class="btn btn-success col-lg-offset-8" type="submit" name="submit">Save</button>
                                        
                                        </div> 
                 
                    
                                            
                      </form>
                      </div>
                </div>
              </div>
            </div>
          </div>
          <!--page content-->
          <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> Notes View</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">
                       <div class ="table-responsive">
                    <table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap">
                        <thead>
							<tr>
                                <th>#</th>
                                <th>Note</th>
                                  <?php if($this->user_model->is_super()){ ?>
                                <th>Branch</th>
                                <?php } ?>
                                <th>Action</th>
                            </tr>
									</thead>
									<tbody>
                    <?php foreach($data as  $v){ ?>
                    <tr>
                    <td><?php echo $i++; ?></td>
                    
                    <td><?php echo $v['note']; ?></td>
                                                      <?php if($this->user_model->is_super()){ ?>

                    <td><?php echo $v['name']; ?></td>
                                                    <?php } ?>

                    
                    <td>
<?php  if($edit_delete['edit']){ ?>
                      <a href="<?php echo base_url(); ?>Exam/editnote/<?php echo base64_encode(json_encode($v['id'].SALT)); ?>"><i class="fa fa-pencil-square-o"></i></a>
<?php } if($edit_delete['delete']){ ?>
                      <a href="<?php echo base_url(); ?>Exam/notedelete/<?php echo base64_encode(json_encode($v['id'].SALT)); ?>"><i class="fa fa-trash"></i></a>
<?php } ?>
                    </td>
                
                    </tr>
                    <?php } ?>
                  </tbody>
								</table>
                  </div>
                  </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>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net/js/jquery.dataTables.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-buttons/js/dataTables.buttons.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-buttons-bs/js/buttons.bootstrap.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/jszip/dist/jszip.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/pdfmake/build/pdfmake.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/pdfmake/build/vfs_fonts.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-buttons/js/buttons.flash.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-buttons/js/buttons.html5.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-buttons/js/buttons.print.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-fixedheader/js/dataTables.fixedHeader.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-keytable/js/dataTables.keyTable.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-responsive-bs/js/responsive.bootstrap.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-scroller/js/datatables.scroller.min.js"></script>
    
     <script>
$(document).ready(function(){

            $(document).ajaxStart(function() {
                $('#ajaxload').show();
            });
            
        // $('#datatable-buttons').DataTable();
   $.ajax({
    url: '<?php echo base_url(); ?>exam/viewnote/',data: {},
         success: function (result) {
            
      $(document).ajaxStop(function() {
           $('#ajaxload').hide();
      });
        
        
             console.log(result);
              $("#datatable-buttons").dataTable().fnDestroy();
               setTimeout(function(){
               
               $("tbody.center").html(result);
                $("#datatable-buttons").DataTable({dom: "lBfrtip",
              "bPaginate": true,
              "pageLength":35,
              "lengthMenu": [[35, 70, 100, -1], [35, 70, 100, "All"]],
               
             buttons: [
                 {
                  extend: "print",
                  className: "btn-sm"
                },
                {
                  extend: "copy",
                  className: "btn-sm"
                },
                {
                  extend: "csv",
                  className: "btn-sm"
                },
                {
                  extend: "excel",
                  className: "btn-sm"
                },
                {
                extend: 'pdf',
                className: "btn-sm"
                
                },
              ],
              responsive: true
            });
            },500);
           }
     });//end ajax for loading form


});
</script>

    <!-- Custom Theme Scripts -->
    <script src="<?php echo base_url(); ?>assets/build/js/custom.min.js"></script>
  <script>
      $(function(){
        $(document).on("change","#branch",function(){
          var val = $(this).val();
          $.get("<?php echo base_url(); ?>Load/classs/role/"+val,{},function(data){
            var pre = "<option value=''>Select Class</option>";
            $("#class").html(pre+data);
          });
        });
      });
    </script>
     <script src="<?php echo base_url()?>assets/select/js/select2.min.js"></script>
    <script>
 
     $('#branch').select2({
     //selectOnClose: true,
    
   
    allowClear:true
    });
    </script>
    

  </body>
</html>