
        <!-- page content -->
         <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
              <div class="title_left">
              </div>

              <div class="title_right">
                <div class="col-md-5 col-sm-5 col-xs-12 form-group pull-right top_search">
                                  </div>
              </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>Student Update <small></small></h2>
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                      </li>
                      <li><a class="close-link"><i class="fa fa-close"></i></a>
                      </li>
                    </ul>
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">

                   
    <div class="demo-settings" data-open="true">
        
        <div class="settings-main">
            <label>Step effect</label>
            <select class="form-control" id="stepEffect">
                <option value="basic" selected="selected">basic</option>
                <option value="bounce">bounce</option>
                <option value="slideRightLeft">slideRightLeft</option>
                <option value="slideLeftRight">slideLeftRight</option>

                <option value="flip">flip</option>
                <option value="transformation">transformation</option>
                <option value="slideDownUp">slideDownUp</option>
                <option value="slideUpDown">slideUpDown</option>
            </select>
            <br />
            <label for="stepTransition">
                Step transition <input type="checkbox" id="stepTransition" name="stepTransition" value="11" checked />
            </label>
            <br />
            <label for="showButtons">
                Show buttons <input type="checkbox" id="showButtons" name="showButtons" value="111" checked />
            </label>
            <br />
            <label for="showStepNum">
                Show stepNum <input type="checkbox" id="showStepNum" name="showStepNum" value="123" checked />
            </label>


        </div>
    </div>

    <div class="container">
        <div class="row">
            
            <!-- BEGIN STEP FORM WIZARD -->
            <div class="tsf-wizard tsf-wizard-1">
                <!-- BEGIN NAV STEP-->
                <div class="tsf-nav-step">
                    <!-- BEGIN STEP INDICATOR-->
                    <ul class="gsi-step-indicator triangle gsi-style-1  gsi-transition ">
                        <li class="current" data-target="step-1">
                            <a href="#0">
                                <span class="number">1</span>
                                <span class="desc">
                                    <label>Personal Information</label>
                                    <!-- <span>Account details</span> -->
                                </span>
                            </a>
                        </li>
                        <li data-target="step-2">
                            <a href="#0">
                                <span class="number">2</span>
                                <span class="desc">
                                    <label>Parent / Guardian Information</label>
                                    <!-- <span>Profile details</span> -->
                                </span>
                            </a>
                        </li>
                        <li data-target="step-3">
                            <a href="#0">
                                <span class="number">
                                    3
                                </span>
                                <span class="desc">
                                    <label>School Information</label>
                                    <span></span>
                                </span>
                            </a>
                        </li>
                        <li data-target="step-4">
                            <a href="#4">
                                <span class="number">
                                    4
                                </span>
                                <span class="desc">
                                    <label>Fee Details</label>
                                    <span></span>
                                </span>
                            </a>
                        </li>
                    </ul>
               
                <!-- BEGIN STEP CONTAINER -->

                <div class="tsf-container">
                    <!-- BEGIN CONTENT-->

                    <form class="tsf-content" method="POST" action="<?php echo base_url();?>student/update"  enctype="multipart/form-data">
                        <!--<form class="tsf-form">-->
                        <!-- BEGIN STEP 1-->
                        
                        <div class="tsf-step step-1 active">
                             <span class="fa fa-user" style="font-size:200%;width:4%;float:left;padding-left:40px;"></span>
                             <fieldset>
                                 
                                <legend style="padding-left:40px;">Personal Information</legend>
                                <div class="row">
                                    <!-- BEGIN STEP CONTENT-->
                                    <div class="tsf-step-content">
                                        
                                        <div class="row">
                                          <div class="form-group">
                                          <!--<div class="col-lg-2 col-lg-offset-1">-->
                                              <!--  <label for="name">Roll # <span class="text-danger">*</span></label>-->
                                               <!--  <input type="hidden" value="<?php echo $val['stid'];?>" name="id">-->
                                              <!--  <input type="hidden" class="form-control abc1" id="sid" name="sid" value="<?php echo $val['sid']; ?>" readonly>  -->
                                             <!--   <input type="text" class="form-control" id="roll_no" name="roll_no" placeholder="Roll No" style="width: 230px;margin-left:50px;" value="<?php echo $val['roll_no']; ?>" readonly>-->
                                           <!-- </div>
                                             <!--<div class="col-lg-2">-->
                                             <!--   <label for="name">Reg Number <span class="text-danger">*</span></label>-->
                                                <?php echo form_error('gr',"<p style='color:red;font-size:12px;'>");?>
                      <input type="hidden" value="<?php echo $val['stid'];?>" name="id">

                                                
                                             <input type="hidden" class="form-control abc1" id="gr" name="gr" placeholder="Student GR No." required="ture" value="<?php echo $val['grno']; ?>">     <!--  <p class="result text-danger bg-danger"></p>-->
                                                
                                            <!--</div>-->
                                                <div class="col-lg-2">

                                                <label for="doa">Admission Date<span class="text-danger">*</span></label>
                                                <input type="text" class="DMY form-control col-md-7 col-xs-12" id="doa" name="doa" placeholder="dd-mm-yyyy"  value="<?php echo date('d-m-Y',strtotime($val['date_of_admission']));?>" required >
                                            </div>
                                            

