<?php
require_once __DIR__ . '/../auth/verifica.php';
require_once __DIR__ . '/../config/conexao.php';

$id = $_GET['id'];

$pdo->prepare("
UPDATE contas_pagar 
SET status = IF(status='pendente','pago','pendente') 
WHERE id=?
")->execute([$id]);

header("Location: contas_pagar.php");