<?php

include('public/functions.php');


$qry = "SELECT * FROM tbl_inscricoes WHERE id_promocao = '" . $_GET['idpromocao'] . "' ";
$result = mysqli_query($connect, $qry);

setlocale(LC_TIME, 'pt_BR', 'pt_BR.utf-8', 'pt_BR.utf-8', 'portuguese');
date_default_timezone_set('America/Sao_Paulo');


?>

<!-- START CONTENT -->
<section id="content">

    <!--breadcrumbs start-->
    <div id="breadcrumbs-wrapper" class=" grey lighten-3">
        <div class="container">
            <div class="row">
                <div class="col s12 m12 l12">
                    <h5 class="breadcrumbs-title">Participantes</h5>
                    <ol class="breadcrumb">
                        <li><a href="dashboard.php">Dashboard</a>
                    </ol>
                </div>
            </div>
        </div>
    </div>
    <!--breadcrumbs end-->

    <!--start container-->
    <div class="container">
        <div class="section">
            <div class="row">
                <div class="col s12 m12 l12">
                    <div class="card-panel">
                        <div class="row">
                            <?php if (isset($_SESSION['msg'])) { ?>
                                <div class='card-panel teal lighten-2'>
                                    <span class='white-text text-darken-2'><?php echo $_SESSION['msg'] ?></span>
                                </div>

                                <?php unset($_SESSION['msg']);
                            } ?>

                            <div class="col s12 m12 l12">
                                <table>
                                    <thead>
                                    <tr>
                                        <th>Nome</th>
                                        <th>Email</th>
                                        <th>CPF</th>
                                        <th>Celular</th>
                                        <th>Data de Nascimento</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <?php while ($data = mysqli_fetch_object($result)) { ?>
                                        <tr>
                                            <td><?php echo $data->nome ?></td>
                                            <td><?php echo $data->email ?></td>
                                            <td><?php echo $data->cpf ?></td>
                                            <td><?php echo $data->celular ?></td>
                                            <td><?php echo $data->nascimento ?></td>
                                        </tr>
                                    <?php } ?>
                                    </tbody>
                                </table>
                            </div>

                        </div>
                    </div>

                </div>

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

</section>
