<?php 
$title="Update Fee Head";
$id=$this->uri->segment("3");
$table="fee_heads";
$get_fee_head_info=$this->NewFeeModel->get_item_data($id,$table);
if($get_fee_head_info){
    foreach($get_fee_head_info as $fee_head){
        $status=$fee_head['status'];
?>
<div class="container-fluid bg-white mt-3 mb-3">
    <div class="row">
        <div class="col-sm-12 pt-3 pb-3">
            <ul class="breadcrumb">
                <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/heads">Fee Heads</a></li> 
                <li class="breadcrumb-item">Edit Fee Head Information</li> 
            </ul>
            
            <form method="post" class="form-outer">
                <div class="w_100">
                    <p class="font-weight-bold">Update Fee Head</p>
                    <hr>
                    <?php
                    if($success){
                    ?>
                    <p class="alert alert-success"><?php echo $success;?></p>
                    <?php
                    }

                    if($error){
                    ?>
                    <p class="alert alert-danger"><?php echo $error; ?></p>
                    <?php
                    }
                    ?>
                        
                    <div class="form-group w-50">
                        <label>Fee Head Name</label>
                        <input type="hidden" name="id" value="<?php echo $id; ?>">
                        <input type="hidden" name="academic_session" value="<?php echo $this->session->userdata("acedemic_session"); ?>">
                        <input type="text" class="form-control" name="fee_head" placeholder="Fee Head Name" value="<?php echo $fee_head['title']; ?>" required>
                    </div>

                    <div class="form-group w-50">
                        <label>Fee Type</label>
                        <select name="fee_type" class="form-control" required>
                            <option value="">-- select fee type --</option>
                            <option value="yearly" <?php if($fee_head['fee_type'] == "yearly"){ echo "selected"; } ?>>Yearly</option>
                            <option value="monthly" <?php if($fee_head['fee_type'] == "monthly"){ echo "selected"; } ?>>Monthly</option>
                        </select>
                    </div>
                    <div class="form-group w-100">
                        <label>Status</label>
                        <select class="form-control" name="status" required>
                            <option value="">--- SELECT STATUS ---</option>
                            <option value="1" <?php if($status  == 1){ echo "selected"; } ?> >Active</option>
                            <option value="0" <?php if($status  == 1){ echo "selected"; } ?> >Inactive</option>
                        </select>
                    </div>
                    <div class="form-group w-50">
                        <input type="submit" name="update_fee_head" class="btn btn-sm btn-info" value="<?php echo $title; ?>">
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<?php
    }
}
?>