{% extends "@crud\\crud\\show.html.twig" %}
{% block stylesheets %}
{{ parent() }}
<link type="text/css" rel="stylesheet" href="{{ asset('ace/css/jquery.treetable.css') }}">
<link type="text/css" rel="stylesheet" href="{{ asset('ace/css/jquery.treetable.theme.default.css') }}">
<!--link type="text/css" rel="stylesheet" href="{{ asset('style/jquery-ui.css') }}"-->
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script src="{{ asset('ace/js/jquery.treetable.js') }}" type="text/javascript"></script>
{% endblock %}
{% block jquery %}
{{ parent() }}
<script type="text/javascript">
$(function()
{
$('#table_test_psicologico').treetable({ expandable: true, indent: 10 });
});
</script>
{% endblock %}
{% block show_details %}
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title green">
<a id="atab-1" aria-expanded="true" class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#datosTest">
<i class="bigger-160 ace-icon fa fa-user " data-icon-hide="ace-icon fa fa-angle-down" data-icon-show="ace-icon fa fa-angle-right"></i>
Resultado del test psicológico
</a>
</h4>
</div>
<div id='datosTest' class="panel-collapse collapse in" aria-expanded="true">
<a class="btnExpand" onclick="jQuery('#table_test_psicologico').treetable('expandAll'); return false;">
<button class="btn btn-white btn-inverse btn-bold btn-round" title="{% trans %}botones.expandir{% endtrans %}">
<img src="{{ asset('images/icon/expandir.png') }}" width="16px"><span class="hidden-xs"> {% trans %}botones.expandir{% endtrans %}</span>
</button>
</a>
<a class="btnExpand" onclick="jQuery('#table_test_psicologico').treetable('collapseAll'); return false;">
<button class="btn btn-white btn-inverse btn-bold btn-round" title="{% trans %}botones.recoger{% endtrans %}">
<img src="{{ asset('images/icon/recoger.png') }}" width="16px"><span class="hidden-xs"> {% trans %}botones.recoger{% endtrans %}</span>
</button>
</a>
<a class="btnExpand" href="{{ path('excel_respuestas_test', {'id': entity.id}) }}">
<button class="btn btn-white btn-inverse btn-bold btn-round" title="Exportar a excel">
<img src="{{ asset('images/icon/icono_excel_32.png') }}" width="16px"><span class="hidden-xs"> Exportar a excel</span>
</button>
</a>
<table id="table_test_psicologico" class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th style="width: 150px">
Tipo
</th>
<th>
Nombre
</th>
<th>
Valor
</th>
<th style="width: 130px">
Riesgo Bajo
</th>
<th style="width: 130px">
Riesgo Medio
</th>
<th style="width: 130px">
Riesgo Alto
</th>
{% if is_granted('ROLE_PSICOLOGO_JEFE') %}
<th style="width: 105px">
Tipo Pregunta
</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for sistemaId, sistema in preguntas %}
<tr id="S-{{ sistemaId }}" parentId="" data-tt-id="S-{{ sistemaId }}" data-tt-parent-id="" style="font-size: 16px; font-weight: bold">
<td>
SISTEMA
</td>
<td>
{{ sistema.nombre }}
</td>
{% if is_granted('ROLE_PSICOLOGO_JEFE') %}
<td colspan="5"></td>
{% else %}
<td colspan="4"></td>
{% endif %}
</tr>
{% if sistema.ejes is defined %}
{% for ejeId, eje in sistema.ejes %}
<tr id="E-{{ ejeId }}" parentId="S-{{ sistemaId }}" data-tt-id="E-{{ ejeId }}" data-tt-parent-id="S-{{ sistemaId }}" style="background:orange">
<td>
EJE
</td>
<td style="font-size: 14px;">
{{ eje.nombre }}
</td>
{% if is_granted('ROLE_PSICOLOGO_JEFE') %}
<td colspan="5"></td>
{% else %}
<td colspan="4"></td>
{% endif %}
</tr>
{% if eje.criterios is defined %}
{% for criterioId, criterio in eje.criterios %}
<tr id="C-{{ criterioId }}" parentId="E-{{ ejeId }}" data-tt-id="C-{{ criterioId }}" data-tt-parent-id="E-{{ ejeId }}">
<td>
CRITERIO
</td>
<td style="font-size: 12px; font-weight: bold">
{{ criterio.criterio.nombre }}
</td>
<td>
{{ criterio.suma }}
</td>
<td {% if criterio.suma < criterio.criterio.riesgoMedioDesde %}style="background-color: green;color: #fff; font-size: 14px""{% endif %}>
{{ criterio.criterio.riesgoBajoDesde }} a {{ criterio.criterio.riesgoBajoHasta }}
</td>
<td {% if criterio.suma >= criterio.criterio.riesgoMedioDesde and criterio.suma <= criterio.criterio.riesgoMedioHasta %}style="background-color: yellow; font-size: 14px""{% endif %}>
{{ criterio.criterio.riesgoMedioDesde }} a {{ criterio.criterio.riesgoMedioHasta }}
</td>
<td {% if criterio.suma > criterio.criterio.riesgoMedioHasta %}style="background-color: red;color: #fff; font-size: 14px"{% endif %}>
{{ criterio.criterio.riesgoAltoDesde }} a {{ criterio.criterio.riesgoAltoHasta }}
</td>
{% if is_granted('ROLE_PSICOLOGO_JEFE') %}
<td></td>
{% endif %}
</tr>
{% if is_granted('ROLE_PSICOLOGO_JEFE') and criterio.preguntas is defined %}
{% for pregunta in criterio.preguntas %}
<tr id="P-{{ pregunta.pregunta.id }}" parentId="C-{{ criterioId }}" data-tt-id="P-{{ pregunta.pregunta.id }}" data-tt-parent-id="C-{{ criterioId }}">
<td>
PREGUNTA
</td>
<td style="font-size: 12px;">
{{ pregunta.pregunta.nombre }}
</td>
<td>
{{ pregunta.txt }}
</td>
<td colspan="3"></td>
<td>
{% if pregunta.pregunta.tipo=='directo' %}Directa{% else %}Inversa{% endif %}
</td>
</tr>
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
{% endfor%}
</tbody>
</table>
<hr>
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th style="text-align: center;">Sistema</th>
<th style="text-align: center;">Preguntas</th>
<th style="text-align: center;">Porciento</th>
<th style="text-align: center;">Respuestas</th>
<th style="text-align: center;">Resultado</th>
</tr>
</thead>
<tbody>
{% for sistemaId, sistema in preguntas %}
<tr>
<td style="text-align: right; width: 20%">{{ sistema.nombre }}</td>
<td style="text-align: right;width: 20%">{{ sistema.cant_preguntas }}</td>
<td style="text-align: right;width: 20%">{{ sistema.porciento }}%</td>
<td style="text-align: right;width:20%">{{ sistema.suma_respuestas }}</td>
<td style="text-align: right;width: 20%">{{ sistema.resultado }}%</td>
</tr>
{% endfor %}
<tr>
<th colspan="4" style="text-align: right;font-size: 20px;">Total</th>
{% if total <=60%}
<td style="text-align: right;background-color: green; color: #fff; font-size: 20px">{{ total }}%<br/>RIESGO BAJO</td>
{% endif %}
{% if total >60 and total<=80%}
<td style="text-align: right;background-color: yellow; color: #000; font-size: 20px">{{ total }}%<br/>RIESGO MEDIO</td>
{% endif %}
{% if total >80%}
<td style="text-align: right;background-color: red; color: #fff; font-size: 20px">{{ total }}%<br/>RIESGO ALTO</td>
{% endif %}
</tr>
<tbody>
</table>
</div>
</div>
{% endblock show_details %}
{% block actions %}
{% endblock actions %}
{% block showdata %}
{{ render(controller('App\\Crud\\Controller\\crudPlainController::showAction', {'rol': 'all', 'routeClassName':'recluta', 'id':entity.recluta, 'parentRouteClassName':'ANY' })) }}
{% endblock %}