<?php
$sid=$this->uri->segment('3');
?>

<div class="container bg-white mt-3 mb-3 p-3">
    <div class="row">
        <div class="col-sm-12">
            

            <ul class="breadcrumb">
                <li class="breadcrumb-item"><?php echo $this->session->userdata('ac_year'); ?></li> 
                <li class="breadcrumb-item"><a href="<?php echo base_url(); ?>Welcome">Home</a></li> 
                <li class="breadcrumb-item"><a href="<?php echo base_url(); ?>Fee/all_students">All Student</a></li> 
                <li class="breadcrumb-item">Pay Fee</li> 
            </ul> 

    
<div class="pt-3 pb-3">
<table class="table table-bordered table-striped">
<?php
$sid=$this->uri->segment('3');
$course='';
// $acedemic_session=2;
$acedemic_session=$this->session->userdata('acedemic_session');
$table='student';
$get_student_data=$this->NewFeeModel->get_item_data($sid,$table);
if($get_student_data){
foreach($get_student_data as $data){
$course=$data['class'];

?>
<tbody>
<tr>
<th>Name
<input type="hidden" id="sch_no" value="<?php echo $data['sch_no'];?>">
</th>
<td id="sid" value="<?php echo $data['id'];?>"><?php echo $data['student_name'];?></td>
</tr>
<tr>
<th>Faather's Name</th>
<td><?php echo $data['father_name'];?></td>
</tr>

<tr>
<th>Contact Number</th>
<td><?php echo $data['contact_no'];?></td>
</tr>

<tr>
<th>Class</th>
<td><?php echo $data['class'];echo "-"; echo $data['section'];?></td>
</tr>

</tbody>
<?php
}
}
?>
</table>
</div>            
            <?php
            $check_opening_balance=$this->OpeningBalanceModel->check_opening_balancce($sid);
            if($check_opening_balance){
                foreach($check_opening_balance as $opening_balance){
                    
                }
            }    
            ?>
            <div class="">
              <?php
              if($success){
                  ?>
                  <div class="alert alert-success"><?php echo $success;?></div>
                  <?php
              }
              
              if($error){
                  ?>
                  <div class="alert alert-danger"><?php echo $error;?></div>
                  <?php
              }
              
              ?>  
                <form method="post">
                    <div clss="form-group">
                        <label>Fee Amount </label>
                        <input type="hidden" name="sid" class="form-control" value="<?php echo $sid;?>">
                        <input type="number" class="form-control" name="opening_fee_amount" placeholder="Opening Fee Amount" value="<?php echo $opening_balance['opening_fee_amount']; ?>">
                    </div>    
                    <div class="form-group">
                        <label>Fee Note</label>
                        <input type="text" class="form-control" name="fee_note" placeholder="Fee Note" value="<?php echo $opening_balance['fee_note'];?>">
                    </div>

                    <div class="form-group">
                        <input type="submit" name="update_opening_balance_submit" class="btn btn-sm btn-success" value="Update Opening Balance">
                    </div>
                </form>  
            </div>
            
        </div>
    </div>
</div>