<?php
session_start();
require_once 'gerador/MysqlConsulta.php';
require "script_php/conexao.php";

$mysql = new MysqlConsulta();
$dados = $mysql->buscarRecorrencia($conexao);
$sangria = $_GET['sangria'];

?>

<!DOCTYPE html>
<html>
<head>

<?php include_once 'head.html'; ?>

<title></title>
</head>

<body>

<?php include_once 'header.php'; ?>

<h2> <svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" fill="currentColor" class="bi bi-box-arrow-down-right" viewBox="0 0 16 16">
  <path fill-rule="evenodd" d="M8.636 12.5a.5.5 0 0 1-.5.5H1.5A1.5 1.5 0 0 1 0 11.5v-10A1.5 1.5 0 0 1 1.5 0h10A1.5 1.5 0 0 1 13 1.5v6.636a.5.5 0 0 1-1 0V1.5a.5.5 0 0 0-.5-.5h-10a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h6.636a.5.5 0 0 1 .5.5"/>
  <path fill-rule="evenodd" d="M16 15.5a.5.5 0 0 1-.5.5h-5a.5.5 0 0 1 0-1h3.793L6.146 6.854a.5.5 0 1 1 .708-.708L15 14.293V10.5a.5.5 0 0 1 1 0z"/>
</svg>  ESCOLHER A RECORRÊNCIA </h2>

<section>
<form action="script_php/baixaRecorrenciaAutomatica.php" method="post">



<input type="text" name="sangria" value="<?= $sangria ;?>" class ="form-control form_forn" readonly > <p> <p> 

<select name="recorrencia" id="recorrencia" class="form-control form_forn">
    <?php
    // usa o $dados que já está definido no escopo
    foreach ($dados as $dados2) {
        echo "<option value='{$dados2['ID']}'>{$dados2['OBSERVACAO']}</option>";
    }
    ?>
</select>




<p></p>
<P></P>

<span class="text-danger">
SELECIONE AQUI CASO SEJA UMA SANGRIA E NAO UMA DESPESA ->
</span>


<input  class="form-check-input" type="checkbox" value="1" name='sangriadeposito'  >

</p>


<button type="submit" class="btn btn-success"> Cadastrar recorrência </button>

</form>

</section>


<?php include_once 'footer.php'; ?>