<!DOCTYPE html>
<html lang="pt-br">

<head>

  <!-- Metas Tags -->
  <?php include "includes/verifica.php"; ?>

  <!-- Metas Tags -->
  <?php include "../_assets/inc/metas.php"; ?>

  <!-- Title -->
  <?php include "../_assets/inc/title_adm.php"; ?>

  <!-- Head -->
  <?php include "../_assets/inc/head.php"; ?>

  <!-- Style DataTables -->
  <?php include "../_assets/inc/datatablesStyles.php"; ?>
  
  <!-- JS -->
  <?php include "../_assets/inc/js.php"; ?>
  <?php $_SESSION['filtro'] = ""; ?>

  <!-- bootstrap-daterangepicker -->
  <link href="../_assets/js/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">

  <script type="text/javascript" src="includes/js/manterRelatorios.js"></script>

  <style type="text/css">

  div#reportrange b.caret{
    float: right!important;
    margin-top: 8px!important;
  }

  div#divTipoMotivo{
    margin-bottom: 7px!important;
  }

  div#reportrange2 b.caret{
    float: right!important;
    margin-top: 8px!important;
  }
  .avatarImg{
    max-width: 170px;
  }
  span.input-group-addon.addonCpf{
    cursor: pointer;
    height: 34px!important;
  }

  .dataTables_processing{
    display: none!important;
  }

  td.details-control {
    background: url('images/plus.png') no-repeat center center;
    cursor: pointer;
    background-size: 25px 25px;
  }
  tr.shown td.details-control {
    background: url('images/minus_02.png') no-repeat center center;
    cursor: pointer;
    background-size: 25px 25px;

  }


</style>

</head>

<body class="nav-md">
  <div id="maskLoad"></div>
  <div class="container body">
    <div class="main_container">

      <?php include "includes/menu.php"; ?>

      <div class="right_col" role="main">

        <p class="text-center"><img  id="loadPublicacao" src="../_assets/images/gif/loading.gif" style="max-width: 150px; display:scroll;position:fixed;right: 0px; bottom: 0px; z-index: 10; display: none;"></p>
        <div class="">

          <div class="page-title">
            <div class="title_left">
              <h3>Relatórios</h3>
            </div>
            <div class="title_right">
              <div class="col-md-5 col-sm-5 col-xs-12 form-group pull-right top_search">
                <div class="input-group">

                </div>
              </div>
            </div>
          </div>
          <div class="clearfix"></div>

          <div class="row">

            <div class="col-md-12 col-sm-12 col-xs-12">
              <div class="x_panel">
                <div class="x_title">
                  <h2>Utilize o filtro para gerar os relatórios <small>*Uso do sistema</small></h2>
                  <ul class="nav navbar-right panel_toolbox">
                    <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                    </li>
                    <li class="dropdown">
                      <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
                      <ul class="dropdown-menu" role="menu">
                        <li><a href="#">Settings 1</a>
                        </li>
                        <li><a href="#">Settings 2</a>
                        </li>
                      </ul>
                    </li>
                    <li><a href="#"><i class="fa fa-close"></i></a>
                    </li>
                  </ul>
                  <div class="clearfix"></div>
                </div>
                <div class="x_content">

                  <form id="formFiltro" target="_blank" action="relatorios-in.php" method="POST" data-parsley-validate class="form-horizontal form-label-left">
                    <div class="col-md-4 col-sm-6 col-xs-12">
                      <div class="form-group">
                        
                        <!--<div class="radio">
                          <label class="">
                            <div class="iradio_flat-green">
                              <input type="radio" class="flat" value="1" name="iCheck">
                              
                            </div> Ranking por Aluno
                          </label>
                        </div>-->

                        <div class="radio">
                          
                            <select id="simulado" name="simulado" class="form-control" required>
                            <?php
                              try {

                                $sql = $pdo->prepare("SELECT DISTINCT s.simu_id, s.simu_titulo, t.turma_id, t.turma_titulo 
                                                      FROM simulados s, turma t, simulado_turma st 
                                                      WHERE s.simu_status = 1 
                                                      AND s.simu_id = st.simulado_id 
                                                      AND t.turma_id = st.turma_id 
                                                      ORDER BY t.turma_id, s.simu_id ASC");
                                $sql->execute();
                                $result=$sql->fetchAll(PDO::FETCH_ASSOC);//FETCH_ASSOC
                      
                              } catch (Exception $e) {
                                echo $e->getMessage();
                              }
                      
                            ?>

                            <? foreach ($result as $key => $value) { ?>
                            <option value="<?=$value['simu_id']?>"><?=$value['turma_titulo']?> - <?=$value['simu_titulo']?></option>
                            <? } ?>
                          </select>
                              
                        </div>

                        <!--<div class="radio">
                          <label class="">
                            <div class="iradio_flat-green" >
                              <input type="radio" class="flat" value="3" name="iCheck" >
                              
                            </div> Notas por curso
                          </label>
                        </div>-->

                      </div>
                    </div>

                    
                    <div class="form-group">
                      <div class="col-md-12 col-sm-12 col-xs-12">
                        <button type="submit" id="btnFiltro" class="btn btn-success" style="margin-top: 10px; margin-left: 25px">Gerar Relatório</button>
                      </div>
                    </div>

                  </form>

                </div>
              </div>
            </div>

          </div>
        </div>
      </div>

    </div>
  </div>


  <?php include "includes/alertas.php"; ?>
  <?php include "../_assets/inc/datatables.php"; ?>
  <?php include "../_assets/inc/js_footer.php"; ?>

  <script src="../_assets/js/bootstrap-daterangepicker/daterangepicker.js"></script>

</body>

</html>
