Tul xxx Tul
User / IP
:
216.73.216.159
Host / Server
:
45.84.207.204 / aircan.me
System
:
Linux lt-bnk-web1726.main-hosting.eu 5.14.0-611.36.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 3 11:23:52 EST 2026 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
u931257429
/
domains
/
emprendo.com.co
/
public_html2
/
cuentame
/
models
/
Viewing: PaymentDetail.php
<?php class PaymentDetail { private $db; public function __construct() { $this->db = (new Database())->connect(); $this->ensureSchema(); } private function ensureSchema() { $this->db->exec('CREATE TABLE IF NOT EXISTS payment_details ( id INT AUTO_INCREMENT PRIMARY KEY, payment_id INT NOT NULL, description VARCHAR(255) NOT NULL, quantity DECIMAL(10,2) NOT NULL DEFAULT 1, price DECIMAL(10,2) NOT NULL DEFAULT 0, subtotal DECIMAL(10,2) NOT NULL DEFAULT 0, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, INDEX (payment_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4'); } public function getByPaymentId($payment_id) { $stmt = $this->db->prepare('SELECT * FROM payment_details WHERE payment_id = ? ORDER BY id ASC'); $stmt->execute([$payment_id]); return $stmt->fetchAll(PDO::FETCH_ASSOC); } public function replaceForPayment($payment_id, $items) { error_log('PaymentDetail: replaceForPayment called with payment_id: ' . $payment_id); error_log('PaymentDetail: items received: ' . print_r($items, true)); $this->db->beginTransaction(); try { $del = $this->db->prepare('DELETE FROM payment_details WHERE payment_id = ?'); $del->execute([$payment_id]); error_log('PaymentDetail: deleted existing items for payment_id: ' . $payment_id); if (!empty($items)) { $ins = $this->db->prepare('INSERT INTO payment_details (payment_id, description, quantity, price, subtotal) VALUES (?, ?, ?, ?, ?)'); $insertedCount = 0; foreach ($items as $it) { $desc = trim($it['description'] ?? ''); $qty = (float)($it['quantity'] ?? 0); $price = (float)($it['price'] ?? 0); $sub = (float)($it['subtotal'] ?? ($qty * $price)); if ($desc === '' || $qty <= 0) { error_log('PaymentDetail: skipping item - desc: "' . $desc . '", qty: ' . $qty); continue; } $result = $ins->execute([$payment_id, $desc, $qty, $price, $sub]); if ($result) { $insertedCount++; error_log('PaymentDetail: inserted item - desc: "' . $desc . '", qty: ' . $qty . ', price: ' . $price . ', subtotal: ' . $sub); } else { error_log('PaymentDetail: failed to insert item - desc: "' . $desc . '"'); } } error_log('PaymentDetail: total items inserted: ' . $insertedCount); } else { error_log('PaymentDetail: no items to insert (empty array)'); } $this->db->commit(); error_log('PaymentDetail: transaction committed successfully'); return true; } catch (Throwable $e) { $this->db->rollBack(); error_log('PaymentDetail: transaction failed - ' . $e->getMessage()); return false; } } }
Coded With 💗 by
0x6ick