if($_POST['materia'] != "nil"){ $materiafiltro = new Materia($db); $materiafiltro = $materiafiltro->findBy('mat_name',$_POST['materia']); if($materiafiltro){ $materiafiltro = $materiafiltro[0]; foreach ($apuntes as $key => $apunte) { if($apunte->getMat_id() != $materiafiltro->getMat_id()){ unset($apuntes[$key]); } } }}*/ if ($_POST['anho'] != "nil") { foreach ($apuntes as $key => $apunte) { if ($apunte->getAnho_academico() != $_POST['anho']) { unset($apuntes[$key]); } } } $renderPlantilla->apuntes = $apuntes; } else { $renderPlantilla->apuntes = 'nil'; } if (isset($_SESSION['name'])) { $renderPlantilla->logged = true; } else { $renderPlantilla->logged = false; } //RENDERIZADO FINAL $renderMain->title = "Apuntes de la comunidad";