

<style>
p{
    padding-top:8px;
}
</style>
        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
                <div class="title_left">
                    <h3> </h3>
                </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">
                   
                    <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="row">
                        <div class="col-md-7 col-sm-7 col-xs-12">
                            <h1>Teacher Performance</h1>
                            <h3>Class Wise </h3>
                        </div>
                        <div class="col-md-3 col-sm-3 col-xs-12 form-horizontal">
                            <h2 class="control-label"><?php echo $branch['name']; ?></h2>
                            <h3 class="control-label"><?php echo $branch['contact']; ?></h3>
                        </div>
                        <div class="col-md-1 col-sm-1 col-xs-12">
                            <img src="<?php echo base_url().$branch['b_logo']; ?>" width="100" height="100" alt="">
                        </div>
                    </div>
                    <div class="ln_solid"></div>
                    <div class="row form-horizontal">
                        <div class="col-md-8 col-sm-7 col-xs-12">
                           
                            <div class="">
                                <p class="col-md-2 col-sm-2 col-xs-12"><strong>Name </strong></p>
                                <p class="col-md-10 col-sm-10 col-xs-12"> <?php echo $tec['firstname']; ?> </p>
                            </div>
                             <div class="">
                                <p class="col-md-2 col-sm-2 col-xs-12"><strong>Teacher CNIC</strong></p>
                                <p class="col-md-10 col-sm-10 col-xs-12"> <?php echo $tec['cnic']; ?>  </p>
                            </div>
                            <div class="">
                                <p class="col-md-2 col-sm-2 col-xs-12"><strong>Father</strong></p>
                                <p class="col-md-10 col-sm-10 col-xs-12"> <?php echo $tec['lastname']; ?> </p>
                            </div>
                           
                        </div>
                        <div class="col-md-2 col-sm-5 col-xs-12">
                             <div class="">
                                <strong class="control-label col-md-9 col-sm-9 col-xs-12">Contact</strong>
                                <p class="col-md-3 col-sm-3 col-xs-12"> <?php echo $tec['contact']; ?> </p>
                            </div>
                            <div class="">
                                <strong class="control-label col-md-9 col-sm-9 col-xs-12">Designation</strong>
                                <p class="col-md-3 col-sm-3 col-xs-12"> <?php echo $tec['designation']; ?> </p>
                            </div>
                            <div class="">
                                <strong class="control-label col-md-9 col-sm-9 col-xs-12">Salary</strong>
                                <p class="col-md-3 col-sm-3 col-xs-12">
                                <?php 
                                $mnth_sl=date('Y-m');
                                $prev_inc=0;
                                $prev_inc=$this->db->select('sum(amount) as amount')
                                             ->from('increments')
                                             ->where('bothid',$tec['id'])
                                              ->where('month <',$mnth_sl)
                                              ->where('refrence',"teacher")
                                              ->where('is_del',0)
                                              ->get()->row_array()['amount'];
                                echo $tec['salery']+$prev_inc; 
                                ?> </p>
                            </div>
                            
                        </div>
                    </div>
                    <table class="table table-bordered table-striped">
                        <thead>
                            <tr>
                                <th>#</th>
                                <th>Teacher </th>
                                <th>Class Name</th>
                                <th>Section</th>
                                <th>Subject</th>
                               
                                 <th>Percentage </th>
                            </tr>
                        </thead>
                        <tbody>
                        
                                       <?php $i=1; foreach ($teacher as $key => $value) { ?>
                                       
                               <?php   if(!empty($value)){    ?>  
                                      
                        <tr>
                     
                          <td><?php echo $i++; ?></td>
                           <td><?php echo $value['firstname'] ?></td>
                          <td><?php echo $value['class_name'] ?></td>
                          <td><?php echo $value['section_name'] ?></td>
                          <td><?php echo $value['name'] ?></td>
                          
                       <?php     $t=$value['obmarks']/$value['total']*100;
                                     $d = round($t,2);
                                     
                    ?>
                                
                         
                           <td>  
                           
                           
                             <div class="progress">
    <div <?php If( $value['obmarks']/$value['total']*100 > 55  ){ ?>
    class="progress-bar progress-bar-success"
    
  <?php  } else
    { ?>
    class="progress-bar progress-bar-danger"
  <?php  }  ?> role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width:<?php echo $d  ;?>%">
     
     
      <?php echo $d    ;?>
   
   
    </div>
  </div>
                           
                           
                           </td>
                           
                           </tr>


<?php  } } ?>

                        
                        
                        
                        
                           
                        </tbody>
                    </table>
                
                  </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>
        $(function(){
            var total = $("#total").val();
            var net = $("#net").val();
            <?php if($invoice['status']==0){ ?>
            if(net <= 0 && total <= 0)
            {
                $("#total").val(0);
                $("#net").val(0);
                $("#remaining").val(0);
                $("#recieved").val(0);
                $("#advance").val(Math.abs(net));
            }else{
                $("#remaining").val(net);
            }
            <?php } ?>
            
            $(document).on("keyup","#recieved",function(){
                var val = parseInt($(this).val());
                var ret = parseInt($("#net").val()) - val;
                if(ret <= 0)
                {
                $("#remaining").val('0');
                $("#advance").val(Math.abs(ret));
                }else{
                $("#remaining").val(ret);
                $("#advance").val('0');
                }
            });
        });
    </script>

  </body>
</html>