87 lines
3.2 KiB
PHP
87 lines
3.2 KiB
PHP
<?php
|
|
|
|
function apoio_aereo() {
|
|
|
|
if (!is_user_logged_in())
|
|
{
|
|
$out = '<hr><br><h3>ACESSO EXCLUSIVO PARA USUÁRIOS CADASTRADOS </h3>';
|
|
$out .= '<p>Faça seu <a href="https://www.sige.ita.br/log-in/">LOGIN</a> ou Realize seu <a href="https://www.sige.ita.br/home-registro/">CADASTRO</a> agora mesmo.</p><br><hr>';
|
|
return $out;
|
|
}
|
|
|
|
$usr = wp_get_current_user();
|
|
$usr_info = get_userdata( $usr->ID );
|
|
$militar = get_metadata('user', $usr->ID, 'militar', true);
|
|
/*if ($militar != "Sim")
|
|
{
|
|
$out = '<br><h5>Formulário exclusivo para Militares.</h5><br>';
|
|
return $out;
|
|
}*/
|
|
|
|
$out = '<h3>SOLICITAÇÃO DE APOIO AÉREO PARA O SIGE, EGED, SERFA/IVR 2022</h3><hr>';
|
|
|
|
//$out .= '<hr style="height:1px;border:none;color:#e3e3e3;background-color:#e3e3e3"/>';
|
|
//$out .='<br><h5 style="text-align: center;"><strong>EM BREVE MAIS INFORMAÇÕES</strong></h5>';
|
|
|
|
|
|
/*if ( !in_array( 'administrator', (array) $usr->roles ) )
|
|
{
|
|
if ($usr->user_email != "andrekuros@gmail.com") return $out;
|
|
else $out .= "<br>Acesso Email específico";
|
|
}else $out .= '<br><br><h5>Acesso temporário para desenvolvimento (SÓ ADMINISTRADORES)</h5><br>';/*
|
|
|
|
*/
|
|
//return $out;
|
|
|
|
$events = array( array("name"=>"SIGE Presencial" , "cod" => "presencial2022"),
|
|
array("name"=>"EGED Presencial", "cod"=>"eged_presencial"),
|
|
array("name"=>"IVR Presencial", "cod"=>"ivr_presencial"),
|
|
array("name"=>"SERFA_IVR Presencial", "cod"=>"serfa_presencial")
|
|
);
|
|
|
|
$solicitada = False;
|
|
|
|
foreach ($events as $e)
|
|
{
|
|
$status = get_metadata('user', $usr->ID, $e["cod"], true);
|
|
if ($status == "") $status = "Não Solicitada";
|
|
if ($status == "Solicitar Participação") $status = "Participação Solicitada";
|
|
if ($status == "Participação Solicitada" || $status == "Participação APROVADA")
|
|
$solicitada = True;
|
|
}
|
|
if ($solicitada != True)
|
|
{
|
|
$out .= '<div><strong>Resumo das minhas inscrições:</strong>';
|
|
$out .= '<hr style="height:1px;border:none;color:#e3e3e3;background-color:#e3e3e3"/>';
|
|
foreach ($events as $e)
|
|
{
|
|
$status = get_metadata('user', $usr->ID, $e["cod"], true);
|
|
if ($status == "") $status = "Não Solicitada";
|
|
if ($status == "Solicitar Participação") $status = "Participação Solicitada";
|
|
$out .= '<strong>' . $e["name"] .'</strong>' . " => " . $status . '<br>';
|
|
}
|
|
$out .= '<hr style="height:1px;border:none;color:#e3e3e3;background-color:#e3e3e3"/>';
|
|
$out .= "<br><strong>Você precisa ter solicitado a participação presencial em ao menos um evento para requisitar apoio aéreo.</strong>";
|
|
return $out;
|
|
}
|
|
|
|
|
|
$out .= do_shortcode('[contact-form-7 id="5490" title="Apoio Aéreo SIGE 2022"]');
|
|
return $out;
|
|
}
|
|
add_shortcode('apoio_aereo', 'apoio_aereo');
|
|
|
|
|
|
function confirmacao() {
|
|
|
|
if (!is_user_logged_in())
|
|
{
|
|
$out = '<hr><br><h3>ACESSO EXCLUSIVO PARA USUÁRIOS CADASTRADOS </h3>';
|
|
$out .= '<p>Faça seu <a href="https://www.sige.ita.br/log-in/">LOGIN</a> ou Realize seu <a href="https://www.sige.ita.br/home-registro/">CADASTRO</a> agora mesmo.</p><br><hr>';
|
|
return $out;
|
|
}
|
|
}
|
|
|
|
add_shortcode('confirmacao', 'confirmacao');
|
|
|
|
?>
|