<?php
// retomando a sessão criada:
 session_start();

 ?>

<!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 perguntas WHERE '$pescliente_id' = perguntas.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>Cadastrar perguntas</h2>
        </div>
        
        
        <form action="../editar/updateperguntas.php" method="POST">

            <?php 
                                
            $pescliente_id = $_REQUEST['id'];

            echo '<input type="hidden" name="id" value='. $pescliente_id .'>';

             ?>

            <input type="text" class="form-control" id="titulo" name="titulo" value="<?php echo $row['titulo']; ?>" placeholder="Digite o titulo...">
   
            <br>

            <input type="text" class="form-control" id="subtitulo" name="subtitulo" value="<?php echo $row['subtitulo']; ?>" placeholder="Digite o subtitulo...">
   
            <br>

            <input type="text" class="form-control" id="conceito" name="conceito" value="<?php echo $row['conceito']; ?>" placeholder="Digite o conceito...">
                
            <br>
                
            <input type="text" class="form-control" id="perguntas" name="perguntas" value="<?php echo $row['perguntas']; ?>" placeholder="Digite a pergunta...">
            <br>

            <!--<h4>Qual categoria?</h4>
                <select name="id_categoria_pergunta" id="id_categoria_pergunta">
                <option value="0">Selecione</option>
                <option value="1">Efetiva</option>
                <option value="2">Direciona</option>
                <option value="3">Organiza</option>
                <option value="4">Empresa</option>
                <option value="5">Fortuna</option>
                <option value="6">Liderando</option>
            </select>-->
                
            <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);
?>

<!----FIM MODAL--->


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