?>
' />
              </form>
                        
              <div class="select-artist">
                <a class="button" onclick="jQuery('#form_join_event_<?php 
            echo $user->ID;
            ?>
').submit();"><?php 
            _e('Selecionar!', 'tnb');
            ?>
</a>
              </div>

            <?php 
        } elseif (in_postmeta(get_post_meta($oportunidade_item_id, 'selecionado'), $user->ID)) {
            ?>
            
              <form method="post" id='form_join_event_<?php 
            echo $user->ID;
            ?>
'>
                <?php 
            wp_nonce_field('unselect_band');
            ?>
                <input type="hidden" name="action" value="unselect_band"/>
                <input type="hidden" name="banda_id" value='<?php 
            echo $user->ID;
            ?>
' />
                <input type="hidden" name="evento_id" value='<?php 
예제 #2
0
        }
        break;
    case 'unjoin':
        //die(get_post_meta($_POST['evento_id'], 'evento_inscricao_cobrada', true));
        if (isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'unjoin_event')) {
            if (in_postmeta(get_post_meta($_POST['evento_id'], 'inscrito'), $_POST['banda_id'])) {
                if (get_post_meta($_POST['evento_id'], 'evento_inscricao_cobrada', true)) {
                    $wpdb->query("\n                                UPDATE \n                                        {$wpdb->postmeta} \n                                SET \n                                        meta_key = 'inscricao_cancelada' \n                                WHERE \n                                        post_id = '{$_POST['evento_id']}' AND \n                                        meta_key = 'inscrito' AND \n                                        meta_value = '{$_POST['banda_id']}'\n                        ");
                    $unjoin_success = true;
                    do_action('tnb_artista_desinscreveu_em_um_evento', $_POST['evento_id'], $_POST['banda_id']);
                } else {
                    delete_post_meta($_POST['evento_id'], 'inscrito', $_POST['banda_id']);
                    $unjoin_success = true;
                    do_action('tnb_artista_desinscreveu_em_um_evento', $_POST['evento_id'], $_POST['banda_id']);
                }
            } elseif (in_postmeta(get_post_meta($_POST['evento_id'], 'inscricao_pendente'), $_POST['banda_id'])) {
                delete_post_meta($_POST['evento_id'], 'inscricao_pendente', $_POST['banda_id']);
                $unjoin_success = true;
                do_action('tnb_artista_desinscreveu_em_um_evento_em_que_estava_pendente', $_POST['evento_id'], $_POST['banda_id']);
            }
        }
        break;
}
the_post();
// saida csv
if ($_GET['exportar']) {
    if ($_GET['exportar_tipo'] == 'superevento') {
        if ($_GET['exportar'] == 'produtor') {
            include 'includes/export-produtores-superevento.php';
        } else {
            include 'includes/export-bandas-superevento.php';
    } else {
        ?>
            <a onclick="jQuery('#form_unjoin_event_<?php 
        echo $oportunidade_item->ID;
        ?>
').submit();" class="btn-green"><?php 
        _e('Cancelar inscrição', 'tnb');
        ?>
</a>
        <?php 
    }
    ?>
    </p>

<?php 
} elseif (is_artista() && in_postmeta(get_post_meta($oportunidade_item->ID, 'inscricao_pendente'), $current_user->ID) && strtotime($inscricao_inicio) <= strtotime(date('Y-m-d')) && strtotime($inscricao_fim) >= strtotime(date('Y-m-d'))) {
    ?>
    
    <form action='<?php 
    the_permalink();
    ?>
' method="post" id='form_unjoin_event_<?php 
    echo $oportunidade_item->ID;
    ?>
'>
        <?php 
    wp_nonce_field('unjoin_event');
    ?>
        <input type="hidden" name="banda_id" value='<?php 
    echo $current_user->ID;
    ?>
                ?>
                    <p class="quero-tocar cancel-subscription">
                        <a onclick="jQuery('#form_unjoin_event_<?php 
                echo $post->ID;
                ?>
').submit();"><?php 
                _e('Cancelar inscrição', 'tnb');
                ?>
</a>
                    </p>
                <?php 
            }
            ?>
            
            <?php 
        } elseif (is_artista($profileuser->ID) && in_postmeta(get_post_meta($post->ID, 'inscricao_pendente'), $profileuser->ID) && strtotime($data['inscricao_inicio']) <= strtotime(date('Y-m-d')) && strtotime($data['inscricao_fim']) >= strtotime(date('Y-m-d'))) {
            ?>

                <form action='<?php 
            the_permalink();
            ?>
' method="post" id='form_unjoin_event_<?php 
            echo $post->ID;
            ?>
'>
                    <?php 
            wp_nonce_field('unjoin_event');
            ?>
                    <input type="hidden" name="banda_id" value='<?php 
            echo $profileuser->ID;
            ?>