| Server IP : 72.60.21.38 / Your IP : 216.73.216.25 Web Server : LiteSpeed System : Linux uk-fast-web1372.main-hosting.eu 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64 User : u390967363 ( 390967363) PHP Version : 8.2.30 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/u390967363/domains/aibenproperties.com/public_html/app/ |
Upload File : |
<?php
require_once 'includes/db.php';
$allocation_id = 45;
$payment_id = 3583;
// Update installments to total 3,000,000 (1,000,000 each) and mark the first as paid
$stmt = $pdo->prepare('SELECT id FROM installments WHERE allocation_id = ? ORDER BY due_date ASC');
$stmt->execute([$allocation_id]);
$inst_ids = $stmt->fetchAll(PDO::FETCH_COLUMN);
if (count($inst_ids) == 3) {
// Installment 1: Paid
$stmt1 = $pdo->prepare('UPDATE installments SET amount_due = 1000000, amount = 1000000, paid_amount = 1000000, amount_paid = 1000000, status = "paid", title = "1st Installment" WHERE id = ?');
$stmt1->execute([$inst_ids[0]]);
// Installment 2: Pending
$stmt2 = $pdo->prepare('UPDATE installments SET amount_due = 1000000, amount = 1000000, paid_amount = 0, amount_paid = 0, status = "pending", title = "2nd Installment" WHERE id = ?');
$stmt2->execute([$inst_ids[1]]);
// Installment 3: Pending
$stmt3 = $pdo->prepare('UPDATE installments SET amount_due = 1000000, amount = 1000000, paid_amount = 0, amount_paid = 0, status = "pending", title = "3rd Installment" WHERE id = ?');
$stmt3->execute([$inst_ids[2]]);
echo "Updated installments.\n";
} else {
echo "Found " . count($inst_ids) . " installments instead of 3.\n";
}
// Ensure the payment is linked to the first installment if possible
if (function_exists('tableHasColumn') && tableHasColumn('payments', 'installment_id')) {
$pdo->prepare('UPDATE payments SET installment_id = ? WHERE id = ?')->execute([$inst_ids[0], $payment_id]);
echo "Linked payment to installment.\n";
}