        <!-- 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>Select Class For Cards</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;?>student/Card_students" 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">Select Class<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select class="form-control col-md-7 col-xs-12" name="class" id="class" required="required">
				<option value="">Select Class</option>
                    <?php       

                              foreach ($types as $type) {
                 
                  ?>
                    <option value="<?php echo $type["class_id"];?>"><?php echo $type["class_name"];?></option>

                  <?php } ?>
                          </select>
                        </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">Save</button>
                        </div>
                      </div>
                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <!-- /page content -->

        <!-- footer content -->
        
        <!-- /footer 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>
      </div>
    </div>

    <!-- jQuery -->
    <script src="<?php echo base_url(); ?>assets/vendors/jquery/dist/jquery.min.js"></script>
    <script src="<?php echo base_url()?>assets/select/js/select2.min.js"></script>
<script>
    $('#class').select2();
    $('#branch').select2();
    $(document).on("change","#branch",function(){
                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);
                });
            });
</script>


    <?php $this->load->view('footer'); ?>