<?php
$tid=$this->uri->segment('3');
$teacher_profile_data =$this->SchoolModel->teacher_profile($tid);

if($teacher_profile_data){
    foreach($teacher_profile_data as $records){ 
?>

<div class="container mt-3 mb-3 pt-3 pb-3 bg-white">
    <div class="row">
        <div class="col-sm-12">
            <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();?>school/profile">Profile</a></li>
                <li class="breadcrumb-item">Update Bank Information</li>
            </ul>
            
            <form method="post" action="#">
                <?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
                }
                ?>
                <input type="hidden" value="<?php echo $records['id'];?>" name="tid">
                <div class="form-group">
                    <label>Name : <span><?php echo form_error('name');?></span></label>
                    <input type="text" name="teacher_name" value="<?php echo $records['salutation']; echo " "; echo $records['name'];?>" class="form-control" placeholder="Your Name" readonly>
                </div>

                <div class="form-group">
                    <label>Father Name : <span><?php echo form_error('father_name');?></span></label>
                    <input type="text" name="father_name" value="<?php echo $records['father_name'];?>" class="form-control" placeholder="Father's Name" readonly>
                </div>
                
                <div class="form-group">
                    <label>Bank Name : <span><?php echo form_error('bank_name');?></span></label>    
                    <input type="text" class="form-control" id="bank-name" name="bank_name" value="<?php echo $records['bank_name'];?>" placeholder="Bank Name">
                </div>
                <div class="form-group">
                    <label>IFSC  Code : <span><?php echo form_error('ifsc_code');?></span></label>    
                    <input type="text" class="form-control" id="ifsc_code" name="ifsc_code" value="<?php echo $records['ifsc'];?>" placeholder="IFSC Code">
                </div>
                <div class="form-group">
                    <label>Account Number : <span><?php echo form_error('account_number');?></span></label>
                    <input type="number" class="form-control" id="account_number" name="account_number" value="<?php echo $records['account_no'];?>" placeholder="Account Number">
                </div>

                <div class="form-group">
                    <label>Branch Address <span><?php echo form_error('branch_address');?></span></label> 
                    <textarea type="text" name="branch_address" rows="2" id="branch_address" class="form-control" value="<?php echo $records['branch_address'];?>" placeholder="Branch Address"><?php echo $records['branch_address'];?></textarea>
                </div>

                <div class="form-group">
                    <button type="submit" name="update_bank_information" class="btn btn-sm btn-success">Update Contact Information</button>
                </div>
                
            </form>
        </div>
    </div>
</div>

<?php
    }
}
?>