<?php
include 'includes/config.php';

$id   = $_POST['id'] ?? 0;
$paid = $_POST['paid'] ?? 0;

if($id>0 && $paid>0){
    $stmt = $conn->prepare("UPDATE customer_installments SET status='paid', paid_date=NOW(), amount=:paid WHERE id=:id");
    $stmt->execute([':id'=>$id, ':paid'=>$paid]);
    echo "Payment successful!";
} else {
    echo "Invalid request";
}
?>
