<?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 Contact 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>Mobile No : <span><?php echo form_error('mobile_number');?></span></label>
                    <input type="number" name="mobile_number" value="<?php echo $records['mobile_number'];?>" class="form-control">
                </div>



                <div class="form-group">
                    <label>Alternate Mobile No : <span><?php echo form_error('alt_mobile_number');?></span></label>
                    <input type="number" name="alt_mobile_number" value="<?php echo $records['alt_mobile_number'];?>" class="form-control">
                </div>

                <div class="form-group">
                    <label>Email : <span><?php echo form_error('email');?></span></label>
                    <input type="email" name="email" value="<?php echo $records['email'];?>" class="form-control" placeholder="Email">
                </div>

                <div class="form-group">
                    <label>Current Address : <span><?php echo form_error('address');?></span></label>
                    <textarea name="address" id="address" rows="4" class="form-control" placeholder="Current Address"><?php echo $records['address'];?></textarea>
                </div> 

                <div class="form-group">
                    <label>Permanent Address : <span><?php echo form_error('permanent_address');?></span></label>
                    <textarea name="permanent_address" id="permanent_address" rows="4" class="form-control" placeholder="Permanent Address"><?php echo $records['permanent_address'];?></textarea>
                </div> 
                
                <div class="form-group">
                    <button type="submit" name="update_contact_information" class="btn btn-sm btn-success">Update Contact Information</button>
                </div>
                
            </form>
        </div>
    </div>
</div>

<?php
    }
}
?>