/** * Template para exibição de todos os detalhes de um evento */ use TiagoGouvea\PLib; get_header(); if (!is_user_logged_in()) { // Registrar visita $visitante = Referer::getVisitante(); // Se não for Bot, registrar no banco de visualizações de evento if (!$visitante->bot) { Referer::registrarVisitaEvento($visitante, $post->ID); } } // Precisando saber quais dados existem? /* @var $evento Evento */ $evento = get_the_evento(); //echo "<pre>";var_dump($evento);echo "</pre>"; if ($evento == null) { die('Variável $evento está null.... :('); } ?> <div class="center pull-left" style="margin-bottom:20px;"> <div id="content" class="clearfix"> <div class="content_left"> <div class=""> <h1> <a itemprop="url" href="<?php echo get_permalink($evento->id);
<?php get_header(); /* @var $inscricao Inscricao */ if (round(get_query_var('avaliacao') / 13) != get_query_var('avaliacao') / 13) { die; } $inscricao = Inscricoes::getInstance()->getById(get_query_var('avaliacao') / 13); if ($inscricao == null) { die; } if ($inscricao->id_evento != get_the_evento()->id) { die; } /* @var $evento Evento */ $questionario = $inscricao->evento()->getQuestionarioAvaliacao(); $perguntas = $questionario->getPerguntas(); ?> <div class="center pull-left" style="margin-bottom:20px;"> <div id="content" class="clearfix"> <h1><?php the_title(); ?> </h1> <p> </p> <?php if (hasFlash()) { ?> <p>Ótimo <?php echo ucfirst(mb_strtolower($inscricao->pessoa()->primeiro_nome()));
function admin_notice($evento = null) { if ($evento == null) { $evento = get_the_evento(); } if ($evento == null) { return; } // Validar evento $erros = $evento->getErros(); if ($erros['error']) { setFlashError($erros['error']); } if ($erros['warning']) { setFlashWarning($erros['warning']); } if (!hasFlashError() && !hasFlashWarning()) { return; } if (hasFlashError()) { $message = getFlashErrorString(); echo "<div class='error'> <p>{$message}</p></div>"; } if (hasFlashWarning()) { $message = getFlashWarningString(); echo "<div class='warning'> <p>{$message}</p></div>"; } }
function template_include_evento($template_path) { // O conteudo é um post type tgo_evento if (get_post_type() == 'tgo_evento') { if (is_single()) { // Obter o evento // É uma inscrição? if (get_query_var('inscricao') != null) { if ($_GET['cancelar'] != null) { // Cancelando inscrição, validar pessoa na url /* @var $inscricao Inscricao */ $inscricao = Inscricoes::getInstance()->getById($_GET['ticket']); if ($inscricao->id_pessoa != $_GET['cancelar']) { die; } $inscricao->cancelar(); } else { // Chamar wizard da inscrição (outra classe) $etapa = $_POST['etapa']; // Instanciar Wizard $idEvento = get_the_ID(); $ticket = $_GET['ticket']; $wizard = new WizardInscricao($idEvento, $ticket); // var_dump($etapa); if ($etapa != '' && $etapa >= 1) { $evento = get_the_evento(); if ($evento->fb_conversion_track) { add_action('wp_head', 'getEventoFacebookPixel'); } if ($evento->tw_conversion_track) { add_action('wp_head', 'getEventoTwConversionTrack'); } } return PLUGINPATH . '/templates/wizard-inscricao.php'; } } else { if (get_query_var('servico') && get_query_var('ticket') != null) { // Serviço de pagamento externo ControllerInscricoes::direcionarServicoPagamento(get_query_var('servico'), get_query_var('ticket')); return; } else { if (is_avaliacao()) { $template = ControllerQuestionarios::dispatcher('responder'); } else { if (is_certificado()) { ControllerInscricoes::certificado(get_query_var('certificado') / 13); return; } else { if (get_query_var('mobile') != null) { $template = 'mobile.php'; } else { if (get_query_var('aplicarDesconto') != null) { // Chamar form para aplicar desconto $template = 'wizard-desconto.php'; } else { if (get_query_var('set_meio_pagamento') != null) { // Setar meio de pagamento ControllerInscricoes::setMeioPagamento($_SESSION['id_inscricao'], $_GET['set_meio_pagamento']); return; } else { $template = 'single-tgo_evento.php'; } } } } } } } if ($template) { $template_path = templateLocate($template); } if ($template_path == null) { die("Sem template ({$template}) para inclusão."); } } } return $template_path; }