<div class="col-lg-3">
                                                <label for="name">Name<span class="text-danger">*</span></label>
                                                <input type="text" class="form-control col-md-7 col-xs-12 abc" id="name" name="name" placeholder="Student Name" required="ture" pattern="[A-Za-z- ]{3,}" title="Only alphabatic character" value="<?php echo $val['student_name'];?>">
                                            </div>


                                            <!--<div class="col-lg-2">-->
                                            <!--    <label for="surname">Surname</label>-->
                                            <!--      <input id="surname" name="surname" class="form-control col-md-7 col-xs-12 abc" type="text" pattern="[A-Za-z- ]{3,}" title="Only alphabatic character" value="<?php //echo $val['surname'];?>">-->
                                              
                                            <!--</div>-->
                                            <div class="col-lg-3">
                                                <label for="dob">Student Contact</label>
                                                  <input id="student_contact" name="student_contact" class=" form-control col-md-7 col-xs-12 phone"  type="text" pattern="[\+]\d{2}\d{4}\d{6}" title='Phone Number Format:+254XXXXXXXXX' placeholder="+254XXXXXXXXX" value="<?php echo $val['student_contact'];?>">
                                            </div>

                                          </div></div>
                                          
                                        <div class="row">
<div class="col-sm-1 col-lg-offset-1">
                                                <label for="Image">Image</label>
                                                <div style="margin:5px 0px;"> 
                                                <img class="img-responsive avatar-view" src="<?php if($val['img']){ echo base_url().$val['img'];} else { echo "https://upload.wikimedia.org/wikipedia/commons/8/89/Portrait_Placeholder.png";} ?>" width="70px" height="70px"></div>
                                            </div>
                                            <div class="col-lg-3">
                                            <?php
                                                  $pic = array(
                                                  'name' => 'pic',
                                                   'id' => 'pic', 
                                                   'class'=> 'form-control',
                                                );
                                              echo form_label('Picture');
                                              echo form_upload($pic);  
                                            ?>
                                            </div>

                                           <p class="dob"></p>
               <div class="col-lg-2">
                                                <label for="dob">Date of Birth<span class="text-danger">*</span></label>
                                                  <input id="dob" name="dob" class="DMY form-control col-md-7 col-xs-12" placeholder="dd-mm-yyyy"  type="text" value="<?php echo date('d-m-Y',strtotime($val['dob']));?>" required>                                               
                                            </div>
<div class= "col-lg-2">
                                            <label for="gender">Gender <span class="text-danger">*</span></label>
<div>
                                            <input <?php if($val['gender']=="Male"){echo "checked";} ?> type="radio" name="gender" value="Male"> Male
                                            <input <?php if($val['gender']=="Female"){echo "checked";} ?> type="radio" name="gender" value="Female">
                                            Female
                                    </div></div>
<p class="religion"></p>
                                            <div class="col-lg-2">
                                                <label for="dob">Nationality<span class="text-danger">*</span></label>
                                                  <input id="religion" name="religion" class=" form-control col-md-7 col-xs-12 abc" type="text" value="<?php echo $val['religion'];?>">
                                            </div>

                                           </div>
<div class="row">
               
                                            
                                            <!--<div class="col-lg-2">-->
                                            <!--    <label for="dob">Mother Tongue</label>-->
                                            <!--      <input id="mother_tongue" name="mother_tongue" class=" form-control col-md-7 col-xs-12 abc" pattern="[A-Za-z\s]{1,}"  type="text" value="<?php //echo $val['mother_tongue'];?>">-->
                                            <!--</div>-->

                                     <!--<div class="col-lg-4">-->
                                     <!--           <label for="dob_words">Date of Birth in Words<span class="text-danger">*</span></label>-->
                                     <!--             <input id="dob_words" name="dob_words" class="form-control col-md-7 col-xs-12 abc"  type="text" value="<?php //echo $val['dob_words']; ?>" required>                                   -->
                                     <!--       </div>-->


</div>
                                            
<div class="row">

                                            <!-- <div class="col-lg-3">-->
                                            <!--    <label for="dob">Mark of Identification</label>-->
                                            <!--      <input id="mark_of_identification" name="mark_of_identification" class=" form-control col-md-7 col-xs-12 abc" type="text" value="<?php //echo $val['mark_identification'];?>">-->
                                            <!--</div>-->



                                  <!--<div class="col-lg-4">-->
                                  <!--              <label for="pob">Place of Birth</label>-->
                                  <!--                <input id="pob" name="pob" class=" form-control col-md-7 col-xs-12 abc" value="<?php //echo $val['pob'];?>"  type="text">-->
                                  <!--  </div>-->
                                    </div>
                                 <p class="per_address"></p> 
