public function indexAction()
 {
     $form = new CercaInteract("CercaInteract");
     $form->get('posterlab')->setValueOptions($this->getContenutiDao()->obtenerPosterlabsSelect());
     $this->initAjaxContext();
     return new ViewModel(array('usuarios' => $this->getInterattivoDao()->tutti(), 'titulo' => 'Interattivo', 'form' => $form));
 }
 public function cercaAction()
 {
     $values = $this->getRequest()->getQuery()->toArray();
     //print_r($values);die;
     $idposterlab = $values["posterlab"];
     $idsession = $values["sessioni"];
     $categoria = $values["categoria"];
     $stato = $values["stato"];
     $nombreactualposter = $this->getContenutiDao()->obtenerPosterlabActual($idposterlab);
     $nombresito = $nombreactualposter->getTitolo();
     $this->initAjaxContext();
     $this->initAjaxBusquedaContext();
     $tablastato = $this->config['parametros']['tabla']['stato'];
     $this->layout()->tablastato = $tablastato;
     $form = new CercaInteract("CercaInteract");
     $form->get('posterlab')->setValueOptions($this->getContenutiDao()->obtenerPosterlabsSelect());
     $form->get('posterlab')->setValue($idposterlab);
     $form->get('sessioni')->setValueOptions($this->getInterattivoDao()->obtenerSessioniSelect($idposterlab));
     $form->get('sessioni')->setValue($idsession);
     $form->get('categoria')->setValueOptions($this->llenarCategorias());
     $form->get('categoria')->setValue($categoria);
     $form->get('stato')->setValueOptions($this->llenarStati());
     $form->get('stato')->setValue($stato);
     $placenombre = $this->config['parametros']['placeholder']['nombre'];
     $placebuscar = $this->config['parametros']['placeholder']['buscar'];
     $placever = $this->config['parametros']['placeholder']['ver'];
     $encontrados = $this->config['parametros']['buscar']['encontrados'];
     $this->layout()->placenom = $placenombre;
     $this->layout()->busca = $placebuscar;
     $this->layout()->ver = $placever;
     $this->layout()->encontrados = $encontrados;
     if (null === $idposterlab || empty($idposterlab)) {
         return $this->redirect()->toRoute('admin', array('controller' => 'contenuti', 'action' => 'index'));
     }
     $listaUsuario = $this->getInterattivoDao()->cercaPerPosterlab($idposterlab, $idsession, $categoria, $stato);
     $viewModel = new ViewModel(array('form' => $form, 'usuarios' => $listaUsuario, 'titulo' => 'Interattivo', 'titulo1' => ucfirst($nombresito), 'titulos' => 'Trovati (' . $listaUsuario->count() . ') ', 'title' => 'Lista Interattivo', 'placenom' => $placenombre, 'placebusca' => $placebuscar, 'placever' => $placever, 'posicion' => 'Posizione', 'tablastato' => $tablastato));
     $viewModel->setTemplate("admin/interattivo/index");
     return $viewModel;
 }