Files

99 lines
5.3 KiB
PHP

<?php
function EN_ivr_user_viewer() {
if (!is_user_logged_in())
{
$out = '<hr><br><h1>EXCLUSIVE ACCESS FOR REGISTERED USERS </h1>';
$out .= '<p>Log in to the website: <a href="https://www.sige.ita.br/log-in/">LOGIN</a> or complete your registration right now: <a href="https://www.sige.ita.br/cadastro_en/">REGISTRATION</a>.</p><br><hr>';
return $out;
}
$usr = wp_get_current_user();
$usr_info = get_userdata( $usr->ID );
$out = '<h1>IV INTELLIGENCE, SURVEILLANCE, AND RECONNAISSANCE WORKSHOP</h1><hr>';
$out .= '<br><p>This years IVR Workshop will be held at the ITA facilities in São José dos Campos-SP. The event will be integrated into SIGE, allowing participants to follow discussions on various other defense-focused topics.</p><br>';
$out .= '<p>The event will include sessions open to the general public and sessions with restricted access. Therefore, if you do not have a security pass beforehand, please provide it at a reserved confidentiality level in order to have full access to the Workshop. The Organizing Committee points out the guidelines contained in FCA 200-6/2013, item 2.12.5.</p><br>';
$out .= '<p style="line-height: 100%; margin-left: 1.3cm; margin-bottom: 0cm; background: transparent; page-break-before: auto">2.12.5 Bearing in mind that the selection process to occupy a position, function and rank or grade presupposes a compatible investigation for access to classified information, the following are considered accredited in advance, until the due process is completed, at the rank of:</p>';
$out .= '<p style="line-height: 100%; margin-left: 1.3cm; margin-bottom: 0cm; background: transparent; page-break-before: auto"><strong>reservado</strong>: Senior Officers, Intermediate Officers, Subaltern Officers, Aspiring Officers of the Air Force, as well as civilian employees similar to them, assigned to COMAER and Graduates of the Air Force, as well as civilian employees similar to them, assigned to COMAER..</p>';
//////Adicionar questão sobre credencial//////////////////////
if (isset($_POST["atualizar_credencial"]))
{
$radioVal = $_POST["serfa_ivr_credencial"];
update_user_meta( $usr->ID, "serfa_ivr_credencial", $radioVal);
}
$out .= '<iframe name="page1" style="display:none;"></iframe>';
$out .= '<form id="frm" method="post" target="page1" >';
$out .= '<br>In order for us to approve your registration for the IVR WorkShop, please confirm that you have a <strong>SECURITY CREDENTIAL</strong>:<br><br>';
$out .= '<div style="padding: 2px; display: inline-block;" id="btn_cred">';
$options = array("Yes", "No", "I dont know");
$user_selection = get_metadata('user', $usr->ID, 'serfa_ivr_credencial', true);
foreach ($options as $opt){
if ($opt == $user_selection)
$out .= '<input type="radio" name="serfa_ivr_credencial" value="'.$opt. '" checked / >' . $opt;
else
$out .= '<input type="radio" name="serfa_ivr_credencial" value="'.$opt. '" / >' . $opt;
}
$out .= '&nbsp &nbsp <button type="submit" name="atualizar_credencial" onclick="displayRadioValue()"> Save </button> </div>';
$out .= '<div style="padding: 2px; display: inline-block" id="result"></div><br>';
$out .= '<script> function displayRadioValue() {
var val = document.getElementsByName("serfa_ivr_credencial");
for(i = 0; i < val.length; i++)
{
if(val[i].checked)
{
document.getElementById("result").innerHTML = "<span style=\"color:blue;\"> Updated!</span>";
setTimeout(function(){
document.getElementById("result").innerHTML="";
},2500);
}
}
}
</script><br></form>';
$out .= '<br><p>The General Coordinator of the IVR Workshop, Lt Col QOEFOT <strong>ROBERT</strong> CARDOSO FERNANDES DE ALMEIDA, Head of COMPREPs Image Analysis Section, is available to answer any questions you may have by emailing robertrcfa@fab.mil.br and calling 061 3364-8922.</p><br>';
$out .= '<hr style="height:1px;border:none;color:#e3e3e3;background-color:#e3e3e3"/>';
$out .= '<hr style="height:4px;border:none;color:white;background-color:white"/>';
////////////////////////////////////////////////////////////////////
//Adicionar Botão para participação IVR e SERFA/////////////
$user_selection = get_metadata('user', $usr->ID, 'serfa_ivr_credencial', true);
if ($user_selection =="")
{
$out .= '<strong><span style="color:red"> ATTENCION: </span></strong>';
$out .= '<p>You have not yet confirmed whether you have a <strong>SECURITY CREDENTIAL<strong>. By confirming this information, you will be able to register for the IVR Workshop.</p>';
}
else
{
$btn_name_ivr = 'ivr_presencial';
if (isset($_POST[$btn_name_ivr]))
{
update_user_meta( $usr->ID, $btn_name_ivr, $_POST[$btn_name_ivr]);
//Role "inscritos_20XX" deve estar criada, ela garante a contagem total de inscritos
$usr->add_role('inscritos_2023' );
}
$out .= EN_create_status_request($usr, $btn_name_ivr, 'STATUS: ', true);
}
$out .= '<hr style="height:4px;border:none;color:white;background-color:white"/>';
////////////////////////////////////////////////
return $out;
}
add_shortcode('EN_ivr_user', 'EN_ivr_user_viewer');
?>