<span class="fa fa-home" style="font-size:200%;width:4%;float:left;"></span>  
                                <legend style="margin-right:10px;">Address Information</legend>
<!-- <div class="row">-->
<!--                                     <div class="col-lg-2 col-lg-offset-1">-->
<!--                                                <label for="dob">Province<span class="text-danger">*</span></label>-->

<!--                                                   <select id="provn" name="provn" class="date-picker form-control col-md-7 col-xs-12" >-->
<!--                                <option value="">Select Province</option>-->
                              
                                     <?php       
                                       
                                //       $this->db->where('is_delete',0);
                                // $pro=$this->db->get('province')->result_array();
                                
                                //      foreach ($pro as $key => $po) { ?>
                     <option <?php //if($val['province']==$po['province_id']){echo "selected";} ?>  value="<?php //echo $po['province_id']; ?>"><?php //echo $po['province_name']?></option>

                  <?php //} ?>
<!--              </select>-->
<!--                                            </div>-->
                                            
                                            
<!--                                    <div class="col-lg-2">-->
<!--                                                <label for="dob">District<span class="text-danger">*</span></label>-->

<!--                                                   <select id="district" name="district" class="date-picker form-control col-md-7 col-xs-12" required>-->
<!--                                <option value="">Select District</option>-->
                              
                                       <?php     //  $this->db->where('is_delete',0) ;
                                // $dis=$this->db->get('district')->result_array();
                                
                                //      foreach ($dis as $key => $di) { ?>
                     <option <?php //if($val['district']==$di['id']){echo "selected";} ?>  value="<?php //echo $di['id']; ?>"><?php //echo $di['name']?></option>

                  <?php //} ?>
<!--              </select>-->
<!--                                            </div>-->
                                            
<!--                                             <div class="col-lg-3">-->
<!--                                                <label for="dob">Tehsil</label>-->
<!--                                                   <select id="taluka" name="taluka" class="date-picker form-control col-md-7 col-xs-12">-->
                                
                      <!--            <option   value="">Select Tehsil</option>-->
                           <?php      
                            //   $this->db->where('is_delete',0) ;
                            //     $dis=$this->db->get('taluka')->result_array();
                                
                            //          foreach ($dis as $key => $ci) { ?>
                                  <!--    <option <?php //if($val['taluka']==$ci['id']){echo "selected";} ?>  value="<?php //echo $ci['id']; ?>"><?php //echo $ci['name']?></option>-->

                  <?php //} ?>
<!--                              </select>-->
<!--                                            </div>-->
<!--<div class="col-lg-3">-->
<!--                                                <label for="dob">City/Village</label>-->
<!--                                                  <input id="city" name="city" class=" form-control col-md-7 col-xs-12 abc"  type="text" value="<?php echo $val['city'];?>" >-->
<!--                                            </div></div>-->

<div class="row">                                             
                                                                             <p class="per_address"></p> 

<div class="col-lg-5 col-lg-offset-1">
                                                <label for="dob">Residence Address<span class="text-danger">*</span></label>
                              <textarea id="permentaddess" name="permentaddess"  class="form-control"><?php echo $val['perment_address'];?></textarea>
                                                   
                              </select>
                                            </div>

                              <!--              <div class="col-lg-5">-->
                              <!--                  <label for="dob">Postal Address<span class="text-danger">*</span></label>-->
                              <!--<textarea id="potaladdess" name="postaladdess"  class="form-control" required><?php echo $val['postal_address'];?></textarea>-->
                              
                                                   
                              <!--</select>-->
                              <!--              </div>-->
                                            </div>
                                        
                                    </div>
                                    <!-- END STEP CONTENT-->
                                </div>

                            </fieldset>
                        </div>
                        <!-- END STEP 1-->
                        <!-- BEGIN STEP 2-->
