<?php 
session_start();
if (!isset($_SESSION["nome"])) {
    header("location:index.php");
} else {
    
}

$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 rel="icon" href="../images/favicon.ico" ></link>
        <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">



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

        <style type="text/css">
            <!--
            body,td,th {
                font-family: Verdana, Geneva, sans-serif;
                font-size: 12px;
            }
            -->
        </style>
    </head>
    <?php
    include 'conexao.php';
    ?>
    <body>
        <div  >

           <div class="panel panel-default" >
            <div class="alert alert-primary"><b>NOTAS | Lançar notas</b></div>
            <div class="panel-body">


                  <div class=" form-group col-md-3">
                    <?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-3">
                        <?php
                    if ($seqUnidade==0){
                    $sql = "select * from unidade  order by nome";
                    }else{
                    $sql = "select * from unidade where id in($seqUnidade) order by nome";
                    }
                   // echo $sql;
                        $res = mysqli_query($conexao, $sql);
                        ?>
                          
                            <select name="unidade" id="unidade" onchange="filtrarSerie()" required class="form-control form-control-lg">
                                <option value="">Todas as unidades</option>
                                <?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-3">
                        
                        <select class="form-control form-control-lg" name="seie" id="serie" required>
                                <option value="">Todos os cursos</option>
                        </select>
                    </div>
                   <!-- <div class="form-group col-md-3">
                        <label class="label-" for="turno">Turno</label>
                        <select class="form-control" name="turno" id="turno" required>
                            <option value="">Selecione</option>
                            <option value="M">Manhã</option>
                            <option value="T">Tarde</option>
                        </select>

                    </div>-->

              
                <div class="form-group col-md-2">
                    <center>   
                        <a href="" target="notas"  class="btn btn-default" onclick="this.href = 'listaInscritos.php?b='+document.getElementById('bolsao').value+'&u=' + document.getElementById('unidade').value + '&s=' + document.getElementById('serie').value ">BUSCAR</a>

                    </center>
                </div>

            </div>

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

    </body>
</html>



