<th>telefone</th> <th>país de origem</th> <th>estado</th> <th>cidade</th> <th>país de residência</th> <th>estado</th> <th>cidade</th> <th>estilos</th> <th>estilo livre</th> </tr> </thead> <tbody> <?php foreach ($_users as $udata) { //$udata = get_userdata($uid); if (is_artista($udata->ID)) { $capability = 'artista'; $pais = $udata->banda_pais ? $paises[$udata->banda_pais] : ''; if ($udata->banda_estado) { $estado = $udata->banda_pais == 'BR' ? $estados[$udata->banda_estado] : $udata->banda_estado; } else { $estado = ''; } $cidade = $udata->banda_cidade; } else { $capability = 'produtor'; $cidade = ''; $estado = ''; $pais = ''; } $origem_pais = $udata->origem_pais ? $paises[$udata->origem_pais] : '';
if ($event->post_status == 'pay_pending_ok') { ?> <form id='evento-contrato-form' method="post" action="../"> <input type='hidden' id='evento-contrato-form-action' name='tnb_user_action' value='' /> <input type='hidden' name='evento_id' value='<?php echo $event->ID; ?> ' /> </form> <?php } ?> <section id="opportunity" class="content clearfix"> <?php if (!is_artista($profileuser->ID)) { ?> <?php if (!$event->ID) { ?> <div class="alignright"> <a id="nova_oportunidade" class="btn-green">criar oportunidade</a> </div> <?php } ?> <form id="opportunity-form" enctype="multipart/form-data" method="post" <?php if (!$event->ID && !$creatingSubEvent) { echo 'style="display:none;"';
<a onclick="jQuery('#form_unjoin_event_<?php echo $oportunidade_item->ID; ?> ').submit();" class="btn-green"><?php _e('Cancelar inscrição', 'tnb'); ?> </a> </div> </div> <?php } elseif (!$superevento && strtotime($inscricao_inicio) <= strtotime(date('Y-m-d')) && strtotime($inscricao_fim) >= strtotime(date('Y-m-d'))) { ?> <?php if (is_artista()) { ?> <?php if ($can_join) { ?> <form action='<?php the_permalink(); ?> ' method="post" id='form_join_event_<?php echo $oportunidade_item->ID; ?> '> <?php wp_nonce_field('join_event'); ?> <input type="hidden" name="banda_id" value='<?php
?> <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; ?>
<?php global $current_user, $user_ID, $profileuser; $profileuser = $current_user; // apenas artistas usam esse tpl if (!is_user_logged_in() && !is_artista()) { wp_redirect(get_bloginfo('url')); } $profileuser = $current_user->data; $estados = get_estados(); //var_dump($_POST); if (isset($_POST['action']) && $_POST['action'] == 'update' && wp_verify_nonce($_POST['_wpnonce'], 'edit_nonce')) { require_once ABSPATH . WPINC . '/registration.php'; $profileuser_id = $user_ID; if (isset($_POST['action_user']) && $_POST['action_user'] == 'user_data') { if (!filter_var($_POST['user_email'], FILTER_VALIDATE_EMAIL)) { $msg['error'][] = __('O email informado é inválido.', 'tnb'); } if ($_POST['user_email'] != $profileuser->user_email && email_exists($_POST['user_email'])) { $msg['error'][] = __('Esse email já está sendo utilizado. Por favor verifique se digitou os dados corretamente.', 'tnb'); } if (strlen($_POST['user_pass']) > 0 && $_POST['user_pass'] != $_POST['user_pass_confirm']) { $msg['error'][] = __('A senhas fornecidas não conferem.', 'tnb'); } if (strlen($_POST['youtube']) > 0 && !preg_match("/\\/watch\\?v=/", $_POST['youtube'])) { $msg['error'][] = __('URL de vídeo no Youtube inválida.', 'tnb'); } if (strlen($_POST['site']) > 0 && $_POST['site'] != 'http://' && !filter_var($_POST['site'], FILTER_VALIDATE_URL)) { $msg['error'][] = __('O link fornecido não é válido.', 'tnb'); } if (!$msg['error']) {
} if (isset($novo_evento_cobranca)) { do_action('tnb_produtor_cadastrou_evento_cobranca', $post['ID']); } /** * REMOVE OS INSCRITOS QUE NÃO SE ENQUADRAM NOS FILTROS */ if (!$event_meta['evento_fim'] || new DateTime(str_replace('/', '-', $event_meta['evento_fim'])) > new DateTime(date("Y-m-d"))) { global $wpdb; $arts_ids = $wpdb->get_col("SELECT meta_value FROM {$wpdb->postmeta} WHERE post_id = '{$event->ID}' and meta_key = 'inscrito'"); $arts_ids = is_array($arts_ids) ? $arts_ids : array(); foreach ($arts_ids as $aid) { //_vd($aid); //_vd(is_artista($aid)); //_vd(tnb_artista_can_join($event->ID, $aid)); if (is_artista($aid) && !tnb_artista_can_join($event->ID, $aid)) { delete_post_meta($event->ID, 'inscrito', $aid); do_action('tnb_artista_desinscrito_pelo_filtro', $event, $aid); //_pr('delete'); } } // die; } // Upload de imagens require_once ABSPATH . '/wp-admin/includes/media.php'; require_once ABSPATH . '/wp-admin/includes/file.php'; require_once ABSPATH . '/wp-admin/includes/image.php'; $upload_dir = WP_CONTENT_DIR . '/uploads'; foreach ($_FILES as $index => $file) { if ($file['size'] > 0 && array_key_exists($index, $images)) { if (preg_match('#image/(gif|png|jpe?g|pjpeg|x-png)#', $file['type'])) {
function tnb_update_users_stats($user) { global $wpdb; if (is_artista($user->ID)) { $pais = $user->banda_pais; $estado = $user->banda_estado; $cidade = $user->banda_cidade; } else { $pais = $user->origem_pais; $estado = $user->origem_estado; $cidade = $user->origem_cidade; } $estado = addslashes($estado); $cidade = addslashes($cidade); $wpdb->query("\n\tUPDATE \n\t\t{$wpdb->prefix}tnb_users_stats \n\tSET\n\t\tpais = '{$pais}',\n\t\testado = '{$estado}',\n\t\tcidade = '{$cidade}'\n\tWHERE\n\t\treg_type = 'insert' AND\n\t\tuser_id = '{$user->ID}'"); }