<div class="tsf-step step-2">
                            <fieldset>
                                <legend>Father / Guardian Information</legend>
                                <!-- BEGIN STEP CONTENT-->
                                <div class="tsf-step-content">
                                  <div class="row">
                                    <div class="form-group col-lg-5 col-lg-offset-1">
                                        <label for="fathername">Parent Name<span class="text-danger">*</span></label>
                                        <input type="text" id="fathername" name="fathername" value="<?php echo $val['father_name']; ?>" class="form-control col-md-7 col-xs-12 abc"  title="Only alphabatic character" required >
                                    </div>
                                    <div class="form-group col-lg-5">
                                        <label for="fathercontact">Parent Contact<span class="text-danger">*</span></label>
                                        <input type="text" class="form-control phone" id="fathercontact" name="fathercontact" placeholder="e.g +2543027566364" pattern="[\+]\d{3}\d{3}\d{6}" title='Phone Number Format:+923027566364' value="<?php echo $val['father_contact'];?>">
                                    </div>
                                    <div class="form-group col-lg-5  col-lg-offset-1"  col-lg-offset-1>
                                        <label for="father_cnic">Parent ID. <span class="text-danger">*</span></label>
                                        <input type="text" class="form-control num" id="fathercnic" name="fathercnic" placeholder="e.g 35202123" pattern="\d{4}\d{4}" title="35202123(8 numbers)" value="<?php echo $val['father_cnic'];?>">

                                    </div>
                                    <div class="form-group col-lg-5">
                                        <label for="fatheroccupation">Parent Occupation</label>
                                   
                                        <input type="text" class="form-control abc" id="fatheroccupation" name="fatheroccupation" placeholder="Parent Occupation" pattern="[A-Za-z\s]{3,}" value="<?php echo $val['father_occupation'];?>">
                                        
                                     </div>
                                  </div>

                                  <div class="row">
                                  <!--  <div class="form-group col-lg-5 col-lg-offset-1">-->
                                  <!--      <label for="guardianname">Guardian Name</label>-->
                                  <!--      <input type="text" class="form-control abc" id="guardianname" name="guardianname" placeholder="Guardian Name" pattern="[A-Za-z\s]{3,}" value="<?php //echo $val['guardian_name'];?>">-->
                                  <!--  </div>-->
                                  <!--  <div class="form-group col-lg-5 ">-->
                                  <!--      <label for="guardian_contact">Guardian Contact</label>-->
                                  <!--      <input type="text" class="form-control phone" id="guardiancontact" name="guardiancontact" placeholder="+923027566364" pattern="[\+]\d{2}\d{4}\d{6}" value="<?php //echo $val['guardian_contact'];?>" >-->
                                        
                                  <!--  </div>-->
                                  <!--  <div class="form-group col-lg-5  col-lg-offset-1">-->
                                  <!--      <label for="guardian_cnic">Guardian CNIC</label>-->
                                  <!--      <input type="text" class="form-control num" id="guardiancnic" name="guardiancnic" placeholder="3520212345678" pattern="\d{5}\d{7}\d{1}" value="<?php //echo $val['guardian_cnic']; ?>">-->
                                        
                                  <!--  </div>-->
                                  <!--  <div class="form-group col-lg-5">-->
                                  <!--      <label for="guardian_occupation">Guardian Occupation</label>-->
                                  <!--      <input type="text" class="form-control abc" id="guardianoccupation" name="guardianoccupation" placeholder="Guardian Occupation" pattern="[A-Za-z\s]{3,}" value="<?php //echo $val['guardian_occupation'];?>">-->
                                  <!--  </div>-->
                                  <!--</div>-->
                                  <!--<div class="row">-->
                                  <!--  <div class="form-group col-lg-5 col-lg-offset-1">-->
                                  <!--      <label for="fathercontact">Relation with Guardian</label>-->
                                  <!--      <input type="text" class="form-control abc" id="relationguardian" name="relationguardian" placeholder="Guardian Relation" pattern="[A-Za-z\s]{3,}" value="<?php //echo $val['relation_with_guardian'];?>">-->
                                  <!--  </div>-->
                                    <div class="form-group col-lg-5 col-lg-offset-1">
                                        <label for="fathercontact">Family Income</label>
                                        <input type="text" class="form-control num" id="familyincome" name="familyincome" placeholder="Family Income" value="<?php echo $val['income_family'];?>">
                                    </div>
                                  </div>

                                </div>
                                <!-- END STEP CONTENT-->
                            </fieldset>
                        </div>

                                                            <!-- END STEP 2-->
                        <!-- BEGIN STEP 3-->
                        <div class=" tsf-step step-3 ">
                            <fieldset>
                                <legend>School Information</legend>
                                <!-- BEGIN STEP CONTENT-->
                                <div class="tsf-step-content">
                                    
                                  <div class="form-group">
                                        <label for="familyincome">Previous School</label>
                                        <input type="text" class="form-control abc" id="preschool" name="preschool" placeholder="Previous School" value="<?php echo $val['previous_school'];?>">
                                    </div>

                            <?php if($this->user_model->is_super()){ ?>
                                    <div class="form-group">
                                        <label for="familyincome">Select Branch<span class="text-danger">*</span></label>
                                        <select class="form-control" name="branch" id="branch" readonly required style="width:100%">
                                      <option value="">Select Branch</option>
                                       <?php       $this->db->where('is_delete',0) ;
                                $com=$this->db->get('branch')->result_array();
                              foreach ($com as $key => $branc) { ?>
                 
                    <option <?php if($val['branch']==$branc['id']){ echo "selected";} ?> value="<?php echo $branc['id']; ?>"><?php echo $branc['name'];?></option>

                  <?php  } ?>
                                 </select>  

                                    </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 } ?>
                                    
                                    <div class="form-group">
                                        <label for="familyincome">Previous Class</label>
                                       <select name="class_id" id="class_id" class="form-control col-md-12 col-sm-12 col-xs-12" style="width:100%" >
                                
                                        <option value="">Select Class</option>
                                        <?php if(!$this->user_model->is_super()){ 
                                        
                                        $br=$this->user_model->getBranch()[0];
                                        $this->db->where('branch',$br) ;
                                        $this->db->where('is_delete',0) ;
                                        $class=$this->db->get('class')->result_array();
                                        }
                                     
                                      if($this->user_model->is_super()){
                                        $this->db->where('is_delete',0) ;
                                        $this->db->where('branch',$val['branch']) ;
                                        $class=$this->db->get('class')->result_array();
                                      }
                                         foreach ($class as $value) {?>
                                        <option <?php if($val['prev_class']==$value['class_id']){ echo "selected";} else{echo "";} ?> value="<?php echo $value['class_id']; ?>"><?php echo $value['class_name'];?></option>
                                        <?php } ?>
                                        </select>  

                                    </div>
                                    
                                    <div class="form-group">
                                        <label for="familyincome">Select Class<span class="text-danger">*</span></label>
                                       <select name="class_admited" id="class_admited" class="form-control col-md-12 col-sm-12 col-xs-12" style="width:100%" required="required">
                                
                                <option value="">Select Class</option>
                                
                                 <?php if($this->user_model->is_super()){
                                     
                                    $this->db->where('is_delete',0) ;
                                    $this->db->where('branch',$val['branch']) ;
                                    $class=$this->db->get('class')->result_array();
                                 } 
                                 if(!$this->user_model->is_super()){ 
                                     $br=$this->user_model->getBranch()[0];
                                     $this->db->where('branch',$br) ;
                                 $this->db->where('is_delete',0) ;
                                $class=$this->db->get('class')->result_array();
                                 }
                              foreach ($class as $value) {?>
                  
                   <option <?php if($val['class_id']==$value['class_id']){ echo "selected";} else{echo "";} ?> value="<?php echo $value['class_id']; ?>"><?php echo $value['class_name'];?></option>

                  <?php } ?>
                            </select>  

                                    </div>
                                    <div class="form-group">
                                        <label for="section">Section<span class="text-danger">*</span></label>
                                        <select class="form-control" name="section" id="section" class="form-control" style="width:100%" required>
                                      <option value="">Select Section</option>
                                  <?php       $this->db->where('is_delete',0)->where('class_id',$val['class_id']) ;
                                $sec=$this->db->get('section')->result_array();
                              foreach ($sec as $value) {?>
                  
                   <option <?php if($val['section_id']==$value['section_id']){ echo "selected";} else{echo "";} ?> value="<?php echo $value['section_id']; ?>"><?php echo $value['section_name'];?></option>

                  <?php } ?>
                                 </select>  

                                    </div>
                                    <div class="form-group">
                                          <label for="group_name">Group Name</label>
                                        <input id="group_name" name="group_name" class="form-control" type="text" placeholder="Group Name" value="<?php echo $val['class_group'];?>" >
                                    </div>
                                          <div class="form-group">
                                        <label for="section">Session<span class="text-danger">*</span></label>
                                        <select class="form-control" name="session" id="session" style="width:100%" class="form-control" required>
                                      <option value="">Select Section</option>
                                       <?php  $this->db->select('id,name');$this->db->from('session');
