<!DOCTYPE html>
<html lang="PT-br">
    <?php include_once '../paginas/header.php';?>
<body>
    <?php include_once '../paginas/menu.php';?>


    <?php

// Include config file
require_once "../banco/config.php";


//$dadopesquisa = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
$pescliente_id = $_GET['id'];

// Attempt select query execution
$sql = "SELECT * FROM usuarios WHERE '$pescliente_id' = clientes.id";
if($result = mysqli_query($link, $sql)){
    if(mysqli_num_rows($result) > 0){
        while($row = mysqli_fetch_array($result)){
?>


<br>
<br>
<br>
    <div class="services-details-area default-padding">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-12">
                   <!--   <div class="col-lg-8">
                        <h2>Lista de clientes</h2>
                        
                        <br>
                      <form>
							<input name="pesquisar" id="pesquisar" class="form-control" type="text" placeholder="Pesquisar"><br>
							<input class="btn btn-success pull-right"  type="submit" value="Pesquisar / Limpar pesquisa"><br>
                            <br>
                            <br>
						</form>
                    </div>-->


<!----modallll----->

<div class="blog-area single full-blog full-blog default-padding-forms">
<div class="container">
        <div class="form-title text-center">
            <h2>Editar cliente</h2>
        </div>
        
        
        <form action="../editar/updatecliente.php" method="POST">

            <?php 
            
            $pescliente_id = $_REQUEST['id'];
            
            echo '<input type="hidden" name="id" value='. $pescliente_id .'>';
            
             ?>

           
            <input type="text" class="form-control" id="nome" name="nome" value="<?php echo $row['nome']; ?>" placeholder="Digite o nome do cliente...">
                
            <br>
                
            <input type="text" class="form-control" id="sobrenome" name="sobrenome" value="<?php echo $row['sobrenome']; ?>"  placeholder="Digite o sobrenome do cliente...">
                
            <br>
            <br>
            <button class="btn circle btn-theme border btn-sm" value="Cadastrar" type="submit" name="CadUsuario">Enviar</button>
        

        </form>
    
        <br>
        <br>


        
        </div>
        </div>


        <?php 

        }
        // Free result set
        mysqli_free_result($result);
        } else{
            echo '<div class="alert alert-danger"><em>No records were found.</em></div>';
        }
        } else{
        echo "Oops! Something went wrong. Please try again later.";
        }

        // Close connection
        mysqli_close($link);
        ?>

        </div>
     </div>        
 </div>
</div>
<?php include_once '../paginas/foorter.php';?>
</body>
</html>

