File: /home/undanet/www/PortalEmpleo/src/Views/ConvocatoriaBuscadorView.php
<?php
if(isset($data))
{
$root = get_site_url() . '/';
$rootwp = "";
if( pll_current_language() == 'en')
$lang = 'en_GB';
else
$lang = 'es_ES';
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>';
if ( isset($nombreCombo) ){
unset ($nombreCombo);
}
echo '<tr><th>' . __('Reference', 'panoramic_child') . '</th><th>' . __('Description', 'panoramic_child') . '</th><th>' . __('Published on', 'panoramic_child') . '</th><th>' . __('End Date', 'panoramic_child') . '</th><th>' . __('State', 'panoramic_child') . '</th><th>' . __('PDF General Bases', 'panoramic_child') . '</th><th>' . __('PDF Specific Bases', 'panoramic_child') . '</th><th>' . __('Requirements resolution', 'panoramic_child') . '</th><th>' . __('Exam Resolution', 'panoramic_child') . '</th><th>' . __('Final Resolution', 'panoramic_child') . '</th></tr>';
echo '</thead><tbody>';
foreach ($data as $convocatoria) {
$calldetailurl = ( pll_current_language() == 'en') ? 'en/call-details/?id=' : 'detalle-de-convocatoria/?id=';
$descript = ( pll_current_language() == 'en') ? $convocatoria->getDescripcionEn() : $convocatoria->getDescripcion();
$tieneExamen = $convocatoria->getTieneExamen() ? 'class="tieneExamenStrong"' : '';
echo '<tr class="cebra link" onclick="window.location=\'' . $root . $calldetailurl . $convocatoria->getIdconvocatoria() . '\';"><td ' . $tieneExamen .'>';
echo $convocatoria->getReferencia() . '</td>';
echo '<td ' . $tieneExamen .'>' . $descript . '</td>';
echo '<td ' . $tieneExamen .'>' . $convocatoria->getFechaInicio()->format('d/m/Y') . '</td>';
echo '<td ' . $tieneExamen .'>' . $convocatoria->getFechaFin()->format('d/m/Y') . '</td>';
echo '<td ' . $tieneExamen .'>' . ($convocatoria->getCodigoestadoconvocatoria())->getEstado() . '</td>';
if($convocatoria->getRutaarchivoconvocatoria()!= null && strlen(trim($convocatoria->getRutaarchivoconvocatoria()))>0) {
echo '<td class="centrado"><a href="' . $root . 'descargaC/?ref=' . $convocatoria->getReferencia() . '&file=' . basename($convocatoria->getRutaarchivoconvocatoria()) . '" target="_self"> <img id="imgConvocatoria" name="imgConvocatoria" src="' . $root . $rootwp . 'PortalEmpleo/img/' . 'PDF_Icon.png' . '" width="25" height="25" alt="Resolution PDF" class="link"/></a></td>';
} else {
echo '<td class="centrado">-</td>';
}
if($convocatoria->getRutaarchivoespecifico()!= null && strlen(trim($convocatoria->getRutaarchivoespecifico()))>0) {
echo '<td class="centrado"><a href="' . $root . 'descargaC/?ref=' . $convocatoria->getReferencia() . '&file=' . basename($convocatoria->getRutaarchivoespecifico()) . '" target="_self"> <img id="imgConvocatoria" name="imgConvocatoria" src="' . $root . $rootwp . 'PortalEmpleo/img/' . 'PDF_Icon.png' . '" width="25" height="25" alt="Resolution PDF" class="link"/></a></td>';
} else {
echo '<td class="centrado">-</td>';
}
if($convocatoria->getRutaarchivorequisitos()!= null && strlen(trim($convocatoria->getRutaarchivorequisitos()))>0) {
echo '<td class="centrado"><a href="' . $root . 'descargaC/?ref=' . $convocatoria->getReferencia() . '&file=' . basename($convocatoria->getRutaarchivorequisitos()) . '" target="_self"> <img id="imgConvocatoria" name="imgConvocatoria" src="' . $root . $rootwp . 'PortalEmpleo/img/' . 'PDF_Icon_Final.png' . '" width="25" height="25" alt="Resolution PDF" class="link"/></a></td>';
} else {
echo '<td class="centrado">-</td>';
}
if($convocatoria->getRutaarchivoexamen()!= null && strlen(trim($convocatoria->getRutaarchivoexamen()))>0) {
echo '<td class="centrado"><a href="' . $root . 'descargaC/?ref=' . $convocatoria->getReferencia() . '&file=' . basename($convocatoria->getRutaarchivoexamen()) . '" target="_self"> <img id="imgConvocatoria" name="imgConvocatoria" src="' . $root . $rootwp . 'PortalEmpleo/img/' . 'PDF_Icon_Final.png' . '" width="25" height="25" alt="Resolution PDF" class="link"/></a></td>';
}else{
echo '<td class="centrado">-</td>';
}
if($convocatoria->getRutaarchivoresolucionfinal()!= null && strlen(trim($convocatoria->getRutaarchivoresolucionfinal()))>0) {
echo '<td class="centrado"><a href="' . $root . 'descargaC/?ref=' . $convocatoria->getReferencia() . '&file=' . basename($convocatoria->getRutaarchivoresolucionfinal()) . '" target="_self"> <img id="imgConvocatoria" name="imgConvocatoria" src="' . $root . $rootwp . 'PortalEmpleo/img/' . 'PDF_Icon_Final.png' . '" width="25" height="25" alt="Resolution PDF" class="link"/></a></td>';
} else {
echo '<td class="centrado">-</td>';
}
/* else
{
echo '<td class="centrado"><a href="' . $root . 'descargaC/?ref=' . $convocatoria->getReferencia() . '&file=' . basename($convocatoria->getRutaarchivoconvocatoria()) . '" target="_self"> <img id="imgConvocatoria" name="imgConvocatoria" src="' . $root . $rootwp . 'PortalEmpleo/img/' . 'PDF_Icon.png' . '" width="25" height="25" alt="Resolution PDF" class="link"/></a></td>';
}*/
echo '</tr>';
}
echo '</tbody></table>';
}
?>
<?php
$root = get_site_url() . '/';
$rootwp = "";
if( pll_current_language() == 'en') {
echo '<section style="margin-top:8em;"><form method="post" name="frmConvocatoriaEspontanea" id="frmConvocatoriaEspontanea" action="' . $root . $rootwp . 'en/my-calls/" enctype="multipart/form-data">';
}
else
{
echo '<section style="margin-top:8em;"><form method="post" name="frmConvocatoriaEspontanea" id="frmConvocatoriaEspontanea" action="' . $root . $rootwp . 'mis-candidaturas/" enctype="multipart/form-data">';
}
echo '<table border="0" class="azul" id="tbResultados"><thead></thead><tbody>';
echo '<input type="text" name="accionMisCandidaturas" id="accionMisCandidaturas" value="" hidden>';
echo '<input type="text" name="codigoUsuarioWP" id="codigoUsuarioWP" value="' . get_current_user_id() . '" hidden>';
echo '</tbody></table>';
echo '</form></section>';
?>
<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>
<script language="javascript">
function fncconvocatoriaespontaneasubmit(object, id) {
document.getElementById("accionMisCandidaturas").value = 'Register';
document.getElementById("frmConvocatoriaEspontanea").submit();
}
</script>