$this->db->where('is_delete',0);
                                $com=$this->db->get()->result_array();
                                              foreach ($com as $key => $value) {
                  ?>
                                   <option <?php if($val['session_id']==$value['id']){ echo "selected";}else {echo "";} ?> value="<?php echo $value['id'];?>"><?php echo $value['name'];?></option>

                  <?php } ?>
                                 </select>  

                                    </div>
                                    

                                 

                                </div>
                                <!-- END STEP CONTENT-->

                            </fieldset>
                        </div>
                        <!-- END STEP 3-->
                        <!-- BEGIN STEP 4-->
                        <div class=" tsf-step step-4 ">
                            <fieldset>
                                <legend>Fee Details</legend>
                                <!-- BEGIN STEP CONTENT-->
                                <div class="tsf-step-content">
                                    <div class="form-group">
                                        <label for="fee_pack">Tuition Fee</label>
                                        <input type="number" class="form-control" id="fee_pack" name="fee_pack" placeholder="Fee Package" value="0" required>
                                    </div>
                                    <div class="form-group">
                                        <label for="disc_type">Select Discount Type</label>
                                        <select class="form-control" name="disc_type" id="disc_type">
                                            <option value="1" <?php if($val['disc_type']=="1"){echo "selected";} ?>>Select Discount Type</option>
                                            <option value="percentage" <?php if($val['disc_type']=="percentage"){echo "selected";} ?> >Percentage (%)</option>
                                            <option value="rupees" <?php if($val['disc_type']=="rupees"){echo "selected";} ?> >Shillings (Ksh)</option>
                                        </select>  
                                    </div>
                                    <div class="row">
                                        <div class="form-group col-md-6 col-sm-6 col-xs-12">
                                            <label for="disc">Discount</label>
                                            <div class="row">
                                                <div class="col-md-6 col-sm-6 col-xs-6">
                                                    <p style="color:red;display:none;" id="d_msg">Value should be less than 0 and greater than 100</p>
                                                    <input type="number" min="0" max="100" name="disc_value" id="disc_per" class="form-control" <?php if($val['disc_type']=="percentage"){echo "value='".$val['disc_value']."'";}else{echo "disabled";} ?> placeholder="in %">
                                                </div>
                                                <div class="col-md-6 col-sm-6 col-xs-6">
                                                    <p style="color:red;display:none;" id="rs_msg">Value should be less than fee_pack</p>
                                                    <input type="number" min="0" name="disc_value" id="disc_rs" class="form-control" <?php if($val['disc_type']=="rupees"){echo "value='".$val['disc_value']."'";}else{echo "disabled";} ?> placeholder="in Ksh">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group col-md-6 col-sm-6 col-xs-12">
                                            <label for="net_fee">Fee Package</label>
                                            <div class="row">
                                                <div class="col-md-12 col-sm-12 col-xs-12">
                                                    <input type="number" name="net_fee" id="net_fee" class="form-control" placeholder="Fee Package" required="required">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!-- END STEP CONTENT-->
                            </fieldset>
                        </div>
                        <!-- END STEP 4-->
                        <!--</form>-->
                    
                    <!-- END CONTENT-->
                    <!-- BEGIN CONTROLS-->
                    <div class="tsf-controls ">
                        <!-- BEGIN PREV BUTTTON-->
                        <button type="button" data-type="prev" class="btn btn-left tsf-wizard-btn">
                            <i class="fa fa-chevron-left"></i> PREV
                        </button>
                        <!-- END PREV BUTTTON-->
                        <!-- BEGIN NEXT BUTTTON-->
                        <button type="button" data-type="next" class="btn btn-right tsf-wizard-btn" style="float:right;">
                            NEXT <i class="fa fa-chevron-right"></i>
                        </button>
                        
                        <!-- END NEXT BUTTTON-->
                        <!-- BEGIN FINISH BUTTTON-->
                        <button type="submit" data-type="finish" class="btn btn-right tsf-wizard-btn" style="float:right;">
                            UPDATE
                        </button>
                        <!-- END FINISH BUTTTON-->
                        
                        <!-- BEGIN CANCEL BUTTTON-->
                        <a href="<?php echo base_url();?>student/show"><button type="button" class="btn btn-right btn-lg btn-danger" style="height:52px;float:right;background-color:#ba3030">
                            <small>CANCEL</small>
                        </button></a>
                        <!-- END CANCEL BUTTTON-->
                        
                    </div>
                    
                    <!-- END CONTROLS-->
                    
                </div>
                <!-- END STEP CONTAINER -->
