public function consultarPeriodoOficialJSONAction()
 {
     $periodoOficialDao = new PeriodoOficialDao($this->getDoctrine());
     $periodoOficial = new PeriodoOficial();
     $periodoOficial = $periodoOficialDao->getPeriodoOficial();
     $numfilas = count($periodoOficial);
     $aux = new PeriodoOficial();
     $i = 0;
     foreach ($periodoOficial as $aux) {
         $rows[$i]['id'] = $aux->getIdPerOfi();
         $rows[$i]['cell'] = array($aux->getIdPerOfi(), $aux->gettipPerioPerOfi()->getNomTipPer(), DATE_FORMAT($aux->getFechIniPerOfi(), 'd/m/Y'), DATE_FORMAT($aux->getFechFinPerOfi(), 'd/m/Y'), $aux->getActivoPerOfi());
         if ($aux->getActivoPerOfi()) {
             $rows[$i]['cell'][4] = 'SI';
         } else {
             $rows[$i]['cell'][4] = 'NO';
         }
         $i++;
     }
     $datos = json_encode($rows);
     $jsonresponse = '{
            "page":"1",
            "total":"1",
            "records":"' . $numfilas . '", 
            "rows":' . $datos . '}';
     $response = new Response($jsonresponse);
     return $response;
 }