<?php 
$seqUnidade=0;
if (isset($_GET["u"])){
    $seqUnidade=$_GET["u"];
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Colégio Força Máxima</title>
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
        <link href="../style.css" rel="stylesheet" type="text/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"/>
        <script src="../js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>
        <script src="../js/prefixfree-1.0.7.js" type="text/javascript"></script>
        <script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script>
        <script src="js/mainAdm.js" type="text/javascript"></script>

        <!-- 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 -->

    </head>
    <?php
    include 'conexao.php';
    ?>
    <body>


    <div class="panel panel-default" >
            <div class="alert alert-primary"><b>RELATÓRIOS | Lista de Inscrições</b></div>
            <div class="panel-body">
            
                

                <div class=" form-group col-md-5">
                    
                    <?php
                    $sql = "select * from bolsao where id > 17 order by id desc";
                    $res = mysqli_query($conexao, $sql);
                    ?>
                    <select name="bolsao" id="bolsao"  required class="form-control form-control-lg">
                        <option value="0">Selecione o Bolsão</option>
                        <?php while ($row = mysqli_fetch_array($res)) { ?>
                            <option  value="<?php echo $row["id"]; ?>"/><?php echo $row["descricao"]; ?> 
                            <?php
                            next($row);
                        }
                        ?>
                    </select>
                </div>

                <div class=" form-group col-md-5">
                    
                    <?php
                    if ($seqUnidade==0){
                    $sql = "select * from unidade where id not in(5,6,12,13) order by nome";
                    }else{
                    $sql = "select * from unidade where id in($seqUnidade) order by nome";
                    }
                    $res = mysqli_query($conexao, $sql);
                    ?>
                    <select name="unidade" id="unidade"  required class="form-control form-control-lg">
                        
                        <?php while ($row = mysqli_fetch_array($res)) { ?>
                            <option  value="<?php echo $row["id"]; ?>"/><?php echo $row["nome"]; ?> 
                            <?php
                            next($row);
                        }
                        ?>
                    </select>
                </div>

                
                <div class=" form-group col-md-2">
                 
                    <a href=""  id="btnBuscarInscritos" target="lista"  class="btn btn-default" onclick="this.href = 'inscritosPresentes.php?b='+document.getElementById('bolsao').value+'&u=' + document.getElementById('unidade').value">Buscar</a>

                </div>
            </div>



        </div>

        <iframe width="100%" height="500" name="lista" frameborder="0"></iframe>


    </body>
</html>