</form>

            </div>





                </div>
              </div>
            </div> 
          </div>
        </div>
         </div>
    </div>
    </div>
    </div>
        <!-- /page content -->

        <!-- footer content -->
        <footer>
          <div class="pull-right">
            Prudmac
          </div>
          <div class="clearfix"></div>
        </footer>
        <!-- /footer content -->
     

    <!-- 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>
    <!-- Jquery UI-daterangepicker -->
    <script src="<?php echo base_url(); ?>assets/vendors/datepicker/jquery-ui.min.js"></script>

    <!-- Custom Theme Scripts -->
    <script src="<?php echo base_url(); ?>assets/build/js/custom.min.js"></script>
 

    <!-- jQuery Smart Wizard -->
    <script src="<?php echo base_url(); ?>assets/vendors/jQuery-Smart-Wizard/js/jquery.smartWizard.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/validator/validator.js"></script>


<!--  -->
<!-- <script src="<?php echo base_url();?>assets/formwizard/js/jquery-1.11.3.min.js"></script> -->
    <script src="<?php echo base_url();?>assets/formwizard/js/demo.js"></script>

    <script src="<?php echo base_url();?>assets/formwizard/plugin/parsley/js/parsley.js"></script>

    <script src="<?php echo base_url();?>assets/formwizard/js/tsf-wizard-plugin.js"></script>
<script>
  $( function() {
    $( ".datepicker" ).datepicker({ dateFormat: 'd-m-yy' }).val();
  } );
  </script>
  <script src="<?php echo base_url()?>assets/select/js/select2.min.js"></script>
<script>
    $('#provn').select2();
    $('#district').select2();
    $('#taluka').select2();
    $('#class_id').select2();
    $('#section').select2();
    $('#session').select2();
    $('#class_admited').select2();
    $('#branch').select2();

