File: /home/undanet/www/PortalEmpleo/src/Views/CandidatoBuscadorView.php
<html>
<head>
<title>Listado de Candidatos</title>
</head>
<body>
<?php
if(isset($data))
{
$_SERVER['HTTPS'] = $_SERVER['HTTPS'] == 'off' ? '' : $_SERVER['HTTPS'];
$root = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . '/';
$rootwp = "";
$root = get_site_url() . '/';
$lang = pll_current_language();
echo '<label id="lblfiltrar" class="link" onclick ="toggle();">' . __('+ Filter', 'panoramic_child') . '</label>';
echo '<section id="no-more-tables"><div id="divFiltar" hidden="true">';
echo '<input id="txtBuscar" type="text" placeholder="' . __('Type something to filter', 'panoramic_child') . '" />';
echo '</div></section>';
echo '<table border="0" class="azul" id="tbResultados"><thead>';
echo '<tr><th>' . __('Last Name', 'panoramic_child') . '</th><th>' . __('Last Name 2', 'panoramic_child') . '</th><th>' . __('First Name', 'panoramic_child') . '</th><th>Email</th><th>' . __('Document', 'panoramic_child') . '</th><th>' . __('Job', 'panoramic_child') . '</th></tr>';
echo '</thead><tbody>';
/*if($lang == 'en')
{*/
foreach ($data as $candidato)
{
/*$pathurl = ($lang == 'en') ? 'en/candidate-tab/?id=' : 'es/ficha-candidato/?id=';*/
$pathurl = __('en/candidate-tab/?id=', 'panoramic_child');
echo '<tr class="cebra link" onclick="window.location=\'' . $root . $pathurl . $candidato[0]->getIdcandidato() . '\';">';
echo '<td>' . $candidato[0]->getApellido1() . '</td>';
echo '<td>' . $candidato[0]->getApellido2() . '</td>';
echo '<td>' . $candidato[0]->getNombre() . '</td>';
echo '<td>' . ($candidato[0]->getCodigousuariowp())->getUserEmail() . '</td>';
echo '<td>' . $candidato[0]->getDocumento() . '</td>';
if($candidato[1])
{
echo '<td>' . ($candidato[1]->getCodigoperfil())->getPerfil() . '</td>';
}
else
{
echo '<td></td>';
}
echo '</tr>';
}
echo '</tbody></table>';
}
?>
<script language="javascript">
function toggle() {
var lbl = document.getElementById('lblfiltrar');
var divFiltrar = document.getElementById('divFiltar');
if(divFiltrar.hidden)
{
divFiltrar.hidden = false;
lbl.innerHTML = "- Filter";
}
else
{
divFiltrar.hidden = true;
lbl.innerHTML = "+ Filter";
}
}
function cambiar() {
var lbl = document.getElementById('lblfiltrar');
var divFiltrar = document.getElementById('divFiltar');
if(divFiltrar.hidden)
{
divFiltrar.hidden = false;
lbl.innerHTML = "- Filtrar";
}
else
{
divFiltrar.hidden = true;
lbl.innerHTML = "+ Filtrar";
}
}
var busqueda = document.getElementById('txtBuscar');
buscaTabla = function(){
var table = document.getElementById("tbResultados").tBodies[0];
texto = busqueda.value.toLowerCase();
var r=0;
while(row = table.rows[r++])
{
if ( row.innerText.toLowerCase().indexOf(texto) !== -1 )
row.style.display = null;
else
row.style.display = 'none';
}
}
busqueda.addEventListener('keyup', buscaTabla);
</script>
</body>
</html>