File: /home/undanet/www/PortalEmpleo/src/Views/MisCandidaturasView.php
<?php
if(isset($data))
{
$root = get_site_url() . '/';
$rootwp = "";
$flagExisteConvEspontanea = false;
if( pll_current_language() == 'en')
$lang = 'en_GB';
else
$lang = 'es_ES';
echo '<h2 class="nomargin">' . __('My Calls', 'panoramic_child') . '</h2><br><br>';
if(isset($data['esnuevo'])) {
if($data['esnuevo']==true) {
echo '<div class="fondo_color">' . __('Congratulations! You have successfully been registered at new call', 'panoramic_child') . '</div>';
if( isset($data['candidato']) ) {
$mailto = ($candidato->getCodigousuariowp())->getUserEmail();
$subject = __('Congratulations! You have successfully been registered at new call', 'panoramic_child');
$message = '<p>' . __('Hello', 'panoramic_child') . '</p>
<p>' . __('Congratulations! You have successfully been registered at new call', 'panoramic_child') . '</p>
<p>' . __('Greetings', 'panoramic_child') . '</p>';
$message .= '<p>' . __('Web:', 'panoramic_child') . ' ' . '<a href="' . get_site_url() . '">' . get_site_url() . '</a>' . '</p>' ;
sendEmailto($mailto, $subject, $message);
}
} elseif($data['esnuevo']==false) {
if(isset($_GET["id"])) { //Si no es espontanea
echo '<div class="fondo_color">' . __('You were already registered at this call', 'panoramic_child') . '</div>';
} else {
echo '<div class="fondo_color">' . __('You were already registered a free call', 'panoramic_child') . '</div>';
}
}
}
echo '<table border="0" class="azul" id="tbResultados"><thead>';
echo '<tr><th>' . __('Reference', 'panoramic_child') . '</th>
<th>' . __('Job Position', 'panoramic_child') . '</th>
<th>' . __('Register Date', 'panoramic_child') . '</th>
<th>' . __('State', 'panoramic_child') . '</th>
<th>' . __('Document', 'panoramic_child') . '</th>
<th>' . __('Edit', 'panoramic_child') . '</th></tr>';
echo '</thead><tbody>';
if ( pll_current_language() == 'en') {
if($data['lconvocatorias'] == null || !isset($data['lconvocatorias']) && count($data['lconvocatorias'])<=0) {
echo '<tr><td><br>' . __('You do not register for any calls yet', 'panoramic_child') . '</td></tr>';
} else {
foreach ($data['lconvocatorias'] as $cndcvt) {
if($cndcvt->getCodigoconvocatoria()) { //Si no es espontanea
echo '<tr class="cebra link" onclick="window.location=\'' . $root . 'en/call-details/?id=' . ($cndcvt->getCodigoconvocatoria())->getIdconvocatoria() . '\';"><td>';
echo ($cndcvt->getCodigoconvocatoria())->getReferencia() . '</td>';
echo '<td>' . $cndcvt->getPuestoTrabajo() . '</td>';
echo '<td>' . $cndcvt->getFechainscripcion()->format('d/m/Y') . '</td>';
echo '<td>' . (($cndcvt->getCodigoconvocatoria())->getCodigoestadoconvocatoria())->getEstado() . '</td>';
if(($cndcvt->getCodigoconvocatoria())->getRutaarchivoresolucionfinal()!= null && strlen(trim(($cndcvt->getCodigoconvocatoria())->getRutaarchivoresolucionfinal()))>0) {
echo '<td class="centrado"><a href="' . $root . 'descargaC/?ref=' . ($cndcvt->getCodigoconvocatoria())->getReferencia() . '&file=' . basename(($cndcvt->getCodigoconvocatoria())->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"><a href="' . $root . 'descargaC/?ref=' . ($cndcvt->getCodigoconvocatoria())->getReferencia() . '&file=' . basename(($cndcvt->getCodigoconvocatoria())->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 '<td class="centrado">';
if( !in_array((($cndcvt->getCodigoconvocatoria())->getCodigoestadoconvocatoria())->getIdestadoconvocatoria(),[6,7,8,9]) ) {
echo '<form method="post" name="frmConvocatoria" id="frmConvocatoria" action="'. $root . 'en/call-details/?id=' . ($cndcvt->getCodigoconvocatoria())->getIdconvocatoria() .'" class="ng-pristine ng-valid">
<input type="hidden" name="convReferencia" id="convReferencia" value="' . ($cndcvt->getCodigoconvocatoria())->getReferencia() . '" autocomplete="off">
<input type="hidden" name="isEdit" id="isEdit" value="true" autocomplete="off">
<button type="submit" class="button-candidat" id="btnInscribirse" name="accionConvocatoria" value="Register" title="' . __('Edit', 'panoramic_child') . '">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil-square" viewBox="0 0 16 16">
<path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z"></path>
<path fill-rule="evenodd" d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5v11z"></path>
</svg>
</button>
</form>';
}
echo '</td>';
echo '</tr>';
} else {
$flagExisteConvEspontanea = true;
echo '<tr class="cebra"><td></td>';
echo '<td>' . $cndcvt->getPuestoTrabajo() . '</td>';
echo '<td>' . $cndcvt->getFechainscripcion()->format('d/m/Y') . '</td>';
echo '<td>Free Call</td>';
echo '<td></td>';
}
}
}
} else {
if($data['lconvocatorias'] == null || !isset($data['lconvocatorias']) && count($data['lconvocatorias'])<=0) {
$flagExisteConvEspontanea = false;
echo '<tr><td><br>Aún no te has inscrito a ninguna candidatura</td></tr>';
} else {
foreach ($data['lconvocatorias'] as $cndcvt) {
if($cndcvt->getCodigoconvocatoria()) { //Si no es espontanea
echo '<tr class="cebra link" onclick="window.location=\'' . $root . 'detalle-de-convocatoria/?id=' . ($cndcvt->getCodigoconvocatoria())->getIdconvocatoria() . '\';"><td>';
echo ($cndcvt->getCodigoconvocatoria())->getReferencia() . '</td>';
echo '<td>' . $cndcvt->getPuestoTrabajo() . '</td>';
echo '<td>' . $cndcvt->getFechainscripcion()->format('d/m/Y') . '</td>';
echo '<td>' . (($cndcvt->getCodigoconvocatoria())->getCodigoestadoconvocatoria())->getEstado() . '</td>';
if(($cndcvt->getCodigoconvocatoria())->getRutaarchivoresolucionfinal()!= null && strlen(trim(($cndcvt->getCodigoconvocatoria())->getRutaarchivoresolucionfinal()))>0) {
echo '<td class="centrado"><a href="' . $root . 'descargaC/?ref=' . ($cndcvt->getCodigoconvocatoria())->getReferencia() . '&file=' . basename(($cndcvt->getCodigoconvocatoria())->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"><a href="' . $root . 'descargaC/?ref=' . ($cndcvt->getCodigoconvocatoria())->getReferencia() . '&file=' . basename(($cndcvt->getCodigoconvocatoria())->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 '<td class="centrado">';
if( !in_array((($cndcvt->getCodigoconvocatoria())->getCodigoestadoconvocatoria())->getIdestadoconvocatoria(),[6,7,8,9]) ) {
echo '<form method="post" name="frmConvocatoria" id="frmConvocatoria" action="'. $root . 'detalle-de-convocatoria/?id=' . ($cndcvt->getCodigoconvocatoria())->getIdconvocatoria() .'" class="ng-pristine ng-valid">
<input type="hidden" name="convReferencia" id="convReferencia" value="' . ($cndcvt->getCodigoconvocatoria())->getReferencia() . '" autocomplete="off">
<input type="hidden" name="isEdit" id="isEdit" value="true" autocomplete="off">
<button type="submit" class="button-candidat" id="btnInscribirse" name="accionConvocatoria" value="Register" title="' . __('Edit', 'panoramic_child') . '">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil-square" viewBox="0 0 16 16">
<path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z"></path>
<path fill-rule="evenodd" d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5v11z"></path>
</svg>
</button>
</form>';
}
echo '</td>';
echo '</tr>';
} else {
$flagExisteConvEspontanea = true;
echo '<tr class="cebra"><td></td>';
echo '<td>' . $cndcvt->getPuestoTrabajo() . '</td>';
echo '<td>' . $cndcvt->getFechainscripcion()->format('d/m/Y') . '</td>';
echo '<td>Candidatura Espontánea</td>';
echo '<td></td>';
}
}
}
}
echo '</tbody></table>';
}
if( !$flagExisteConvEspontanea )
{
if($lang=='en' || $lang=='en_GB')
{
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="' . ($data['candidato']->getCodigousuariowp())->getId() . '" hidden>';
if($lang=='en' || $lang=='en_GB')
{
echo '<input type="button" name="btnaccionConvocatoria" value="Register a Free Call" onClick="fncconvocatoriaespontaneasubmit(this) ;">';
}
else
{
echo '<input type="button" name="btnaccionConvocatoria" value="Inscribirse Espontáneamente" onClick="fncconvocatoriaespontaneasubmit(this) ;">';
}
echo '</tbody></table>';
echo '</form></section>';
}
?>
<script language="javascript">
var x = document.getElementsByClassName("entry-title");
var i;
for (i = 0; i < x.length; i++) {
x[i].style.visibility = "hidden";
}
function fncconvocatoriaespontaneasubmit(object, id) {
document.getElementById("accionMisCandidaturas").value = 'Register';
document.getElementById("frmConvocatoriaEspontanea").submit();
}
</script>