</script>
<script>
    $(document).ready(function(){
                
        //Validation For Alpa Numeric & Additional Operator
        $(document).on("keypress",".grade", function (event) {

            var englishAlphabetAndWhiteSpace = /[A-Za-z0-9|-]/g;


            var key = String.fromCharCode(event.which);


            if (event.keyCode == 9 || event.keyCode == 32 || event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 43 || event.keyCode == 46 || englishAlphabetAndWhiteSpace.test(key)) {
                return true;
            }


            return false;
        });
        
    $(document).on("keypress",".abc",function(event){
        
            var englishAlphabetAndWhiteSpace = /[A-Za-z ]/g;


            var key = String.fromCharCode(event.which);


            if (event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 32 || event.keyCode == 95 || event.keyCode == 39 || englishAlphabetAndWhiteSpace.test(key)) {
                return true;
            }
            return false;
        });
    
    $(document).on("keyup","#disc_per",function(e){
        
            var evt = (e) ? e : window.event;
            var val = $(this).val();
            var charCode = (evt.keyCode) ? evt.keyCode : evt.which;
            if($(this).val() ) {
                if (val < 0 || val > 100) {
                $(this).val(0);
                $('#d_msg').fadeIn('400');
                setTimeout(function(){
                $('#d_msg').fadeOut('400');
                },2000);

                return false;
                }
            }
        });
        
        $(document).on("keyup","#disc_rs",function(e){
        
            var evt = (e) ? e : window.event;
            var val = $(this).val();
            var fee_pack = $('#fee_pack').val();
            var charCode = (evt.keyCode) ? evt.keyCode : evt.which;
            if($(this).val() ) {
                if (parseInt(val) < 0 || parseInt(val) > parseInt(fee_pack)) {
                $(this).val(0);
                $('#rs_msg').fadeIn('400');
                setTimeout(function(){
                $('#rs_msg').fadeOut('400');
                },2000);
                return false;
                }
            }
        });

    $(document).on("keypress",".abc1",function(event){
    
            var englishAlphabetAndWhiteSpace = /[A-Za-z0-9|-]/g;


            var key = String.fromCharCode(event.which);


            if (event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 32 || event.keyCode == 95 || event.keyCode == 39 || englishAlphabetAndWhiteSpace.test(key)) {
                return true;
            }


            return false;
        });


         //form only numbers
        $(document).on("keypress",".num",function(e){
        
            var evt = (e) ? e : window.event;
            var charCode = (evt.keyCode) ? evt.keyCode : evt.which;
            if (charCode > 31 && (charCode < 48 || charCode > 57)) {
                return false;
            }
            return true;
        });
        
        
                 //form only numbers & Other Expression
        $(document).on("keypress",".num1",function(e){
          
            var evt = (e) ? e : window.event;
            var charCode = (evt.keyCode) ? evt.keyCode : evt.which;
            if (charCode == 45 || (charCode > 47 && charCode < 58)) {
                return true;
            }
            return false;
        });

        });
       //form PHONE numbers
        $(document).on("keypress",".phone",function(e){
        
            var evt = (e) ? e : window.event;
            var charCode = (evt.keyCode) ? evt.keyCode : evt.which;
            if (charCode == 43 || (charCode > 47 && charCode < 58)) {
                return true;
            }
            return false;
        });


</script>


    <script>
        $(function () {
            pageLoadScript();
        });
    

        function pageLoadScript() {

            _stepEffect = $('#stepEffect').val();
            _style = 'style1';
            _stepTransition = $('#stepTransition').is(':checked');
            _showButtons = $('#showButtons').is(':checked');
            _showStepNum = $('#showStepNum').is(':checked');


          tsf1=  $('.tsf-wizard-1').tsfWizard({
                stepEffect: _stepEffect,
                stepStyle: _style,
                navPosition: 'top',
                validation: true,
                stepTransition: _stepTransition,
                showButtons: _showButtons,
                showStepNum: _showStepNum,
                height: 'auto',
                onNextClick: function (e, from, to, validation) {
                    $('#result').append('<br/>onNextClick from ' + from +
                        ' - to ' + to + ' validation ' + validation);
                },
                onPrevClick: function (e, from, to) {
                    $('#result').append('<br/>onPrevClick from ' + from + ' - to ' + to);
                },
                onFinishClick: function (e, validation) {
                    $('#result').append('<br/>onFinishClick validation ' + validation);
                }
            });         


        }
    </script>
<script>
         $(document).ready(function(){
                 $("#gr").on("change" ,function() {
                    var value = $(this).val();
                        $.post("<?php echo base_url(); ?>load/search_grno/"+value,{},function(data){
                        if(data=="true") {
                        $(".result").html("Reg No you entered alreday exists");
                        $("#gr").val(''); 
                        }
                        else
                        {
                            $(".result").html("");
                        
                        
                        }
                       
                        
                    }); 
                });
                   
            });
</script>

