const table = new DataTable('#carrTalentos', { processing: true, serverSide: true, ajax: { url: "{{ route('dashboard.minha_area.ajax') }}", data: function(data){ data.por_nome_filtro = $('#filtro-por-nome').val() data.status_aprovacao_filtro = $('#filtro-status-aprov').val() } }, columns: [ { className: 'dt-control', orderable: false, data: null, defaultContent: '' }, { "data": "nome_artistico", "name": "nome_artistico", "title": "Nome Artístico"}, { "data": "created_at", "name": "created_at", "title": "Data"}, { "data": "action", "name": "action", "title": "Aprovar Talento?"}, ], language: { url: 'https://cdn.datatables.net/plug-ins/1.11.3/i18n/pt_br.json', }, }); // Add event listener for opening and closing details table.on('click', 'td.dt-control', function (e) { let tr = e.target.closest('tr'); let row = table.row(tr); if (row.child.isShown()) { // This row is already open - close it row.child.hide(); } else { // Open this row row.child(format(row.data())).show(); } }); function format(d) { // console.log(d.data_nasc); const data_nasc = new Date(d.data_nasc+'T00:00'); const data_nasc_conv = dayjs(data_nasc).format('DD/MM/YYYY'); const carreira_desde = new Date(d.carreira_desde+'T00:00'); const carreira_desde_conv = dayjs(carreira_desde).format('DD/MM/YYYY'); var dados_contato = d.contatos_emergencia; var contato = dados_contato.split(','); var segElemento_contato = ""; for(var loop_contato=0; loop_contatoContato '+(loop_contato+1)+':' + '' + '

'+contato_detalhes[0]+'

' + '' + '

'+contato_detalhes[1]+'

' + '' + '

'+contato_detalhes[2]+'

' + ''; } // let segElemento_contato = contato.map((part, index) => { // let subArray = part.split('|'); // return '
' + // '
Contato '+(index+1)+':
' + // '' + // '

'+subArray[0]+'

' + // '' + // '

'+subArray[1]+'

' + // '' + // '

'+subArray[2]+'

' + // '
'; // }).filter(element => element !== null); // remove elementos nulos se houver var detalhes_talento = ''; // `d` is the original data object for the row detalhes_talento += '' + '
' + '
'; if(d.foto_rosto == ""){ } else{ detalhes_talento += '' + ''; } if(d.foto_trabalhando == ""){ } else{ detalhes_talento += '' + ''; } if(d.foto_perfil == ""){ } else{ detalhes_talento += '' + ''; } if(d.foto_corpo_inteiro == ""){ } else{ detalhes_talento += '' + ''; } if(d.foto_meio_corpo == ""){ } else{ detalhes_talento += '' + ''; } if(d.video_apresentacao == ""){ } else{ detalhes_talento += '' + ''; } if(d.link_video == ""){ } else{ detalhes_talento += '' + ''; } detalhes_talento += '' + '
' + '
' + '

Informações Pessoais:

' + '
' + '
' + '' + '

'+d.name+'

' + '
' + '
' + '' + '

'+d.email+'

' + '
' + '
' + '' + '

'+d.categoria+'

' + '
' + '
' + '' + '

'+d.nome_artistico+'

' + '
' + '
' + '' + '

'+d.sexo+'

' + '
' + '
' + '' + '

'+d.identidade_genero+'

' + '
' + '
' + '' + '

'+data_nasc_conv+'

' + '
' + '
' + '' + '

'+d.whatsapp+'

' + '
' + '
' + '' + '

'+d.telefone+'

' + '
' + '
' + '' + '

'+d.etnia+'

' + '
' + '
' + '' + '

'+d.nacionalidade+'

' + '
' + '
' + '' + '

'+d.cep+'

' + '
' + '
' + '' + '

'+d.estado+'

' + '
' + '
' + '' + '

'+d.cidade+'

' + '
' + '
' + '' + '

'+d.endereco+'

' + '
' + '
' + '' + '

'+d.numero+'

' + '
' + '
' + '' + '

'+d.complemento+'

' + '
' + '
' + '' + '

'+d.bairro+'

' + '
' + '
' + '' + '

'+d.idiomas+'

' + '
' + '
' + '' + '

'+d.formacao+'

' + '
' + '
' + '' + '

'+d.linkedin+'

' + '
' + '
' + '' + '

'+d.instagram+'

' + '
' + '
' + '' + '

'+d.facebook+'

' + '
' + '
' + '

Atributos e Habilidades:

' + '
' + '
' + '' + '

'+d.altura+' m

' + '
' + '
' + '' + '

'+d.busto+' m

' + '
' + '
' + '' + '

'+d.cintura+' m

' + '
' + '
' + '' + '

'+d.quadril+' m

' + '
' + '
' + '' + '

'+d.peso+' kg

' + '
' + '
' + '' + '

'+d.sapato+'

' + '
' + '
' + '' + '

'+d.olhos+'

' + '
' + '
' + '' + '

'+d.cabelo+'

' + '
' + '
' + '' + '

'+d.tom_pele+'

' + '
' + '
' + '

Manequim:

' + '
' + '
' + '' + '

'+d.altura_manequim+'m

' + '
' + '
' + '' + '

'+d.tamanho_camiseta+'

' + '
' + '
' + '' + '

'+d.dirige+'

' + '
' + '
' + '' + '

'+d.outras_atividades+'

' + '
' + '
' + '' + '

'+d.marcas+'

' + '
' + '
' + '' + '

'+d.tem_tatuagem+'

' + '
' + '
' + '' + '

'+d.local_tatuagem+'

' + '
' + '
' + '' + '

'+d.tamanho_tatuagem+' m

' + '
' + '
' + '

Informações Administrativas:

' + '
' + '
' + '' + '

'+d.estado_civil+'

' + '
' + '
' + '' + '

'+d.cnh+'

' + '
' + '
' + '' + '

'+d.cpf+'

' + '
' + '
' + '' + '

'+d.rg+'

' + '
' + '
' + '' + '

'+d.pis+'

' + '
' + '
' + '' + '

'+d.drt+'

' + '
' + '
' + '

Conta Bancária:

' + '
' + '
' + '' + '

'+d.banco+'

' + '
' + '
' + '' + '

'+d.outro_banco+'

' + '
' + '
' + '' + '

'+d.numero_agencia+'

' + '
' + '
' + '' + '

'+d.numero_conta+'

' + '
' + '
' + '' + '

'+d.pix+'

' + '
' + '
' + '' + '

'+d.tipo_conta+'

' + '
' + '
' + '' + '

'+d.cpf_cnpj+'

' + '
' + '
' + '' + '

'+d.nome_favorecido+'

' + '
' + '
' + '

Familiares e Procedência:

' + '
' + '
' + '
' + segElemento_contato + '
' + '
' + '

Sobre Você:

' + '

'+d.sobre_voce+'

' + '
' + '
' + '

Carreira:

' + '
' + '
' + '' + '

'+carreira_desde_conv+'

' + '
' + '
' + '' + '

'+d.carreira_principais_habilidades+'

' + '
' + '
' + '' + '

'+d.carreira_principais_trabalhos+'

' + '
' + '
' + '' + '

'+d.carreira_experiencias+'

' + '
' + '
'; return (detalhes_talento); } function carregarTabela() { table.draw(); } function limparFiltros() { $("#filtro-por-nome").val("").change(); $("#filtro-status-aprov").val("2").change(); }