public function consultarOpcAction() { $opcDao = new OpcionSistemaDao($this->getDoctrine()); $opciones = $opcDao->getOpciones(); $numfilas = count($opciones); $opc = new OpcionSistema(); $i = 0; foreach ($opciones as $opc) { $rows[$i]['id'] = $opc->getIdOpcionSistema(); $rows[$i]['cell'] = array($opc->getIdOpcionSistema(), $opc->getNombreOpcion(), $opc->getDescripcionOpcion(), $opc->getEnlace(), $opc->getIdOpcionSistema2()); $i++; } $datos = json_encode($rows); $jsonresponse = '{ "page":"1", "total":"1", "records":"' . $numfilas . '", "rows":' . $datos . '}'; $response = new Response($jsonresponse); return $response; }
public function opcionesSinAsignarAction() { $idRol = $this->getRequest()->get('reg'); $rolDao = new RolDao($this->getDoctrine()); $opciones = $rolDao->consultarOpcNoSeleccRol($idRol); $numfilas = count($opciones); $datos = '[]'; $opc = new OpcionSistema(); $i = 0; foreach ($opciones as $opc) { $rows[$i]['id'] = $opc->getIdOpcionSistema(); $rows[$i]['cell'] = array($opc->getIdOpcionSistema(), $opc->getNombreOpcion()); $i++; } if ($numfilas > 0) { $datos = json_encode($rows); } $jsonresponse = '{ "page":"1", "total":"1", "records":"' . $numfilas . '", "rows":' . $datos . '}'; $response = new Response($jsonresponse); return $response; }