<script>
        $(document).ready(function(){
        
        $('.DMY').daterangepicker({
      	format: 'DD-MM-YYYY',
        singleDatePicker: true,
        showDropdowns: true
    	});
        
		var c_id = $("#class_admited").val();
                $.get("<?php echo base_url(); ?>load/package/"+c_id,{},function(d){
                    $("#fee_pack").val(d);
                    var v = $("#disc_type").val();
                   // alert('Value of dro selected: '+v);
                   // alert('Value of amount: '+d);
                    if(v=="percentage")
                    {
                        var val = $("#disc_per").val();
                        var sum = d - (d * (val / 100));
                        $("#net_fee").val(sum);
                    }else if(v=="rupees"){
                        var val = $("#disc_rs").val();
                        var sum = d - val;
                        $("#net_fee").val(sum);
                    }else if(v=="1"){
                        $("#net_fee").val(d);
                       // $("#disc_rs").val(0);
                       // $("#disc_per").val(0);
                    }else{
                        $("#net_fee").val(d);
                    }
                });
            $(document).on("change","#branch",function(){
                var value = $(this).val();
                 $("#class_admited").empty();
                $.get("<?php echo base_url(); ?>load/classs/role/"+value,{},function(d){
                    var pre = '<option value="">Select class</opiton>';
                    $("#class_id").html(pre+d);
                    $("#class_admited").html(pre+d);
                });
            });
            
             $(document).on("change","#section",function(){
            // var group_name = $(this).val();
             var class_admited = $("#class_admited").val();
             var section =  $(this).val();
             
               $.get("<?php echo base_url(); ?>Student/student_roll_no/"+class_admited+"/"+section,{},function(d){
                   
                    $("#roll_no").val(++d);
                    console.log(d);
                });
            // if(state >0){
            //     $("#add_other_fee").attr('disabled',false);
            // }
            // else{
            //     $("#add_other_fee").attr('disabled',true);
            // }
         });
            
            
            $(document).on("change","#class_admited",function(){
                var value = $(this).val();
                $("#section").empty();
                $.get("<?php echo base_url(); ?>load/section/role/"+value,{},function(d){
                    var pre = '<option value="">Select Section</opiton>';
                    $("#section").html(pre+d);
                });
                $.get("<?php echo base_url(); ?>load/package/"+value,{},function(d){
                    $("#fee_pack").val(d);
                    var v = $("#disc_type").val();
                    if(v=="percentage")
                    {
                        var val = $("#disc_per").val();
                        var sum = d - (d * (val / 100));
                        $("#net_fee").val(sum);
                    }else if(v=="rupees"){
                        var val = $("#disc_rs").val();
                        var sum = d - val;
                        $("#net_fee").val(sum);
                    }
                    else if(v=="1"){
                        $("#net_fee").val(d);
                    }else{
                        $("#net_fee").val(d);
                    }
                });
            });
            $(document).on("change","#district",function(){
                var value = $(this).val();
                 $("#taluka").empty();
                $.get("<?php echo base_url(); ?>load/taluka/role/"+value,{},function(d){
                    var pre = '<option value="">Select taluka</opiton>';
                    $("#taluka").html(pre+d);
                });
            });
            $(document).on("change","#disc_type",function(){
                var val = $(this).val();
                if(val=="")
                {
                    $("#disc_per").prop('disabled', true);
                    $("#disc_rs").prop('disabled', true);
                       $("#net_fee").val($("#fee_pack").val());
                        $("#disc_rs").val(0);
                        $("#disc_per").val(0);
                }else if (val=="percentage") {
                    $("#disc_per").prop('disabled', false);
                     $("#disc_rs").val(0);
                     $("#net_fee").val($("#fee_pack").val());
                    $("#disc_rs").prop('disabled', true);
                }else if(val=="rupees")
                {
                    $("#disc_per").prop('disabled', true);
                     $("#disc_per").val(0);
                     $("#net_fee").val($("#fee_pack").val());
                    $("#disc_rs").prop('disabled', false);
                }
            });
            
            $(document).on("keyup","#disc_per",function(){
                var val = $(this).val();
                var tut = $("#fee_pack").val();
                var type = $("#disc_type").val();
                if(type=="percentage")
                {
                    var ret = (tut * val) / 100;
                    var retur = tut - ret;
                    $("#net_fee").val(retur); 
                }
            });
            $(document).on("keyup","#disc_rs",function(){
                var val = $(this).val();
                var tut = $("#fee_pack").val();
                var type = $("#disc_type").val();
                if(type=="rupees")
                {
                    var retur = tut - val;
                    $("#net_fee").val(retur); 
                }
            });
        });
    </script>
    <script>
        $(document).ready(function(){
            $(document).on("change","#provn",function(){
                
                    var value = $(this).val();
                $.get("<?php echo base_url(); ?>student/district/"+value,{},function(d){
                    var pre = '<option value="">Select District</opiton>';
                    $("#district").html(pre+d);
                    var tal = '<option value="">Select Tehsil</opiton>';
                    $("#taluka").html(tal+d);
                });
            });
            
        });
    </script>
    <script>
        $(document).ready(function(){
            $(document).on("change","#district",function(){
                
                    var value = $(this).val();
                $.get("<?php echo base_url(); ?>student/taluka/"+value,{},function(d){
                    var pre = '<option value="">Select Tehsil</opiton>';
                    $("#taluka").html(pre+d);
                });
            });
            
        });
    </script>

  </body>
</html>