<style>
    .fl{
        float:left;
        display:inline-block;
        padding-left:15px;
        padding-right:15px;
    }
    form{
        display:inline-block;
    }
</style>
<div class="container mt-3 mb-3 bg-white">
    <div class="row">
        <div class="col-sm-12 pb-3">
            
            <ul class="breadcrumb mt-3">
                <li class="breadcrumb-item">
                    <a href="<?php echo base_url(); ?>Welcome">Home</a>
                </li>
                <li class="breadcrumb-item"><a href="<?php echo base_url(); ?>Management/view_staff">All Staff</a></li>
                <li class="breadcrumb-item">Update Staff Credentials</li>
            </ul>
            
            <?php
            $id=$this->uri->segment('3');
            $table="school_staff";
            $get_staff_information=$this->SchoolModel->get_item_data($id,$table);
            if($get_staff_information){
                foreach($get_staff_information as $profile_data){
            ?>
            <form method="post" action="#" id="myForm">
                <h1 class="main-heading text-center">Update Staff Login Credentials</h1><hr>
                <?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
                }
                ?>
                <div class="form-group w-50 fl">
                    <label>Name</label>
                    <input type="hidden" name="id" value="<?php echo $profile_data['id']; ?>">
                    <input type="text" name="" class="form-control" value="<?php echo $profile_data['salutation']." ".$profile_data['name']; ?>" readonly>
                </div>
                <div class="form-group w-50  fl">
                    <label>Mobile No.</label>
                    <input type="text" name="" class="form-control" value="<?php echo $profile_data['mobile_number']; ?>" readonly>
                </div>
                
                <div class="form-group w-50 fl">
                    <label>Email </label>
                    <input type="text" name="" class="form-control" value="<?php echo $profile_data['email']; ?>" readonly>
                </div>
                
                <div class="form-group w-50 fl">
                    <label>Alt. Mobile Number </label>
                    <input type="text" name="" class="form-control" value="<?php echo $profile_data['alt_mobile_number']; ?>" readonly>
                </div>
                
                <div class="form-group w-50 fl">
                    <label>Password</label>
                    <input type="text" name="password" class="form-control" required placeholder="Enter Password" >
                </div>
                
                <div class="form-group w-50 fl">
                    <label>Confirm Password</label>
                   <input type="password" name="cpassword" class="form-control" required placeholder="Confirm Password" >
                </div>
                
                <div class="form-group">
                    <button type="submit" name="update_staff_credentials" class="btn btn-sm btn-success">Submit</button>
                </div>
            </form>
            <?php
                }
            }else{
                echo "Invalid Request";
            }
            ?>
        </div>
    </div>
</div>
<script>
    $(document).ready(function(){
        document.getElementById("myForm").reset(); 
    });  
</script>