tieneAcceso() || !$objSesion->puedeEditar()){ header("Location: main.php"); exit; } if(!isset($_GET["id"]) || trim($_GET["id"]) == ""){ header("Location: materias.php?error=0"); exit; } $id = filter_input(INPUT_GET, "id", FILTER_SANITIZE_NUMBER_INT);//limpia texto //Datos de materia $stmt = $pdo->prepare('Select * from fs_materia(:id, NULL, NULL, NULL, NULL, 0, 1)'); $stmt->bindParam(":id", $id); if(!$stmt->execute()){ header("Location: materias.php?error=2"); exit(); }else{ $materia_rs = $stmt->fetch(); } $stmt->closeCursor(); if(!is_array($materia_rs) || count($materia_rs) == 0){ header("Location: materias.php?error=1"); exit(); } ?>