<?php
include 'conexao.php';
$id = $_GET['id'];
if ($id <> '') {
    $sql = "select * from bolsao where id=$id";
} else {
    $sql = "select * from bolsao where id=0";
}
$res = mysqli_query($conexao, $sql);
$row = mysqli_fetch_array($res);
?>
<!DOCTYPE html>
<html lang="pt-BR">
    <head>

        <meta charset="utf-8"/>
        <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
        <meta name="viewport" content="width=device-width, initial-scale=1"/>
        <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
        <meta name="description" content="Administração do Bolsão"/>
        <meta name="author" content="Vinícius"/>
        <!--    <link rel="icon" href="../../favicon.ico">-->

        <title>Administração do Bolsão Força Máxima</title>
        <link rel="icon" href="../images/favicon.ico" />

        <!-- Bootstrap core CSS -->
        <link href="../css/bootstrap.css" rel="stylesheet"/>
        <link href="../css/bootstrap-theme.min.css" rel="stylesheet"/>
        <link href="../css/bootstrap.min.css" rel="stylesheet"/>



        <!-- IE10 viewport hack for Surface/desktop Windows 8 bug 
        <link href="../../assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">-->

        <!-- Custom styles for this template -->
        <link href="../css/main.css" rel="stylesheet"/>
        <link href="../style.css" rel="stylesheet"/>
        <script  language="javascript" type="text/javascript" src="../js/jquery-1.7.1.min.js"></script>
        <script  language="javascript" type="text/javascript" src="../js/main.js"></script>
        <script  language="javascript" type="text/javascript" src="../js/bootstrap.js"></script>


    </head>

    <body>
        <form action="addBolsao.php" method="post" enctype="multipart/form-data">
            <input hidden name="id" id="id" value="<?php echo $row['id'] ?>"/>
            
            <div class="col-md-8 form-group">
                <label class="label-" for="descricao">Descrição</label>  
                <input type="text" id="descricao" class="form-control" name="descricao" value="<?php echo $row['descricao'] ?>"/>
            </div>
            <div class="col-md-4 form-group">
                <label class="label-" for="valor">Valor</label>  
                <input type="number" step="any" id="valor" class="form-control" name="valor" value="<?php echo $row['valor'] ?>"/>
            </div>
            <div class="col-md-4 form-group">
                <label class="label-" for="descricao">Início da Inscrição</label>  
                <input type="date" id="inicioInscricao" class="form-control" name="inicioInscricao" value="<?php echo $row['data_inicio_inscricao'] ?>"/>
            </div>
            <div class="col-md-4 form-group">
                <label class="label-" for="descricao">Fim da Inscrição</label>  
                <input type="date" id="fimInscricao" class="form-control" name="fimInscricao" value="<?php echo $row['data_fim_inscricao'] ?>" />
            </div>
            <div class="col-md-4 form-group">
                <label class="label-" for="descricao">Data da Prova</label>  
                <input type="date" id="dataProva" class="form-control" name="dataProva" value="<?php echo $row['data_prova'] ?>" />
            </div>
            <div class="form-group col-md-12">
                <input type="file"  id="arquivo" name="arquivo"/>
            </div>
            <center>
                <input class="btn btn-default" type="submit" name="btnSalvarNovoBolsao" id="btnSalvarNovoBolsao" value="Salvar"/>
                <a href="cadastroBolsao.php"><input type="button" class="btn btn-default"  name="btnVoltarNovoBolsao" id="btnVoltarNovoBolsao" value="Cancelar" /></a>
            </center>  

        </form>

    </body>
</html>