tieneAcceso()){ $objValida->terminaSesion(); } if(!$objSesion->puedeEditar()){ header("Location: ../main.php"); exit(); } unset($objValida); $pag = "../usuario.php"; if(isset($_POST["id"]) || isset($_POST["estado"])){ header("Location:".$pag."?error=0"); exit(); } $usr_id = filter_input(INPUT_POST, "id", FILTER_SANITIZE_NUMBER_INT);//limpia texto $estado = filter_input(INPUT_POST, "estado", FILTER_SANITIZE_NUMBER_INT);//limpia texto try { $stmt = $pdo->prepare('Select * from fu_usuariocambiaestado(:id, :edo)'); $stmt->bindParam(":id", $usr_id); $stmt->bindParam(":edo", $estado); if(!$stmt->execute()){ header("Location:".$pag."?error=1"); exit(); } $log = new LogActividad(); $desc_log = "Cambia estado de usuario ID[".$usr_id."] Estado[".$estado."]"; $log->appendLog($_SESSION["usuario_id"], $_SESSION["usuario_nombre"]." ".$_SESSION["usuario_apellidos"], $desc_log); $stmt->closeCursor(); // cierra conexion de resultado $stmt = null; // cierra conexion header("Location:".$pag); } catch(PDOException $e) { $pdo->rollBack(); header("Location:".$pag."?error=1"); } ?>