$hor->tipo = $_REQUEST['tipo']; $hor->añadirHorario($hor); } if ($accion == "Guardar") { $hor = new horario(); $hor = $hor->getHorarios($opc); $activos = new horario(); $desactivados = new horario(); foreach ($hor as $l) { if (in_array($l["idHorario"], $_REQUEST['check'])) { $activos->activar($l); } else { $desactivados->desactivar($l); } } if ($_REQUEST['tipo'] == "lampara") { header("location:../Vistas/iluminacion.php"); } else { header("location:../Vistas/riego.php"); } } if ($accion == "Borrar") { $hor = new horario(); $hor->getHorarios($opc); $hor->borrar($_REQUEST['check']); if ($_REQUEST['tipo'] == "lampara") { header("location:../Vistas/iluminacion.php"); } else { header("location:../Vistas/riego.php"); } }