<?php
include('security.php');

include('includes/header.php');
include('includes/navbar.php');
?>

<div class="container-fluid">

<!-- DataTales Example -->
<div class="card shadow mb-4">
    <div class="card-header py-3">
        <h6 class="m-0 font-weight-bold text-primary"> EDIT Admin Profile </h6>
    </div>
    <div class="card-body">
<?php 

$connection = mysqli_connect("localhost","root","","broker");
        
    if(isset($_POST['edit_btn']))   
{
    $id = $_POST['edit_id'];
    
    $query = "SELECT * FROM users WHERE id='$id' ";
    $query_run = mysqli_query($connection, $query);   
    
    foreach($query_run as $row)
    {
        ?>
        
        <form action="code.php"method="POST">
        
        <input type="hidden" name="edit_id"  value="<?php echo $row['id'] ?>">
        <div class="form-group">
            <label></label>
                <input type="hidden" name="edit_userid"  value="<?php echo $row['id'] ?>"  class="form-control" >
                 </div>
        <div class="form-group">
            <label>firstname</label>
                <input type="text" name="edit_first" value="<?php echo $row['first_name'] ?>"  class="form-control" >
                    </div>
                <div class="form-group">
                    <label>lastname</label>
                        <input type="text" name="edit_lastname" value="<?php echo $row['last_name'] ?>" class="form-control" > 
                    </div>
                <div class="form-group">
           
                
        <div class="form-group">
            <label>Email</label>
                <input type="text" name="edit_email" value="<?php echo $row['mail'] ?>" class="form-control" >
        </div>
        </div>
            
            
            <div>
             <label>Select to Block or Block</label>
            <select name="block" class="form-control">
                
            <option value="blocked">block</option>
            <option value="Unblocked">unblock</option>
                
                
            </select>
            </div>
        
                <br>
        <a href="register.php" class="btn btn-danger" >CANCEL</a>
        <button  type="submit" name="account_blockbtn"class="btn btn-primary">Update</button>
        
        </form>
        
        <?php
    }
}
?>
                
       
    </div>
</div>    

</div>
<!-- /.container-fluid -->


<?php
include('includes/scripts.php');
include('includes/footer.php');
?>