diff --git a/app/Resources/views/cea/index.html.twig b/app/Resources/views/cea/index.html.twig index 793595f..5208554 100644 --- a/app/Resources/views/cea/index.html.twig +++ b/app/Resources/views/cea/index.html.twig @@ -27,6 +27,21 @@ {%endif %}
+ {% if tiempoProxEscalafon %} + {% if suffix == '' %} +

+ Estimado docente, le recordamos que para solicitar ascenso aun le faltan: + {% else %} +

+ Estimado docente ya tiene el tiempo para solicitar ascenso desde hace: + {% endif %} + + {% if tiempoProxEscalafon.y > 0 %} {{ tiempoProxEscalafon.y }} año/s {% endif %} + {% if tiempoProxEscalafon.m > 0 %} {{ tiempoProxEscalafon.m }} mes/es y {% endif %} + {% if tiempoProxEscalafon.d > 0 %} {{ tiempoProxEscalafon.d }} día/s {% endif %} + +

+ {% endif %}
@@ -38,7 +53,9 @@
- Estimado Docente, le damos la más cordial bienvenida al Sistema del Centro de Estudios Ambientales (CEA) de la Universidad Bolivariana de Venezuela (UBV) CEA@UBV. + Estimado Docente, le damos la más cordial bienvenida al Sistema del + Centro de Estudios Ambientales (CEA) de la Universidad Bolivariana + de Venezuela (UBV) CEA@UBV.
diff --git a/src/AppBundle/Controller/AppController.php b/src/AppBundle/Controller/AppController.php index c670eab..3336cac 100644 --- a/src/AppBundle/Controller/AppController.php +++ b/src/AppBundle/Controller/AppController.php @@ -62,9 +62,10 @@ class AppController extends Controller { $escalafones = $this->getDoctrine()->getRepository("AppBundle:Escalafones")->findOneById($escalafon->getIdEscala()->getId() + 1); //tiempo para el proximo escalafon if($escalafones){ //tiempo para el prox escalafon - $tiempoProxEscalafon = $escalafon->getFechaEscala()->modify('+4 years'); - $tiempoTranscurrido = $tiempoProxEscalafon->diff(new \DateTime("now")); - var_dump($tiempoTranscurrido); exit; + $tiempoProxEscalafon = $escalafon->getFechaEscala()->modify('+' . $escalafones->getTiempo() . 'years'); + $hoy = new \DateTime("now"); + $tiempoTranscurrido = $hoy->diff($tiempoProxEscalafon); + $suffix = ( $tiempoTranscurrido->invert ? ' ago' : '' ); } } @@ -76,7 +77,9 @@ class AppController extends Controller { if($adscripcion->getIdEstatus()->getId() == 1) $adscrito = true; return $this->render('cea/index.html.twig', array ( - 'adscrito' => $adscrito + 'adscrito' => $adscrito, + 'tiempoProxEscalafon' => $tiempoTranscurrido, + 'suffix' => $suffix )); }