roles; return in_array($role_name, $user_roles); } function EN_user_viewer() { //Só mudar o ano após ter criado os campos "miniX_20XX" para todos os minicursos disponíveis //e também os campos novos "online20XX" e "presencial20XX" //A role "inscritos_20XX" também deve ser criada previamente em "Members->Adicionar nova Função" $ano = 2023; //Limitação para somente usuários cadastrados if (!is_user_logged_in()) { $out = '
Log in to the website: LOGIN or complete your registration right now: REGISTRATION.
You will have remote access to all the exclusive content of the ' .$ano .' event, including access to the academic papers with presentations by the authors themselves, sending questions and following the live broadcasts.
'; //Define as Roles que devem ser alteradas e metadados atualizados if (isset($_POST['btn_online'])) { //Para o caso do acesso online a aprovação é imediata //O metadata "online20XX" deve ser criado para os usuários no plugin "Campos Personalizados" update_user_meta( $usr->ID, 'online'.$ano, 'Participação APROVADA'); //O role "inscritos_20XX" também deve ser criada previamente em "Members->Adicionar nova Função" //com apenas a função básica de ler $usr->add_role( 'inscritos_'.$ano ); } //Atualizar o metadado a ser coletado para checar o status da inscrição para o ano desejado $status = get_metadata('user', $usr->ID, 'online'.$ano, true); $colorRequest = "#009900"; //Este trecho serve para exibir a inscrição aprovada ou disponibilizar o botão de solicitação if ($status == "Participação APROVADA" ) { $out .= 'STATUS: Access Authorized
'; } else { $out .= 'STATUS: Access to the event not requested
'; wp_nonce_field('btn_online_clicked'); $out .= ''; $out .= 'Seize this opportunity! You will have the chance to attend the lectures, technical sessions, workshops, presentations, and mini-courses held at facilities of the ITA during this edition of SIGE. Moreover, you will have the opportunity to engage with military personnel, academics, and companies actively involved in the development of cutting-edge defense solutions. Secure your spot now, as we have limited availability, and registrations will be accepted until September 19, 2023.
'; $btn_presencial_sige = 'presencial'.$ano; if (isset($_POST[$btn_presencial_sige])) { update_user_meta( $usr->ID, $btn_presencial_sige, $_POST[$btn_presencial_sige]); //Role "inscritos_20XX" deve estar criada, ela garante a contagem total de inscritos $usr->add_role( 'inscritos_'.$ano ); update_user_meta( $usr->ID, "presencial_geral", "Sim"); } //Aqui é adicionado o botão para solicitar a participação, ultimo valor é se ainda está aberto as inscrições $out .= EN_create_status_request($usr, $btn_presencial_sige, 'STATUS: ', true); $chekon_status = get_metadata('user', $usr->ID, 'presencial'.$ano, true); if ($chekon_status != "Não Solicitada" && $chekon_status != "" && $chekon_status != "Cancelar Solicitação") { //update_user_meta( $usr->ID, 'online'.$ano, "Participação APROVADA"); } elseif ($chekon_status == "Cancelar Solicitação"){ update_user_meta( $usr->ID,"mini1_2023",""); update_user_meta( $usr->ID,"mini2_2023",""); update_user_meta( $usr->ID,"mini3_2023",""); update_user_meta( $usr->ID,"mini4_2023",""); update_user_meta( $usr->ID,"mini5_2023",""); update_user_meta( $usr->ID,"inovacao2023",""); update_user_meta( $usr->ID,"aerologlab2023",""); } //////////////////////////////////////////////////////////////////// //Adicionar Botões para participação em Mini Cursos///////////// //As descrições dos minicursos devem ser atualizadas aqui para o que o usuário irá enxergar //a Key do array correponde ao nome da chave do campo adicional do usuário $courses = array("mini3_".$ano =>array("Mini Curso 1","Towards Trustworthy AI-Integrating Reasoning and Learning" , "Prof. Dr. Fredrik Heintz", "https://liu.se/en/employee/frehe08", true), "mini1_".$ano =>array("Mini Curso 2","Value-Focused Thinking for Capability-Based Planning", "Coronel (USAF) Gregory S. Parnell", "https://industrial-engineering.uark.edu/directory/index/uid/gparnell/name/Gregory+S.+Parnell/", true), "mini2_".$ano =>array("Mini Curso 3","Competency-based Training to Address Representative Engineering Grand Challenges", "Prof. Dr. Girum Urgessa", "https://civil.gmu.edu/profiles/gurgessa", true), "mini4_".$ano =>array("Mini Curso 4","Introdução à Engenharia de Sistemas Espaciais", "Prof. Dr. Márcio Martins da Silva Costa", "http://lattes.cnpq.br/9992346581154486", true), "mini5_".$ano =>array("Mini Curso 5","Introdução à Criptografia Quântica", "Prof. Dr. André Jorge Carvalho Chaves", "http://lattes.cnpq.br/5727667279534190", true) ); $out .= 'The mini-courses have limited places, so do not miss out on this opportunity to take part in person. Secure your place as soon as possible, but do not worry if you can not make it. The mini-courses will be recorded and made available on our website after the event is over.
'; //Para solicitar os minicursos disponíveis o usuário deve ter solicitado participação presencial //Atenção para atualizar o metadado no par ao ano correto $chekon_statusP = get_metadata('user', $usr->ID, 'presencial'.$ano, true); if ($chekon_statusP == "Não Solicitada" || $chekon_statusP == "") { $out .= 'In this edition of SIGE, we are honored to have the participation of the Logistics Engineering Laboratory of the Technological Institute of Aeronautics (AEROLOGLAB) and the Innovation Management Coordination of the Department of Aerospace Science and Technology (DCTA). They will provide our distinguished audience with high-level presentations on highly relevant topics, such as the use of Digital Twins technology to support aircraft and the interconnection between the Aeronautics Innovation System and the Defense Industrial Base.
'; $out .='Check our schedule for more information. Dont miss this opportunity.
'; $out .= 'PRESENTATION 01: O Sistema de Inovação da Aeronáutica e sua Conexão com a Base Industrial de Defesa.
'; $out .= EN_create_status_request($usr, $btn_inovacao, 'STATUS: ', true); $btn_aerologlab = 'aerologlab'.$ano; if (isset($_POST[$btn_aerologlab])) { update_user_meta( $usr->ID, $btn_aerologlab, $_POST[$btn_aerologlab]); //Role "inscritos_20XX" deve estar criada, ela garante a contagem total de inscritos $usr->add_role( 'inscritos_'.$ano ); if ($chekon_statusP == "Não Solicitada" || $chekon_statusP == "" || $chekon_statusP =="Cancelar Solicitação") { //Atualizar ano do metadado //update_user_meta( $usr->ID, 'presencial'.$ano, "Solicitar Participação"); header("Refresh:0"); } } //Aqui é adicionado o botão para solicitar a participação, ultimo valor é se ainda está aberto as inscrições $out .= 'PRESENTATION 02: Gêmeo Digital em Suporte à Aeronave.
'; $out .= EN_create_status_request($usr, $btn_aerologlab, 'STATUS: ', true); //////////////////////////////////////////////// } } return $out; } add_shortcode('EN_sige_user_viewer', 'EN_user_viewer'); function EN_header_insc() { $out = '