<div id="conteudo">

            <div class="container-fluid">
                <div class="row">
                    <div class="col-sm-12">
                        <header>
                            <div class="row">
                                <div class="col-sm-12">
                                    <h1 class="h2">Certificados</h1>
                                </div>
                            </div>
                        </header>

                        <div class="row formularios certificados">
                            <?php 
                            if(!empty($_SESSION[NOME_SESSAO]['usuario'])){                                                    
                            ?>
                            <div class="col-sm-6">
                                <div class="conteudo text-center">
                                    <h2 class="h3">Gerar Certificados</h2>

                                    <!-- <form action="<?=MOODLE_URL?>mod/simplecertificate/verify.php" method="POST" role="form"> -->
                                    
                                        <!-- <div class="form-group">
                                            <label for="">Informe seu CPF</label>
                                            <input type="text" class="form-control" id="">
                                        </div> -->

                                        <div class="form-group">
                                            <label for="">Selecione o Curso com certificado disponível</label>
                                            <select name="code" id="curso" class="form-control" required="required">
                                                <option value="">Selecione</option>
                                                <?=$this->options?>
                                            </select>
                                        </div>
                                    
                                        <button type="submit" onclick="geraCertificado()"  class="btn btn-orange">GERAR</button>
                                    <!-- </form> -->
                                </div>
                            </div>
                            <?php 
                            }
                            ?>
                            <div class="col-sm-6  <?= (empty($_SESSION[NOME_SESSAO]['usuario']) ? 'col-sm-offset-3' :  '') ?>">
                                <div class="conteudo text-center" >
                                    <h2 class="h3">Simples Conferência</h2>

                                    <!-- <form action="" target="_blank" method="POST" role="form"> -->
                                    
                                        <div class="form-group">
                                            <label for="">Informe o Código Verificador</label>
                                            <input type="text" name="code" class="form-control" id="code" required="">
                                        </div>
                                    
                                        <button type="submit" onclick="simplesConferencia()" class="btn btn-orange">Conferir</button>
                                    <!-- </form> -->
                                    <div id="retConfere"></div>
                                </div>
                            </div>
                        </div>

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

        </div>

        <script type="text/javascript">
            
            function geraCertificado(){
                if($('#curso').val()!=''){
                    document.location.href = $('#curso').val();
                }
            }
            function simplesConferencia(){
                if($('#code').val()!=''){
                    $.post(BASE_URL+'usuarios/confere-certificado',{'code':$('#code').val()},function(data){
                        $('#retConfere').html("<br>"+data);
                    });
                }
            }
        </script>