:: **Zploit** v1.0 | Current Path: **/home/kreativepixelz/www/crm/quatation/**
:: Editing File: billing_delete.php
<?php include 'db.php'; include_once("session.php"); // check that an id was provided if (!isset($_GET['id']) || !is_numeric($_GET['id'])) { $_SESSION['error'] = "❌ Invalid request."; header("Location: billing_list.php"); exit; } $billing_id = (int)$_GET['id']; mysqli_begin_transaction($conn); try { $sql = "DELETE FROM billing WHERE id = ?"; $stmt = $conn->prepare($sql); $stmt->bind_param("i", $billing_id); if (!$stmt->execute()) { throw new Exception("Delete failed: " . $stmt->error); } mysqli_commit($conn); $_SESSION['success'] = "✅ Billing record deleted successfully."; header("Location: billing_list.php"); exit; } catch (Exception $e) { mysqli_rollback($conn); $_SESSION['error'] = "❌ Error deleting billing record: " . $e->getMessage(); header("Location: billing_list.php"); exit; } ?>